Files
krow_backend/go-api/internal/domain/resources_gen.go
2026-08-24 13:06:29 +05:30

397 lines
26 KiB
Go

// Code generated by scripts/gen_resources.py. DO NOT EDIT BY HAND.
// Regenerate with: make gen-resources
//
// Column names, types, enum values and nullability are read out of
// information_schema so they cannot drift from the migrations. The
// per-resource metadata (path, default sort, default limit, supported
// operations, required fields) comes from docs/api-contract.md.
package domain
// AllResources is every resource the API serves.
var AllResources = []*Resource{
{
Name: "JobPosting", Path: "job-postings", Table: "job_postings",
DefaultSort: "-created_date", DefaultLimit: 100,
Ops: OpList | OpGet | OpCreate | OpUpdate,
Columns: []Column{
{Name: "id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "legacy_id", Kind: KindString, PGType: "text", ReadOnly: true},
{Name: "org_id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "created_by", Kind: KindUUID, PGType: "uuid", ReadOnly: true},
{Name: "company", Kind: KindString, PGType: "text", NotNull: true},
{Name: "title", Kind: KindString, PGType: "text", NotNull: true, Required: true},
{Name: "role_category", Kind: KindString, PGType: "text", NotNull: true},
{Name: "description", Kind: KindString, PGType: "text", NotNull: true},
{Name: "responsibilities", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "qualifications", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "nice_to_haves", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "custom_requirements", Kind: KindString, PGType: "text", NotNull: true},
{Name: "physical_requirements", Kind: KindString, PGType: "text", NotNull: true},
{Name: "leadership_expectations", Kind: KindString, PGType: "text", NotNull: true},
{Name: "attendance_expectations", Kind: KindString, PGType: "text", NotNull: true},
{Name: "min_experience_years", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "english_required", Kind: KindEnum, PGType: "english_level", NotNull: true, Enum: []string{"basic", "conversational", "fluent", "native"}},
{Name: "certifications_required", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "skill_requirements", Kind: KindJSON, PGType: "jsonb", NotNull: true},
{Name: "pay_range_min", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "pay_range_max", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "location", Kind: KindString, PGType: "text", NotNull: true},
{Name: "status", Kind: KindEnum, PGType: "posting_status", NotNull: true, Enum: []string{"draft", "active", "paused", "closed"}},
{Name: "ai_generated", Kind: KindBool, PGType: "boolean", NotNull: true},
{Name: "headcount", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "start_date", Kind: KindDate, PGType: "date"},
{Name: "duration_months", Kind: KindFloat, PGType: "numeric"},
{Name: "priority", Kind: KindEnum, PGType: "posting_priority", NotNull: true, Enum: []string{"urgent", "high", "normal"}},
{Name: "vetting_criteria", Kind: KindJSON, PGType: "jsonb", NotNull: true},
{Name: "created_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
{Name: "updated_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
},
},
{
Name: "JobApplication", Path: "job-applications", Table: "job_applications",
DefaultSort: "-ai_score", DefaultLimit: 200,
Ops: OpList | OpCreate | OpUpdate | OpDelete,
Columns: []Column{
{Name: "id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "legacy_id", Kind: KindString, PGType: "text", ReadOnly: true},
{Name: "org_id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "job_posting_id", Kind: KindUUID, PGType: "uuid", NotNull: true, Required: true},
{Name: "worker_profile_id", Kind: KindUUID, PGType: "uuid"},
{Name: "job_title", Kind: KindString, PGType: "text", NotNull: true},
{Name: "applicant_name", Kind: KindString, PGType: "text", NotNull: true, Required: true},
{Name: "email", Kind: KindString, PGType: "citext", NotNull: true, Required: true},
{Name: "phone", Kind: KindString, PGType: "text", NotNull: true},
{Name: "years_experience", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "english_level", Kind: KindEnum, PGType: "english_level", NotNull: true, Enum: []string{"basic", "conversational", "fluent", "native"}},
{Name: "certifications", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "availability", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "skills", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "companies_worked", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "client_rating", Kind: KindFloat, PGType: "numeric", NotNull: true},
{Name: "professional_summary", Kind: KindString, PGType: "text", NotNull: true},
{Name: "cover_letter", Kind: KindString, PGType: "text", NotNull: true},
{Name: "selfie_url", Kind: KindString, PGType: "text", NotNull: true},
{Name: "status", Kind: KindEnum, PGType: "application_status", NotNull: true, Enum: []string{"applied", "ai_screened", "shortlisted", "interview", "hired", "rejected", "assigned"}},
{Name: "ai_score", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "ai_match_label", Kind: KindString, PGType: "text", NotNull: true},
{Name: "ai_summary", Kind: KindString, PGType: "text", NotNull: true},
{Name: "ai_strengths", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "ai_gaps", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "ai_recommendation", Kind: KindString, PGType: "text", NotNull: true},
{Name: "score_breakdown", Kind: KindJSON, PGType: "jsonb", NotNull: true},
{Name: "screened_at", Kind: KindTimestamp, PGType: "timestamptz"},
{Name: "created_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
{Name: "updated_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
{Name: "interview_id", Kind: KindUUID, PGType: "uuid"},
},
},
{
Name: "AIInterview", Path: "ai-interviews", Table: "ai_interviews",
DefaultSort: "-created_date", DefaultLimit: 100,
Ops: OpList | OpCreate,
Columns: []Column{
{Name: "id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "legacy_id", Kind: KindString, PGType: "text", ReadOnly: true},
{Name: "org_id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "application_id", Kind: KindUUID, PGType: "uuid", NotNull: true, Required: true},
{Name: "job_posting_id", Kind: KindUUID, PGType: "uuid", NotNull: true, Required: true},
{Name: "job_title", Kind: KindString, PGType: "text", NotNull: true},
{Name: "candidate_name", Kind: KindString, PGType: "text", NotNull: true},
{Name: "messages", Kind: KindJSON, PGType: "jsonb", NotNull: true},
{Name: "overall_interview_score", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "verdict", Kind: KindEnum, PGType: "interview_verdict", NotNull: true, Enum: []string{"hire", "maybe", "no"}},
{Name: "hire_recommendation", Kind: KindString, PGType: "text", NotNull: true},
{Name: "integrity_score", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "ai_flags", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "category_scores", Kind: KindJSON, PGType: "jsonb", NotNull: true},
{Name: "strengths", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "concerns", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "best_fit_roles", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "summary", Kind: KindString, PGType: "text", NotNull: true},
{Name: "reasoning", Kind: KindString, PGType: "text", NotNull: true},
{Name: "created_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
{Name: "updated_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
},
},
{
Name: "Staff", Path: "staff", Table: "staff",
DefaultSort: "-created_date", DefaultLimit: 100,
Ops: OpList | OpCreate | OpUpdate,
Columns: []Column{
{Name: "id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "legacy_id", Kind: KindString, PGType: "text", ReadOnly: true},
{Name: "org_id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "application_id", Kind: KindUUID, PGType: "uuid"},
{Name: "job_posting_id", Kind: KindUUID, PGType: "uuid"},
{Name: "worker_profile_id", Kind: KindUUID, PGType: "uuid"},
{Name: "name", Kind: KindString, PGType: "text", NotNull: true, Required: true},
{Name: "email", Kind: KindString, PGType: "citext", NotNull: true, Required: true},
{Name: "phone", Kind: KindString, PGType: "text", NotNull: true},
{Name: "role", Kind: KindString, PGType: "text", NotNull: true},
{Name: "profile_tier", Kind: KindEnum, PGType: "profile_tier", NotNull: true, Enum: []string{"Beginner", "Cross-Trained", "Skilled"}},
{Name: "hire_date", Kind: KindDate, PGType: "date", NotNull: true, Required: true},
{Name: "ai_score", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "status", Kind: KindEnum, PGType: "staff_status", NotNull: true, Enum: []string{"onboarding", "active", "inactive"}},
{Name: "client_rating", Kind: KindFloat, PGType: "numeric", NotNull: true},
{Name: "endorsement_text", Kind: KindString, PGType: "text", NotNull: true},
{Name: "endorsed_skills", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "review_date", Kind: KindDate, PGType: "date"},
{Name: "reviewer_name", Kind: KindString, PGType: "text", NotNull: true},
{Name: "created_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
{Name: "updated_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
},
},
{
Name: "WorkerProfile", Path: "worker-profiles", Table: "worker_profiles",
DefaultSort: "-krow_score", DefaultLimit: 500,
Ops: OpList | OpCreate | OpUpdate,
Columns: []Column{
{Name: "id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "legacy_id", Kind: KindString, PGType: "text", ReadOnly: true},
{Name: "org_id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "user_id", Kind: KindUUID, PGType: "uuid", ReadOnly: true},
{Name: "full_name", Kind: KindString, PGType: "text", NotNull: true, Required: true},
{Name: "email", Kind: KindString, PGType: "citext", NotNull: true, Required: true},
{Name: "phone", Kind: KindString, PGType: "text", NotNull: true},
{Name: "address", Kind: KindString, PGType: "text", NotNull: true},
{Name: "selfie_url", Kind: KindString, PGType: "text", NotNull: true},
{Name: "languages", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "availability", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "transportation", Kind: KindString, PGType: "text", NotNull: true},
{Name: "certifications", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "experience", Kind: KindJSON, PGType: "jsonb", NotNull: true},
{Name: "experience_years", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "current_position", Kind: KindString, PGType: "text", NotNull: true},
{Name: "desired_position", Kind: KindString, PGType: "text", NotNull: true},
{Name: "career_goals", Kind: KindString, PGType: "text", NotNull: true},
{Name: "skills", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "industries", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "personality", Kind: KindString, PGType: "text", NotNull: true},
{Name: "strengths", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "weaknesses", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "communication_style", Kind: KindString, PGType: "text", NotNull: true},
{Name: "salary_expectations", Kind: KindString, PGType: "text", NotNull: true},
{Name: "leadership_potential", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "ai_interview_score", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "krow_score", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "reliability_score", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "profile_completion", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "xp", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "completed_courses", Kind: KindJSON, PGType: "jsonb", NotNull: true},
{Name: "earned_badges", Kind: KindJSON, PGType: "jsonb", NotNull: true},
{Name: "capabilities", Kind: KindJSON, PGType: "jsonb", NotNull: true},
{Name: "shifts_completed", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "attendance_score", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "performance_score", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "client_rating", Kind: KindFloat, PGType: "numeric", NotNull: true},
{Name: "supervisor_rating", Kind: KindFloat, PGType: "numeric", NotNull: true},
{Name: "status", Kind: KindString, PGType: "text", NotNull: true},
{Name: "created_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
{Name: "updated_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
{Name: "score_breakdown", Kind: KindJSON, PGType: "jsonb", NotNull: true},
},
},
{
Name: "Course", Path: "courses", Table: "courses",
DefaultSort: "-created_date", DefaultLimit: 200,
Ops: OpList | OpGet | OpCreate | OpUpdate,
OrgNullable: true,
Columns: []Column{
{Name: "id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "legacy_id", Kind: KindString, PGType: "text", ReadOnly: true},
{Name: "org_id", Kind: KindUUID, PGType: "uuid", ReadOnly: true},
{Name: "title", Kind: KindString, PGType: "text", NotNull: true, Required: true},
{Name: "description", Kind: KindString, PGType: "text", NotNull: true},
{Name: "category", Kind: KindString, PGType: "text", NotNull: true},
{Name: "difficulty", Kind: KindString, PGType: "text", NotNull: true},
{Name: "xp", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "estimated_minutes", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "badge_reward", Kind: KindString, PGType: "text"},
{Name: "proof_skill", Kind: KindString, PGType: "text", NotNull: true},
{Name: "skill_id", Kind: KindString, PGType: "text"},
{Name: "target_level", Kind: KindEnum, PGType: "skill_level", Enum: []string{"beginner", "intermediate", "advanced", "expert"}},
{Name: "required_level", Kind: KindEnum, PGType: "skill_level", Enum: []string{"beginner", "intermediate", "advanced", "expert"}},
{Name: "completion_criteria", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "verification_criteria", Kind: KindTextArray, PGType: "text[]", NotNull: true},
{Name: "challenge", Kind: KindJSON, PGType: "jsonb", NotNull: true},
{Name: "unlock_requirements", Kind: KindJSON, PGType: "jsonb", NotNull: true},
{Name: "quiz", Kind: KindJSON, PGType: "jsonb", NotNull: true},
{Name: "pass_score", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "status", Kind: KindEnum, PGType: "course_status", NotNull: true, Enum: []string{"active", "inactive"}},
{Name: "created_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
{Name: "updated_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
{Name: "training_outline", Kind: KindTextArray, PGType: "text[]", NotNull: true},
},
},
{
Name: "LearningPath", Path: "learning-paths", Table: "learning_paths",
DefaultSort: "-created_date", DefaultLimit: 100,
Ops: OpList,
OrgNullable: true,
Columns: []Column{
{Name: "id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "legacy_id", Kind: KindString, PGType: "text", ReadOnly: true},
{Name: "org_id", Kind: KindUUID, PGType: "uuid", ReadOnly: true},
{Name: "name", Kind: KindString, PGType: "text", NotNull: true, Required: true},
{Name: "target_role", Kind: KindString, PGType: "text", NotNull: true},
{Name: "description", Kind: KindString, PGType: "text", NotNull: true},
{Name: "difficulty", Kind: KindString, PGType: "text", NotNull: true},
{Name: "steps", Kind: KindJSON, PGType: "jsonb", NotNull: true},
{Name: "created_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
{Name: "updated_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
},
},
{
Name: "RoleCategory", Path: "role-categories", Table: "role_categories",
DefaultSort: "-created_date", DefaultLimit: 100,
Ops: OpList | OpCreate,
Columns: []Column{
{Name: "id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "legacy_id", Kind: KindString, PGType: "text", ReadOnly: true},
{Name: "org_id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "name", Kind: KindString, PGType: "text", NotNull: true, Required: true},
{Name: "created_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
{Name: "updated_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
},
},
{
Name: "Certification", Path: "certifications", Table: "certifications",
DefaultSort: "-created_date", DefaultLimit: 200,
Ops: OpList | OpCreate | OpDelete,
Columns: []Column{
{Name: "id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "legacy_id", Kind: KindString, PGType: "text", ReadOnly: true},
{Name: "org_id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "name", Kind: KindString, PGType: "text", NotNull: true, Required: true},
{Name: "created_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
{Name: "updated_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
},
},
{
Name: "UserActivity", Path: "user-activity", Table: "user_activity",
DefaultSort: "-created_date", DefaultLimit: 500,
Ops: OpList | OpCreate,
Columns: []Column{
{Name: "id", Kind: KindInt, PGType: "bigint", NotNull: true, ReadOnly: true},
{Name: "legacy_id", Kind: KindString, PGType: "text", ReadOnly: true},
{Name: "org_id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "event_type", Kind: KindString, PGType: "text", NotNull: true, Required: true},
{Name: "user_id", Kind: KindUUID, PGType: "uuid", ReadOnly: true},
{Name: "user_email", Kind: KindString, PGType: "citext", NotNull: true, ReadOnly: true},
{Name: "user_name", Kind: KindString, PGType: "text", NotNull: true, ReadOnly: true},
{Name: "account_type", Kind: KindString, PGType: "text", NotNull: true, ReadOnly: true},
{Name: "details", Kind: KindString, PGType: "text", NotNull: true},
{Name: "position_id", Kind: KindUUID, PGType: "uuid"},
{Name: "application_id", Kind: KindUUID, PGType: "uuid"},
{Name: "candidate_id", Kind: KindUUID, PGType: "uuid"},
{Name: "interview_id", Kind: KindUUID, PGType: "uuid"},
{Name: "worker_email", Kind: KindString, PGType: "citext"},
{Name: "metadata", Kind: KindJSON, PGType: "jsonb"},
{Name: "created_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
},
},
{
Name: "Evidence", Path: "evidence", Table: "evidence",
DefaultSort: "-created_date", DefaultLimit: 200,
Ops: OpList | OpCreate | OpUpdate,
Columns: []Column{
{Name: "id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "legacy_id", Kind: KindString, PGType: "text", ReadOnly: true},
{Name: "org_id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "course_id", Kind: KindUUID, PGType: "uuid"},
{Name: "worker_profile_id", Kind: KindUUID, PGType: "uuid"},
{Name: "course_title", Kind: KindString, PGType: "text", NotNull: true},
{Name: "skill", Kind: KindString, PGType: "text", NotNull: true},
{Name: "worker_email", Kind: KindString, PGType: "citext", NotNull: true, Required: true},
{Name: "worker_name", Kind: KindString, PGType: "text", NotNull: true},
{Name: "type", Kind: KindEnum, PGType: "challenge_type", NotNull: true, Required: true, Enum: []string{"roleplay", "video", "photo_identify"}},
{Name: "media_url", Kind: KindString, PGType: "text", NotNull: true},
{Name: "transcript", Kind: KindString, PGType: "text", NotNull: true},
{Name: "ai_verdict", Kind: KindEnum, PGType: "evidence_verdict", NotNull: true, Enum: []string{"verified", "needs_work", "failed"}},
{Name: "ai_score", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "ai_rubric", Kind: KindJSON, PGType: "jsonb", NotNull: true},
{Name: "ai_feedback", Kind: KindString, PGType: "text", NotNull: true},
{Name: "supervisor_verified", Kind: KindBool, PGType: "boolean", NotNull: true},
{Name: "supervisor_name", Kind: KindString, PGType: "text", NotNull: true},
{Name: "verified_date", Kind: KindTimestamp, PGType: "timestamptz"},
{Name: "created_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
{Name: "updated_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
},
},
{
Name: "Assignment", Path: "assignments", Table: "assignments",
DefaultSort: "-created_date", DefaultLimit: 500,
Ops: OpList | OpCreate,
Columns: []Column{
{Name: "id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "legacy_id", Kind: KindString, PGType: "text", ReadOnly: true},
{Name: "org_id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "job_posting_id", Kind: KindUUID, PGType: "uuid", NotNull: true, Required: true},
{Name: "application_id", Kind: KindUUID, PGType: "uuid"},
{Name: "worker_profile_id", Kind: KindUUID, PGType: "uuid"},
{Name: "worker_email", Kind: KindString, PGType: "citext", NotNull: true, Required: true},
{Name: "worker_name", Kind: KindString, PGType: "text", NotNull: true},
{Name: "starts_at", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, Required: true},
{Name: "ends_at", Kind: KindTimestamp, PGType: "timestamptz"},
{Name: "status", Kind: KindEnum, PGType: "assignment_status", NotNull: true, Enum: []string{"active", "completed", "cancelled"}},
{Name: "source", Kind: KindString, PGType: "text", NotNull: true},
{Name: "match_score", Kind: KindInt, PGType: "int"},
{Name: "created_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
{Name: "updated_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
},
},
{
Name: "ShiftRecord", Path: "shift-records", Table: "shift_records",
DefaultSort: "-created_date", DefaultLimit: 500,
Ops: OpList,
Columns: []Column{
{Name: "id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "legacy_id", Kind: KindString, PGType: "text", ReadOnly: true},
{Name: "org_id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "staff_id", Kind: KindUUID, PGType: "uuid"},
{Name: "assignment_id", Kind: KindUUID, PGType: "uuid"},
{Name: "job_posting_id", Kind: KindUUID, PGType: "uuid"},
{Name: "worker_name", Kind: KindString, PGType: "text", NotNull: true},
{Name: "worker_email", Kind: KindString, PGType: "citext", NotNull: true},
{Name: "role", Kind: KindString, PGType: "text", NotNull: true},
{Name: "role_category", Kind: KindString, PGType: "text", NotNull: true},
{Name: "shift_date", Kind: KindDate, PGType: "date", NotNull: true},
{Name: "scheduled_start", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true},
{Name: "scheduled_end", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true},
{Name: "scheduled_hours", Kind: KindFloat, PGType: "numeric", NotNull: true},
{Name: "actual_start", Kind: KindTimestamp, PGType: "timestamptz"},
{Name: "actual_end", Kind: KindTimestamp, PGType: "timestamptz"},
{Name: "actual_hours", Kind: KindFloat, PGType: "numeric", NotNull: true},
{Name: "overtime_hours", Kind: KindFloat, PGType: "numeric", NotNull: true},
{Name: "minutes_late", Kind: KindInt, PGType: "int", NotNull: true},
{Name: "status", Kind: KindEnum, PGType: "shift_status", NotNull: true, Enum: []string{"present", "late", "absent", "no_show"}},
{Name: "notes", Kind: KindString, PGType: "text", NotNull: true},
{Name: "created_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
{Name: "updated_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
},
},
// Badge serves NO endpoint: useBadges has zero consumers and every
// badge the UI renders comes from worker_profiles.earned_badges. The
// descriptor exists so the seeder can write the table. api-contract.md §2.
{
Name: "Badge", Path: "badges", Table: "badges",
DefaultSort: "-created_date", DefaultLimit: 200,
Ops: 0,
Columns: []Column{
{Name: "id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "legacy_id", Kind: KindString, PGType: "text", ReadOnly: true},
{Name: "org_id", Kind: KindUUID, PGType: "uuid", NotNull: true, ReadOnly: true},
{Name: "name", Kind: KindString, PGType: "text", NotNull: true, Required: true},
{Name: "description", Kind: KindString, PGType: "text", NotNull: true},
{Name: "image_url", Kind: KindString, PGType: "text", NotNull: true},
{Name: "level", Kind: KindEnum, PGType: "badge_level", NotNull: true, Enum: []string{"bronze", "silver", "gold", "platinum"}},
{Name: "requirements", Kind: KindString, PGType: "text", NotNull: true},
{Name: "expiration_months", Kind: KindInt, PGType: "int"},
{Name: "verification_status", Kind: KindEnum, PGType: "badge_verification", NotNull: true, Enum: []string{"pending", "verified", "expired"}},
{Name: "created_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
{Name: "updated_date", Kind: KindTimestamp, PGType: "timestamptz", NotNull: true, ReadOnly: true},
},
},
}