- Add is_featured column to jobs table (migration) - Update Job model and Service to support featured jobs - Update JobHandler to expose featured jobs API - Support filtering by featured status in GET /jobs - Frontend: Fetch and display featured jobs from API - Frontend: Update Job type definition
53 lines
1.9 KiB
Go
Executable file
53 lines
1.9 KiB
Go
Executable file
package models
|
|
|
|
import "time"
|
|
|
|
// Job represents a job posting
|
|
type Job struct {
|
|
ID int `json:"id" db:"id"`
|
|
CompanyID int `json:"companyId" db:"company_id"`
|
|
CreatedBy int `json:"createdBy" db:"created_by"`
|
|
|
|
// Job Details
|
|
Title string `json:"title" db:"title"`
|
|
Description string `json:"description" db:"description"`
|
|
|
|
// Salary
|
|
SalaryMin *float64 `json:"salaryMin,omitempty" db:"salary_min"`
|
|
SalaryMax *float64 `json:"salaryMax,omitempty" db:"salary_max"`
|
|
SalaryType *string `json:"salaryType,omitempty" db:"salary_type"` // hourly, monthly, yearly
|
|
|
|
// Employment
|
|
EmploymentType *string `json:"employmentType,omitempty" db:"employment_type"` // full-time, part-time, dispatch, contract
|
|
WorkingHours *string `json:"workingHours,omitempty" db:"working_hours"`
|
|
|
|
// Location
|
|
Location *string `json:"location,omitempty" db:"location"`
|
|
RegionID *int `json:"regionId,omitempty" db:"region_id"`
|
|
CityID *int `json:"cityId,omitempty" db:"city_id"`
|
|
|
|
// Requirements & Benefits (JSONB arrays)
|
|
Requirements JSONMap `json:"requirements,omitempty" db:"requirements"`
|
|
Benefits JSONMap `json:"benefits,omitempty" db:"benefits"`
|
|
|
|
// Visa & Language
|
|
VisaSupport bool `json:"visaSupport" db:"visa_support"`
|
|
LanguageLevel *string `json:"languageLevel,omitempty" db:"language_level"` // N5-N1, beginner, none
|
|
|
|
// Status
|
|
Status string `json:"status" db:"status"` // open, closed, draft
|
|
IsFeatured bool `json:"isFeatured" db:"is_featured"` // Featured job flag
|
|
|
|
// Metadata
|
|
CreatedAt time.Time `json:"createdAt" db:"created_at"`
|
|
UpdatedAt time.Time `json:"updatedAt" db:"updated_at"`
|
|
}
|
|
|
|
// JobWithCompany includes company information
|
|
type JobWithCompany struct {
|
|
Job
|
|
CompanyName string `json:"companyName"`
|
|
CompanyLogoURL *string `json:"companyLogoUrl,omitempty"`
|
|
RegionName *string `json:"regionName,omitempty"`
|
|
CityName *string `json:"cityName,omitempty"`
|
|
}
|