@thejob/schema 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -30,17 +30,27 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
+ AnswerChoiceType: () => AnswerChoiceType,
34
+ ApplicationReceivePreference: () => ApplicationReceivePreference,
35
+ ChoiceQuestionSchema: () => ChoiceQuestionSchema,
36
+ Common: () => Common,
37
+ CompensationType: () => CompensationType,
33
38
  CompletenessScoreSchema: () => CompletenessScoreSchema,
34
39
  ContactTypes: () => ContactTypes,
35
40
  CoordinatorPageLinkSchema: () => CoordinatorPageLinkSchema,
41
+ DISPLAY_DATE_FORMAT: () => DISPLAY_DATE_FORMAT,
42
+ DISPLAY_DATE_FORMAT_SHORT: () => DISPLAY_DATE_FORMAT_SHORT,
36
43
  DateStringSchema: () => DateStringSchema,
37
44
  DbDefaultSchema: () => DbDefaultSchema,
38
45
  DefaultPaginatedResponse: () => DefaultPaginatedResponse,
39
46
  DefaultPaginationOptions: () => DefaultPaginationOptions,
40
47
  DefaultUserRoles: () => DefaultUserRoles,
41
48
  DurationSchema: () => DurationSchema,
49
+ EMPTY_STRING: () => EMPTY_STRING,
42
50
  EducationLevel: () => EducationLevel,
43
51
  EducationSchema: () => EducationSchema,
52
+ EmployeeCount: () => EmployeeCount,
53
+ EmploymentType: () => EmploymentType,
44
54
  ExperienceLevel: () => ExperienceLevel,
45
55
  GeneraDetailFields: () => GeneraDetailFields,
46
56
  GroupManagedBy: () => GroupManagedBy,
@@ -50,7 +60,10 @@ __export(index_exports, {
50
60
  GroupStatus: () => GroupStatus,
51
61
  GroupTranslationSchema: () => GroupTranslationSchema,
52
62
  GroupVisibility: () => GroupVisibility,
63
+ InputQuestionSchema: () => InputQuestionSchema,
64
+ JobSchema: () => JobSchema,
53
65
  JobSearchUrgency: () => JobSearchUrgency,
66
+ JobStatus: () => JobStatus,
54
67
  LocationSchema: () => LocationSchema,
55
68
  MIN_SALARY_LOWER_BOUND: () => MIN_SALARY_LOWER_BOUND,
56
69
  MIN_SALARY_UPPER_BOUND: () => MIN_SALARY_UPPER_BOUND,
@@ -59,27 +72,45 @@ __export(index_exports, {
59
72
  PageType: () => PageType,
60
73
  PaginationSchema: () => PaginationSchema,
61
74
  ProficiencyLevel: () => ProficiencyLevel,
75
+ QuestionSchema: () => QuestionSchema,
76
+ QuestionType: () => QuestionType,
77
+ ReadAndAcknowledgeQuestionSchema: () => ReadAndAcknowledgeQuestionSchema,
62
78
  RecruiterPageLinkSchema: () => RecruiterPageLinkSchema,
63
79
  ReferralSource: () => ReferralSource,
80
+ ReportReason: () => ReportReason,
81
+ ReportSchema: () => ReportSchema,
82
+ ResourceType: () => ResourceType,
83
+ SITEMAP_FORMAT: () => SITEMAP_FORMAT,
84
+ SYSTEM_DATE_FORMAT: () => SYSTEM_DATE_FORMAT,
64
85
  SkillSchema: () => SkillSchema,
65
86
  SocialAccount: () => SocialAccount,
66
87
  SocialAccountSchema: () => SocialAccountSchema,
67
88
  StudentCompletenessSchema: () => StudentCompletenessSchema,
68
89
  StudyType: () => StudyType,
90
+ SupportedAnswerChoiceTypes: () => SupportedAnswerChoiceTypes,
91
+ SupportedApplicationReceivePreferences: () => SupportedApplicationReceivePreferences,
92
+ SupportedCompensationTypes: () => SupportedCompensationTypes,
69
93
  SupportedContactTypes: () => SupportedContactTypes,
70
94
  SupportedEducationLevels: () => SupportedEducationLevels,
95
+ SupportedEmployeeCounts: () => SupportedEmployeeCounts,
96
+ SupportedEmploymentTypes: () => SupportedEmploymentTypes,
71
97
  SupportedExperienceLevels: () => SupportedExperienceLevels,
72
98
  SupportedJobSearchUrgencies: () => SupportedJobSearchUrgencies,
99
+ SupportedJobStatuses: () => SupportedJobStatuses,
73
100
  SupportedPageStatuses: () => SupportedPageStatuses,
74
101
  SupportedPageTypes: () => SupportedPageTypes,
75
102
  SupportedProficiencyLevels: () => SupportedProficiencyLevels,
103
+ SupportedQuestionTypes: () => SupportedQuestionTypes,
76
104
  SupportedReferralSources: () => SupportedReferralSources,
105
+ SupportedReportReasons: () => SupportedReportReasons,
106
+ SupportedResourceTypes: () => SupportedResourceTypes,
77
107
  SupportedSalaryCurrencies: () => SupportedSalaryCurrencies,
78
108
  SupportedSocialAccounts: () => SupportedSocialAccounts,
79
109
  SupportedStudyTypes: () => SupportedStudyTypes,
80
110
  SupportedUserProfileVisibilities: () => SupportedUserProfileVisibilities,
81
111
  SupportedUserRoles: () => SupportedUserRoles,
82
112
  SupportedUserStatuses: () => SupportedUserStatuses,
113
+ SupportedWorkModes: () => SupportedWorkModes,
83
114
  TermsAcceptedSchema: () => TermsAcceptedSchema,
84
115
  UserAdditionalInfoSchema: () => UserAdditionalInfoSchema,
85
116
  UserCertificationSchema: () => UserCertificationSchema,
@@ -87,6 +118,7 @@ __export(index_exports, {
87
118
  UserCoordinatorProfileSchema: () => UserCoordinatorProfileSchema,
88
119
  UserDetailType: () => UserDetailType,
89
120
  UserGeneralDetailSchema: () => UserGeneralDetailSchema,
121
+ UserIdAndCreatedAtSchema: () => UserIdAndCreatedAtSchema,
90
122
  UserInterestSchema: () => UserInterestSchema,
91
123
  UserJobPreferencesSchema: () => UserJobPreferencesSchema,
92
124
  UserLanguageSchema: () => UserLanguageSchema,
@@ -98,7 +130,9 @@ __export(index_exports, {
98
130
  UserSkillSchema: () => UserSkillSchema,
99
131
  UserStatus: () => UserStatus,
100
132
  WorkExperienceSchema: () => WorkExperienceSchema,
101
- dateString: () => dateString
133
+ WorkMode: () => WorkMode,
134
+ dateString: () => dateString,
135
+ getSchemaByQuestion: () => getSchemaByQuestion
102
136
  });
103
137
  module.exports = __toCommonJS(index_exports);
104
138
 
@@ -119,8 +153,34 @@ var CompletenessScoreSchema = (minScore = 50) => (0, import_yup.object)().shape(
119
153
  totalSteps: (0, import_yup.number)().min(0).default(0).label("Total Steps"),
120
154
  completedSteps: (0, import_yup.number)().min(0).default(0).label("Completed Steps")
121
155
  });
156
+ var UserIdAndCreatedAtSchema = (0, import_yup.object)().shape({
157
+ userId: (0, import_yup.string)().required().label("User Id"),
158
+ createdAt: (0, import_yup.string)().required().label("Created At")
159
+ });
122
160
 
123
161
  // src/common/common.constant.ts
162
+ var Common = /* @__PURE__ */ ((Common2) => {
163
+ Common2["Yes"] = "yes";
164
+ Common2["No"] = "no";
165
+ Common2["DateRangeOption"] = "date_range_option";
166
+ Common2["ExperienceLevel"] = "experience_level";
167
+ Common2["Company"] = "company";
168
+ Common2["EmploymentType"] = "employment_type";
169
+ Common2["WorkMode"] = "work_mode";
170
+ Common2["Location"] = "location";
171
+ Common2["CareerLevel"] = "career_level";
172
+ Common2["Category"] = "category";
173
+ Common2["Designation"] = "designation";
174
+ Common2["EducationLevel"] = "education_level";
175
+ Common2["Language"] = "language";
176
+ Common2["Skill"] = "skill";
177
+ return Common2;
178
+ })(Common || {});
179
+ var EMPTY_STRING = "eMpTyStRiNg";
180
+ var SYSTEM_DATE_FORMAT = "YYYY-MM-DD";
181
+ var DISPLAY_DATE_FORMAT = "LL";
182
+ var DISPLAY_DATE_FORMAT_SHORT = "MMMM, YYYY";
183
+ var SITEMAP_FORMAT = "YYYY-MM-DDThh:mm:ssZ";
124
184
  var StudyType = /* @__PURE__ */ ((StudyType2) => {
125
185
  StudyType2["FullTime"] = "full_time";
126
186
  StudyType2["PartTime"] = "part_time";
@@ -302,6 +362,9 @@ var GroupMembershipSchema = (0, import_yup4.object)({
302
362
  updatedAt: (0, import_yup4.number)().optional().label("Updated At")
303
363
  });
304
364
 
365
+ // src/job/job.schema.ts
366
+ var import_yup18 = require("yup");
367
+
305
368
  // src/location/location.schema.ts
306
369
  var import_yup5 = require("yup");
307
370
  var LocationSchema = (0, import_yup5.object)({
@@ -434,7 +497,7 @@ var SupportedSocialAccounts = Object.values(SocialAccount);
434
497
 
435
498
  // src/social-account/social-account.schema.ts
436
499
  var SocialAccountSchema = (0, import_yup11.object)().shape({
437
- // TODO: Remove isNew it's unused. Backend (user-social-accounts.service.ts) just strips it before saving.
500
+ // TODO: Remove isNew - it's unused. Backend (user-social-accounts.service.ts) just strips it before saving.
438
501
  isNew: (0, import_yup11.boolean)().default(false).optional().label("Is New"),
439
502
  type: (0, import_yup11.string)().oneOf(SupportedSocialAccounts).required().label("Account Type"),
440
503
  url: (0, import_yup11.string)().required().label("URL")
@@ -480,15 +543,302 @@ var PageSchema = (0, import_yup12.object)().shape({
480
543
  followersCount: (0, import_yup12.number)().min(0).optional().label("Followers Count")
481
544
  }).concat(CompanySchema).concat(InstituteSchema).concat(DbDefaultSchema).noUnknown(true).strict(true).required().label("Page Schema");
482
545
 
483
- // src/pagination/pagination.schema.ts
546
+ // src/skill/skill.schema.ts
484
547
  var import_yup13 = require("yup");
485
- var PaginationSchema = (0, import_yup13.object)().shape({
486
- page: (0, import_yup13.number)().required().min(1).label("Page").default(1),
487
- limit: (0, import_yup13.number)().required().min(1).max(100).label("Limit").default(10),
488
- sortBy: (0, import_yup13.string)().notOneOf([""]).optional().label("SortBy"),
489
- nextPage: (0, import_yup13.string)().optional().label("Next Page Token"),
490
- prevPage: (0, import_yup13.string)().optional().label("Previous Page Token"),
491
- sortDirection: (0, import_yup13.string)().oneOf(["asc", "desc"]).optional().label("Sort Direction")
548
+ var SkillSchema = (0, import_yup13.object)({
549
+ name: (0, import_yup13.string)().trim().required().label("Skill Name"),
550
+ logo: (0, import_yup13.object)({
551
+ light: (0, import_yup13.string)().required().label("Light Logo"),
552
+ dark: (0, import_yup13.string)().optional().nullable().label("Dark Logo")
553
+ }).optional().nullable().default(null).label("Logo"),
554
+ tags: (0, import_yup13.array)().of((0, import_yup13.string)().max(50)).max(20).optional().label("Tags")
555
+ }).concat(DbDefaultSchema).noUnknown().strict().label("Skill");
556
+
557
+ // src/question/question.constant.ts
558
+ var QuestionType = /* @__PURE__ */ ((QuestionType2) => {
559
+ QuestionType2["Input"] = "input";
560
+ QuestionType2["Choice"] = "choice";
561
+ QuestionType2["ReadAndAcknowledge"] = "readAndAcknowledge";
562
+ return QuestionType2;
563
+ })(QuestionType || {});
564
+ var SupportedQuestionTypes = Object.values(QuestionType);
565
+ var AnswerChoiceType = /* @__PURE__ */ ((AnswerChoiceType2) => {
566
+ AnswerChoiceType2["Single"] = "single";
567
+ AnswerChoiceType2["Multiple"] = "multiple";
568
+ return AnswerChoiceType2;
569
+ })(AnswerChoiceType || {});
570
+ var SupportedAnswerChoiceTypes = Object.values(AnswerChoiceType);
571
+
572
+ // src/question/question.schema.ts
573
+ var import_yup14 = require("yup");
574
+ var QuestionSchema = (0, import_yup14.object)().shape({
575
+ label: (0, import_yup14.string)().max(50).optional().label("Label"),
576
+ default: (0, import_yup14.boolean)().optional().default(false).label("Default"),
577
+ title: (0, import_yup14.string)().required().max(200).label("Title"),
578
+ type: (0, import_yup14.string)().oneOf(SupportedQuestionTypes).required().label("Type"),
579
+ isOptional: (0, import_yup14.boolean)().optional().label("Mark if the question is optional"),
580
+ readonly: (0, import_yup14.boolean)().optional().label("Readonly"),
581
+ isNew: (0, import_yup14.boolean)().optional().label("Is New")
582
+ });
583
+
584
+ // src/question/input-question.schema.ts
585
+ var import_yup15 = require("yup");
586
+ var InputQuestionSchema = QuestionSchema.concat(
587
+ (0, import_yup15.object)().shape({
588
+ type: (0, import_yup15.string)().oneOf(["input" /* Input */]).required().label("Question type"),
589
+ preferredAnswer: (0, import_yup15.string)().max(100).optional().label("Preferred Answer"),
590
+ answers: (0, import_yup15.string)().max(500).when("isOptional", {
591
+ is: (isOptional) => Boolean(isOptional),
592
+ then: (schema) => schema.optional(),
593
+ otherwise: (schema) => schema.required()
594
+ }).label("Answer")
595
+ })
596
+ );
597
+
598
+ // src/question/choice-question.schema.ts
599
+ var import_yup16 = require("yup");
600
+ var ChoicePreferredAnswerSchema = (label = "Preferred answer") => (0, import_yup16.mixed)().when("answerChoiceType", {
601
+ is: (value) => value === "multiple" /* Multiple */,
602
+ then: () => (0, import_yup16.array)((0, import_yup16.string)()).test(
603
+ "is-valid-option",
604
+ `${label} must be from the provided options`,
605
+ function(answer) {
606
+ const { options = [] } = this.parent;
607
+ if (answer && answer.length > 0) {
608
+ return answer.every((a) => options.includes(a));
609
+ }
610
+ return true;
611
+ }
612
+ ).optional().label(label),
613
+ otherwise: () => (0, import_yup16.string)().test(
614
+ "is-valid-option",
615
+ `${label} must be from the provided options`,
616
+ function(answer) {
617
+ const { options = [] } = this.parent;
618
+ return !answer || options.includes(answer);
619
+ }
620
+ ).optional().label(label)
621
+ });
622
+ var getChoiceAnswerSchema = (answerChoiceType, isOptional) => {
623
+ if (answerChoiceType === "multiple" /* Multiple */) {
624
+ const multiAnswerSchema = (0, import_yup16.array)((0, import_yup16.string)().max(500));
625
+ return isOptional ? multiAnswerSchema.optional().default([]) : multiAnswerSchema.min(1, "Select at least one option.").required("Select at least one option.").default([]);
626
+ }
627
+ const singleAnswerSchema = (0, import_yup16.string)().max(500);
628
+ return isOptional ? singleAnswerSchema.optional() : singleAnswerSchema.required("Select an option.");
629
+ };
630
+ var ChoiceQuestionSchema = QuestionSchema.concat(
631
+ (0, import_yup16.object)().shape({
632
+ type: (0, import_yup16.string)().oneOf(["choice" /* Choice */]).required().label("Question type"),
633
+ optionsFrom: (0, import_yup16.string)().oneOf(["skill" /* Skill */, "education_level" /* EducationLevel */, "experience_level" /* ExperienceLevel */]).optional().label("Option field"),
634
+ options: (0, import_yup16.array)((0, import_yup16.string)().required()).min(1).required().label("Options"),
635
+ answerChoiceType: (0, import_yup16.string)().oneOf(SupportedAnswerChoiceTypes).required().default("single" /* Single */).label("Type"),
636
+ preferredAnswer: ChoicePreferredAnswerSchema("Preferred answer"),
637
+ answers: (0, import_yup16.mixed)().when(
638
+ ["answerChoiceType", "isOptional"],
639
+ ([answerChoiceType, isOptional]) => getChoiceAnswerSchema(answerChoiceType, isOptional)
640
+ )
641
+ })
642
+ );
643
+
644
+ // src/question/read-and-acknowledge.schema.ts
645
+ var import_yup17 = require("yup");
646
+ var AcknowledgeAnswerSchema = (0, import_yup17.string)().oneOf(["yes" /* Yes */, "no" /* No */]).required("This question must be acknowledged.");
647
+ var ReadAndAcknowledgeQuestionSchema = QuestionSchema.concat(
648
+ (0, import_yup17.object)().shape({
649
+ type: (0, import_yup17.string)().oneOf(["readAndAcknowledge" /* ReadAndAcknowledge */]).required().label("Question type"),
650
+ description: (0, import_yup17.string)().max(1e4).required().label("Content"),
651
+ preferredAnswer: AcknowledgeAnswerSchema.label("Preferred Answer"),
652
+ answers: AcknowledgeAnswerSchema.label("Answer")
653
+ })
654
+ );
655
+
656
+ // src/question/question.utils.ts
657
+ var getSchemaByQuestion = (type) => {
658
+ switch (type) {
659
+ case "input" /* Input */:
660
+ return InputQuestionSchema;
661
+ case "choice" /* Choice */:
662
+ return ChoiceQuestionSchema;
663
+ case "readAndAcknowledge" /* ReadAndAcknowledge */:
664
+ return ReadAndAcknowledgeQuestionSchema;
665
+ default:
666
+ throw new Error("Unsupported schema: " + type);
667
+ }
668
+ };
669
+
670
+ // src/job/job.constant.ts
671
+ var JobStatus = /* @__PURE__ */ ((JobStatus2) => {
672
+ JobStatus2["Published"] = "published";
673
+ JobStatus2["Draft"] = "draft";
674
+ JobStatus2["Deleted"] = "deleted";
675
+ JobStatus2["Closed"] = "closed";
676
+ JobStatus2["Expired"] = "expired";
677
+ return JobStatus2;
678
+ })(JobStatus || {});
679
+ var SupportedJobStatuses = Object.values(JobStatus);
680
+ var EmploymentType = /* @__PURE__ */ ((EmploymentType2) => {
681
+ EmploymentType2["Fulltime"] = "full_time";
682
+ EmploymentType2["PartTime"] = "part_time";
683
+ EmploymentType2["Temporary"] = "temporary";
684
+ EmploymentType2["Contract"] = "contract";
685
+ EmploymentType2["Internship"] = "internship";
686
+ EmploymentType2["Freelance"] = "freelance";
687
+ EmploymentType2["Volunteer"] = "volunteer";
688
+ EmploymentType2["PerDiem"] = "per_diem";
689
+ return EmploymentType2;
690
+ })(EmploymentType || {});
691
+ var SupportedEmploymentTypes = Object.values(EmploymentType);
692
+ var WorkMode = /* @__PURE__ */ ((WorkMode2) => {
693
+ WorkMode2["OnSite"] = "on_site";
694
+ WorkMode2["Hybrid"] = "hybrid";
695
+ WorkMode2["Remote"] = "remote";
696
+ return WorkMode2;
697
+ })(WorkMode || {});
698
+ var SupportedWorkModes = Object.values(WorkMode);
699
+ var CompensationType = /* @__PURE__ */ ((CompensationType2) => {
700
+ CompensationType2["Hourly"] = "hourly";
701
+ CompensationType2["Weekly"] = "weekly";
702
+ CompensationType2["Monthly"] = "monthly";
703
+ CompensationType2["Yearly"] = "yearly";
704
+ CompensationType2["OneTime"] = "one-time";
705
+ CompensationType2["Other"] = "other";
706
+ return CompensationType2;
707
+ })(CompensationType || {});
708
+ var SupportedCompensationTypes = Object.values(CompensationType);
709
+ var EmployeeCount = /* @__PURE__ */ ((EmployeeCount2) => {
710
+ EmployeeCount2["_1_2"] = "1_2_employees";
711
+ EmployeeCount2["_3_10"] = "3_10_employees";
712
+ EmployeeCount2["_11_100"] = "11_100_employees";
713
+ EmployeeCount2["_101_1000"] = "101_1000_employees";
714
+ EmployeeCount2["_1001_5000"] = "1001_5000_employees";
715
+ EmployeeCount2["_5001_10000"] = "5001_10000_employees";
716
+ EmployeeCount2["_10001_Plus"] = "10001_plus_employees";
717
+ return EmployeeCount2;
718
+ })(EmployeeCount || {});
719
+ var SupportedEmployeeCounts = Object.values(EmployeeCount);
720
+ var ApplicationReceivePreference = /* @__PURE__ */ ((ApplicationReceivePreference2) => {
721
+ ApplicationReceivePreference2["Inbox"] = "inbox";
722
+ ApplicationReceivePreference2["Email"] = "email";
723
+ ApplicationReceivePreference2["ExternalWebsite"] = "external_website";
724
+ return ApplicationReceivePreference2;
725
+ })(ApplicationReceivePreference || {});
726
+ var SupportedApplicationReceivePreferences = Object.values(
727
+ ApplicationReceivePreference
728
+ );
729
+
730
+ // src/job/job.schema.ts
731
+ var JobSchema = (0, import_yup18.object)({
732
+ /** Unique id usable by external systems to reference the job. */
733
+ uniqueId: (0, import_yup18.string)().optional().label("Unique ID"),
734
+ /** Job title shown in listings and search. */
735
+ headline: (0, import_yup18.string)().required().min(5).max(150).label("Headline"),
736
+ /** User-friendly, unique URL identifier. */
737
+ slug: (0, import_yup18.string)().required().max(250).label("Slug"),
738
+ /** How applications are received (inbox vs external website). */
739
+ applicationReceivePreference: (0, import_yup18.mixed)().oneOf([
740
+ "inbox" /* Inbox */,
741
+ "external_website" /* ExternalWebsite */
742
+ ]).required().label("Preference"),
743
+ /** Required when applicationReceivePreference is ExternalWebsite. */
744
+ externalApplyLink: (0, import_yup18.string)().when("applicationReceivePreference", {
745
+ is: (value) => value === "external_website" /* ExternalWebsite */,
746
+ then: (schema) => schema.url().required().label("Apply for Job link"),
747
+ otherwise: (schema) => schema.optional()
748
+ }),
749
+ /** Company the job belongs to (subset of PageSchema). */
750
+ company: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company"),
751
+ /** @deprecated kept for backwards compatibility. */
752
+ designation: (0, import_yup18.string)().optional().nullable().label("Designation"),
753
+ employmentType: (0, import_yup18.string)().required().label("Employment type"),
754
+ workMode: (0, import_yup18.string)().required().label("Work mode"),
755
+ skills: (0, import_yup18.array)().of(SkillSchema.pick(["name", "logo"]).required().label("Skill")).nullable().optional().label("Skills"),
756
+ bookmarks: (0, import_yup18.array)().of(UserIdAndCreatedAtSchema).optional().label("Bookmarks"),
757
+ embedding: (0, import_yup18.object)({
758
+ vector: (0, import_yup18.array)((0, import_yup18.number)().required()).optional().label("Embedding vector"),
759
+ model: (0, import_yup18.string)().optional().label("Embedding model")
760
+ }).nullable().optional().label("Embedding"),
761
+ applicants: (0, import_yup18.array)().of(UserIdAndCreatedAtSchema).optional().label("Applicants"),
762
+ applicantCount: (0, import_yup18.number)().optional().label("Applicant count"),
763
+ externalApplicationLinkClickCount: (0, import_yup18.number)().optional().label("External application link click count"),
764
+ description: (0, import_yup18.string)().required().min(100).max(5e4).label("Description"),
765
+ descriptionMarkdown: (0, import_yup18.string)().required().label("Description Markdown"),
766
+ descriptionHTML: (0, import_yup18.string)().optional().label("Description HTML"),
767
+ /**
768
+ * Job locations. Required even for remote roles (compliance/legal). Defaults
769
+ * to an empty array; min(1) is intentionally not enforced yet.
770
+ */
771
+ locations: (0, import_yup18.array)().of(LocationSchema).default([]).label("Location"),
772
+ educationLevel: (0, import_yup18.array)((0, import_yup18.string)().oneOf(SupportedEducationLevels)).required().min(1).label("Educational level"),
773
+ /** Posting validity window (start/expiry). */
774
+ validity: DurationSchema({
775
+ format: SYSTEM_DATE_FORMAT,
776
+ startLabel: "Start Date",
777
+ endLabel: "Expiry Date"
778
+ }).label("Validity"),
779
+ experienceLevel: (0, import_yup18.string)().oneOf(SupportedExperienceLevels).nullable().optional().label("Experience level"),
780
+ contactEmail: (0, import_yup18.string)().email().nullable().optional().label("Contact email"),
781
+ workingHoursPerWeek: (0, import_yup18.number)().nullable().optional().min(1).max(24 * 7).label("Working hours per week"),
782
+ tags: (0, import_yup18.array)().max(50).optional().label("Tags"),
783
+ /** Direct/Quick-apply questionnaire. Each item is validated against the
784
+ * concrete question schema for its `type`, with the stored `answers` omitted. */
785
+ questionnaire: (0, import_yup18.array)().of(
786
+ (0, import_yup18.lazy)((question) => {
787
+ const schema = getSchemaByQuestion(question.type);
788
+ if (question.type === "input" /* Input */) {
789
+ return schema.omit([
790
+ "answers"
791
+ ]);
792
+ } else if (question.type === "choice" /* Choice */) {
793
+ return schema.omit([
794
+ "answers"
795
+ ]);
796
+ } else if (question.type === "readAndAcknowledge" /* ReadAndAcknowledge */) {
797
+ return schema.omit(["answers"]);
798
+ }
799
+ return schema;
800
+ })
801
+ ).label("Questionnaire"),
802
+ status: (0, import_yup18.string)().oneOf(SupportedJobStatuses).default("draft" /* Draft */).required().label("Status"),
803
+ seoTags: (0, import_yup18.object)({
804
+ description: (0, import_yup18.string)().optional().label("Description"),
805
+ keywords: (0, import_yup18.array)().of((0, import_yup18.string)()).optional().label("Keywords")
806
+ }).nullable().optional().label("SEO Tags"),
807
+ jdSummary: (0, import_yup18.string)().optional().label("JD Summary"),
808
+ canCreateAlert: (0, import_yup18.boolean)().optional().label("Can create alert"),
809
+ canDirectApply: (0, import_yup18.boolean)().optional().label("Can direct apply"),
810
+ hasApplied: (0, import_yup18.boolean)().optional().label("Has applied"),
811
+ isOwner: (0, import_yup18.boolean)().optional().label("Is owner"),
812
+ hasBookmarked: (0, import_yup18.boolean)().optional().label("Has bookmarked"),
813
+ hasReported: (0, import_yup18.boolean)().optional().label("Has reported"),
814
+ ratePerHour: (0, import_yup18.number)().optional().min(0).label("Rate per hour"),
815
+ isPromoted: (0, import_yup18.boolean)().optional().label("Is promoted"),
816
+ salaryRange: (0, import_yup18.object)({
817
+ currency: (0, import_yup18.string)().required().label("Currency").default("USD"),
818
+ min: (0, import_yup18.number)().nullable().optional().min(0).label("Minimum Salary"),
819
+ max: (0, import_yup18.number)().nullable().optional().min(0).label("Maximum Salary"),
820
+ compensationType: (0, import_yup18.string)().oneOf(SupportedCompensationTypes).nullable().optional().label("Compensation Type"),
821
+ isNegotiable: (0, import_yup18.boolean)().nullable().optional().default(true).label("Is Negotiable")
822
+ }).nullable().optional().label("Salary Range"),
823
+ reports: (0, import_yup18.array)().of(UserIdAndCreatedAtSchema).optional().label("Reports"),
824
+ category: (0, import_yup18.string)().nullable().optional().label("Category"),
825
+ industry: (0, import_yup18.string)().nullable().optional().label("Industry"),
826
+ subCategories: (0, import_yup18.array)().of((0, import_yup18.string)().trim().required()).nullable().optional().label("Sub Categories"),
827
+ termsAccepted: (0, import_yup18.boolean)().oneOf([true], "Accept terms before proceeding").required("Accept terms before proceeding").label("Terms accepted"),
828
+ isFeatured: (0, import_yup18.boolean)().optional().default(false).label("Is featured"),
829
+ /** Market country codes to feature this job in; empty = global. */
830
+ featuredMarkets: (0, import_yup18.array)().of((0, import_yup18.string)().required()).optional().default([]).label("Featured markets")
831
+ }).concat(DbDefaultSchema).noUnknown().label("Job");
832
+
833
+ // src/pagination/pagination.schema.ts
834
+ var import_yup19 = require("yup");
835
+ var PaginationSchema = (0, import_yup19.object)().shape({
836
+ page: (0, import_yup19.number)().required().min(1).label("Page").default(1),
837
+ limit: (0, import_yup19.number)().required().min(1).max(100).label("Limit").default(10),
838
+ sortBy: (0, import_yup19.string)().notOneOf([""]).optional().label("SortBy"),
839
+ nextPage: (0, import_yup19.string)().optional().label("Next Page Token"),
840
+ prevPage: (0, import_yup19.string)().optional().label("Previous Page Token"),
841
+ sortDirection: (0, import_yup19.string)().oneOf(["asc", "desc"]).optional().label("Sort Direction")
492
842
  });
493
843
 
494
844
  // src/pagination/pagination.constant.ts
@@ -503,19 +853,40 @@ var DefaultPaginationOptions = {
503
853
  limit: 10
504
854
  };
505
855
 
506
- // src/skill/skill.schema.ts
507
- var import_yup14 = require("yup");
508
- var SkillSchema = (0, import_yup14.object)({
509
- name: (0, import_yup14.string)().trim().required().label("Skill Name"),
510
- logo: (0, import_yup14.object)({
511
- light: (0, import_yup14.string)().required().label("Light Logo"),
512
- dark: (0, import_yup14.string)().optional().nullable().label("Dark Logo")
513
- }).optional().nullable().default(null).label("Logo"),
514
- tags: (0, import_yup14.array)().of((0, import_yup14.string)().max(50)).max(20).optional().label("Tags")
515
- }).concat(DbDefaultSchema).noUnknown().strict().label("Skill");
856
+ // src/report/report.schema.ts
857
+ var import_yup20 = require("yup");
858
+
859
+ // src/report/report.constant.ts
860
+ var ResourceType = /* @__PURE__ */ ((ResourceType3) => {
861
+ ResourceType3["Job"] = "job";
862
+ ResourceType3["User"] = "user";
863
+ ResourceType3["Resume"] = "resume";
864
+ ResourceType3["Company"] = "company";
865
+ return ResourceType3;
866
+ })(ResourceType || {});
867
+ var SupportedResourceTypes = Object.values(ResourceType);
868
+ var ReportReason = /* @__PURE__ */ ((ReportReason3) => {
869
+ ReportReason3["OffensiveOrHarassing"] = "offensive_or_harassing";
870
+ ReportReason3["JobExpired"] = "job_expired";
871
+ ReportReason3["AskingMoney"] = "asking_money";
872
+ ReportReason3["FakeJob"] = "fake_job";
873
+ ReportReason3["IncorrectJobDetails"] = "incorrect_job_details";
874
+ ReportReason3["SellingSomething"] = "selling_something";
875
+ ReportReason3["Other"] = "other";
876
+ return ReportReason3;
877
+ })(ReportReason || {});
878
+ var SupportedReportReasons = Object.values(ReportReason);
879
+
880
+ // src/report/report.schema.ts
881
+ var ReportSchema = (0, import_yup20.object)({
882
+ type: (0, import_yup20.mixed)().oneOf(SupportedResourceTypes).required().label("Type"),
883
+ resourceId: (0, import_yup20.string)().required().label("Resource ID"),
884
+ reason: (0, import_yup20.mixed)().oneOf(SupportedReportReasons).required("Please choose a reason").label("Reason"),
885
+ comment: (0, import_yup20.string)().max(1e3).optional().label("Comment")
886
+ }).label("Report Schema");
516
887
 
517
888
  // src/user/user.schema.ts
518
- var import_yup27 = require("yup");
889
+ var import_yup33 = require("yup");
519
890
 
520
891
  // src/user/user.constant.ts
521
892
  var UserRole = /* @__PURE__ */ ((UserRole2) => {
@@ -597,51 +968,51 @@ var MIN_SALARY_LOWER_BOUND = 0;
597
968
  var MIN_SALARY_UPPER_BOUND = 1e6;
598
969
 
599
970
  // src/user/work-experience.schema.ts
600
- var import_yup15 = require("yup");
601
- var WorkExperienceSchema = (0, import_yup15.object)().shape({
971
+ var import_yup21 = require("yup");
972
+ var WorkExperienceSchema = (0, import_yup21.object)().shape({
602
973
  company: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company"),
603
- designation: (0, import_yup15.string)().trim().required().label("Designation"),
974
+ designation: (0, import_yup21.string)().trim().required().label("Designation"),
604
975
  duration: DurationSchema({
605
976
  format: "YYYY-MM",
606
977
  startLabel: "Start Date",
607
978
  endLabel: "End Date"
608
979
  }).required().label("Duration"),
609
- description: (0, import_yup15.string)().trim().max(3e3).optional().label("Description"),
980
+ description: (0, import_yup21.string)().trim().max(3e3).optional().label("Description"),
610
981
  location: LocationSchema.required().label("Location"),
611
- isRemote: (0, import_yup15.boolean)().oneOf([true, false]).default(false).label("Is Remote")
982
+ isRemote: (0, import_yup21.boolean)().oneOf([true, false]).default(false).label("Is Remote")
612
983
  }).noUnknown().strict().label("Work Experience");
613
984
 
614
985
  // src/user/education.schema.ts
615
- var import_yup16 = require("yup");
616
- var EducationSchema = (0, import_yup16.object)({
986
+ var import_yup22 = require("yup");
987
+ var EducationSchema = (0, import_yup22.object)({
617
988
  institute: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Institute"),
618
- course: (0, import_yup16.string)().trim().required().label("Course"),
619
- fieldOfStudy: (0, import_yup16.string)().trim().required().label("Field of Study"),
989
+ course: (0, import_yup22.string)().trim().required().label("Course"),
990
+ fieldOfStudy: (0, import_yup22.string)().trim().required().label("Field of Study"),
620
991
  duration: DurationSchema({
621
992
  format: "YYYY-MM",
622
993
  startLabel: "Start Date",
623
994
  endLabel: "End Date"
624
995
  }).required().label("Duration"),
625
- description: (0, import_yup16.string)().trim().max(3e3).optional().label("Description"),
626
- isDistanceLearning: (0, import_yup16.boolean)().default(false).label("Is Distance Learning"),
996
+ description: (0, import_yup22.string)().trim().max(3e3).optional().label("Description"),
997
+ isDistanceLearning: (0, import_yup22.boolean)().default(false).label("Is Distance Learning"),
627
998
  location: LocationSchema.required().label("Location"),
628
- studyType: (0, import_yup16.string)().oneOf(SupportedStudyTypes).trim().max(50).required().label("Study Type")
999
+ studyType: (0, import_yup22.string)().oneOf(SupportedStudyTypes).trim().max(50).required().label("Study Type")
629
1000
  }).noUnknown().strict().label("Education");
630
1001
 
631
1002
  // src/user/user-skill.schema.ts
632
- var import_yup17 = require("yup");
633
- var UserSkillSchema = (0, import_yup17.object)({
634
- name: (0, import_yup17.string)().required().label("Name"),
635
- proficiencyLevel: (0, import_yup17.string)().oneOf(SupportedProficiencyLevels).required().label("Proficiency Level"),
1003
+ var import_yup23 = require("yup");
1004
+ var UserSkillSchema = (0, import_yup23.object)({
1005
+ name: (0, import_yup23.string)().required().label("Name"),
1006
+ proficiencyLevel: (0, import_yup23.string)().oneOf(SupportedProficiencyLevels).required().label("Proficiency Level"),
636
1007
  lastUsed: dateString().format("YYYY-MM").nullable().optional().label("Last Used")
637
1008
  }).noUnknown().strict().label("Skill");
638
1009
 
639
1010
  // src/user/project.schema.ts
640
- var import_yup18 = require("yup");
641
- var UserProjectSchema = (0, import_yup18.object)({
642
- name: (0, import_yup18.string)().trim().max(50).required().label("Name"),
643
- url: (0, import_yup18.string)().optional().label("URL"),
644
- description: (0, import_yup18.string)().trim().min(100).max(3e3).required().label("Description"),
1011
+ var import_yup24 = require("yup");
1012
+ var UserProjectSchema = (0, import_yup24.object)({
1013
+ name: (0, import_yup24.string)().trim().max(50).required().label("Name"),
1014
+ url: (0, import_yup24.string)().optional().label("URL"),
1015
+ description: (0, import_yup24.string)().trim().min(100).max(3e3).required().label("Description"),
645
1016
  duration: DurationSchema({
646
1017
  format: "YYYY-MM",
647
1018
  startLabel: "Start Date",
@@ -650,118 +1021,118 @@ var UserProjectSchema = (0, import_yup18.object)({
650
1021
  }).noUnknown().strict().label("Project");
651
1022
 
652
1023
  // src/user/user-certification.schema.ts
653
- var import_yup19 = require("yup");
654
- var UserCertificationSchema = (0, import_yup19.object)({
655
- name: (0, import_yup19.string)().trim().max(100).required().label("Name"),
1024
+ var import_yup25 = require("yup");
1025
+ var UserCertificationSchema = (0, import_yup25.object)({
1026
+ name: (0, import_yup25.string)().trim().max(100).required().label("Name"),
656
1027
  // TODO: Add validation for authority
657
- authority: (0, import_yup19.string)().trim().max(100).required().label("Authority"),
658
- licenseNumber: (0, import_yup19.string)().trim().max(50).optional().label("License Number"),
1028
+ authority: (0, import_yup25.string)().trim().max(100).required().label("Authority"),
1029
+ licenseNumber: (0, import_yup25.string)().trim().max(50).optional().label("License Number"),
659
1030
  duration: DurationSchema({
660
1031
  format: "YYYY-MM",
661
1032
  startLabel: "Start Date",
662
1033
  endLabel: "End Date"
663
1034
  }).optional().nullable().label("Duration"),
664
- url: (0, import_yup19.string)().optional().label("URL")
1035
+ url: (0, import_yup25.string)().optional().label("URL")
665
1036
  }).noUnknown().strict().label("Certification");
666
1037
 
667
1038
  // src/user/user-interest.schema.ts
668
- var import_yup20 = require("yup");
669
- var UserInterestSchema = (0, import_yup20.string)().trim().required().label("Interest");
1039
+ var import_yup26 = require("yup");
1040
+ var UserInterestSchema = (0, import_yup26.string)().trim().required().label("Interest");
670
1041
 
671
1042
  // src/user/user-language.schema.ts
672
- var import_yup21 = require("yup");
673
- var UserLanguageSchema = (0, import_yup21.object)({
674
- name: (0, import_yup21.string)().trim().required().label("Name"),
675
- proficiencyLevel: (0, import_yup21.string)().oneOf(SupportedProficiencyLevels).trim().max(50).required().label("Proficiency Level")
1043
+ var import_yup27 = require("yup");
1044
+ var UserLanguageSchema = (0, import_yup27.object)({
1045
+ name: (0, import_yup27.string)().trim().required().label("Name"),
1046
+ proficiencyLevel: (0, import_yup27.string)().oneOf(SupportedProficiencyLevels).trim().max(50).required().label("Proficiency Level")
676
1047
  }).noUnknown().strict().label("Language");
677
1048
 
678
1049
  // src/user/user-additional-info.schema.ts
679
- var import_yup22 = require("yup");
680
- var UserAdditionalInfoSchema = (0, import_yup22.object)({
681
- title: (0, import_yup22.string)().trim().max(60).required().label("Title"),
682
- description: (0, import_yup22.string)().trim().max(1e3).required().label("Description")
1050
+ var import_yup28 = require("yup");
1051
+ var UserAdditionalInfoSchema = (0, import_yup28.object)({
1052
+ title: (0, import_yup28.string)().trim().max(60).required().label("Title"),
1053
+ description: (0, import_yup28.string)().trim().max(1e3).required().label("Description")
683
1054
  }).noUnknown().strict().label("User Additional Info");
684
1055
 
685
1056
  // src/user/general-detail.schema.ts
686
- var import_yup23 = require("yup");
687
- var UserGeneralDetailSchema = (0, import_yup23.object)({
688
- id: (0, import_yup23.string)().optional().label("ID"),
689
- name: (0, import_yup23.object)().shape({
690
- first: (0, import_yup23.string)().trim().max(50).required().label("First Name"),
691
- last: (0, import_yup23.string)().trim().max(50).optional().label("Last Name")
1057
+ var import_yup29 = require("yup");
1058
+ var UserGeneralDetailSchema = (0, import_yup29.object)({
1059
+ id: (0, import_yup29.string)().optional().label("ID"),
1060
+ name: (0, import_yup29.object)().shape({
1061
+ first: (0, import_yup29.string)().trim().max(50).required().label("First Name"),
1062
+ last: (0, import_yup29.string)().trim().max(50).optional().label("Last Name")
692
1063
  }).required().label("Name"),
693
- headline: (0, import_yup23.string)().trim().max(200).optional().label("Headline"),
694
- image: (0, import_yup23.string)().optional().label("Image"),
695
- aboutMe: (0, import_yup23.string)().trim().max(3e3).optional().label("About Me"),
696
- email: (0, import_yup23.string)().required().label("Email"),
697
- mobile: (0, import_yup23.string)().nullable().optional().label("Mobile"),
698
- emailVerified: (0, import_yup23.string)().nullable().optional().label("Email Verified"),
699
- mobileVerified: (0, import_yup23.string)().nullable().optional().label("Mobile Verified"),
700
- experienceLevel: (0, import_yup23.string)().oneOf(SupportedExperienceLevels).required().label("Experience level"),
1064
+ headline: (0, import_yup29.string)().trim().max(200).optional().label("Headline"),
1065
+ image: (0, import_yup29.string)().optional().label("Image"),
1066
+ aboutMe: (0, import_yup29.string)().trim().max(3e3).optional().label("About Me"),
1067
+ email: (0, import_yup29.string)().required().label("Email"),
1068
+ mobile: (0, import_yup29.string)().nullable().optional().label("Mobile"),
1069
+ emailVerified: (0, import_yup29.string)().nullable().optional().label("Email Verified"),
1070
+ mobileVerified: (0, import_yup29.string)().nullable().optional().label("Mobile Verified"),
1071
+ experienceLevel: (0, import_yup29.string)().oneOf(SupportedExperienceLevels).required().label("Experience level"),
701
1072
  location: LocationSchema.required().label("Location"),
702
- region: (0, import_yup23.object)().shape({
703
- country: (0, import_yup23.string)().trim().required().label("Region Country"),
704
- lang: (0, import_yup23.string)().trim().required().label("Region Language")
1073
+ region: (0, import_yup29.object)().shape({
1074
+ country: (0, import_yup29.string)().trim().required().label("Region Country"),
1075
+ lang: (0, import_yup29.string)().trim().required().label("Region Language")
705
1076
  }).optional().default(void 0).label("Region"),
706
- profileVisibility: (0, import_yup23.string)().oneOf(SupportedUserProfileVisibilities).default("public" /* Public */).label("Profile Visibility")
1077
+ profileVisibility: (0, import_yup29.string)().oneOf(SupportedUserProfileVisibilities).default("public" /* Public */).label("Profile Visibility")
707
1078
  }).noUnknown().strict().label("General Detail");
708
1079
 
709
1080
  // src/user/user-job-preferences.schema.ts
710
- var import_yup24 = require("yup");
711
- var UserJobPreferencesSchema = (0, import_yup24.object)({
1081
+ var import_yup30 = require("yup");
1082
+ var UserJobPreferencesSchema = (0, import_yup30.object)({
712
1083
  /**
713
1084
  * Whether the job seeker is openly signalling availability. Surfaces the
714
1085
  * "Open to work" badge on the public profile and boosts visibility in
715
- * recruiter search. Defaults to `false` users must opt in.
1086
+ * recruiter search. Defaults to `false` - users must opt in.
716
1087
  */
717
- openToWork: (0, import_yup24.boolean)().default(false).label("Open to Work"),
1088
+ openToWork: (0, import_yup30.boolean)().default(false).label("Open to Work"),
718
1089
  /**
719
1090
  * How urgently the user is looking for their next job. Drives match scoring
720
1091
  * and can downgrade the visibility of expired or low-relevance postings for
721
1092
  * users in `passively_browsing` mode.
722
1093
  */
723
- jobSearchUrgency: (0, import_yup24.string)().oneOf(SupportedJobSearchUrgencies).required().label("Job Search Urgency"),
1094
+ jobSearchUrgency: (0, import_yup30.string)().oneOf(SupportedJobSearchUrgencies).required().label("Job Search Urgency"),
724
1095
  /**
725
1096
  * Locations the user wants to work in. Stores the full `LocationSchema`
726
1097
  * shape (country, city, state, geo, etc.) as returned by the locations
727
1098
  * autocomplete API.
728
1099
  */
729
- jobLocations: (0, import_yup24.array)().of(LocationSchema.required().label("Job Location")).min(1, "Pick at least one preferred location.").required().label("Job Locations"),
1100
+ jobLocations: (0, import_yup30.array)().of(LocationSchema.required().label("Job Location")).min(1, "Pick at least one preferred location.").required().label("Job Locations"),
730
1101
  /**
731
1102
  * Seniority levels the user wants jobs to be matched against. Multi-select
732
1103
  * (up to 2) for borderline candidates.
733
1104
  *
734
1105
  * Distinct from the singular `experienceLevel` field on `UserSchema`
735
- * (concat'd via `UserGeneralDetailSchema`) that field captures the user's
1106
+ * (concat'd via `UserGeneralDetailSchema`) - that field captures the user's
736
1107
  * own current seniority, while these are the levels they want to *target*.
737
1108
  * Both reuse the same `ExperienceLevel` taxonomy from `common.constant.ts`
738
1109
  * so search/match logic doesn't have to translate between two vocabularies.
739
1110
  */
740
- targetExperienceLevels: (0, import_yup24.array)().of((0, import_yup24.string)().oneOf(SupportedExperienceLevels).required()).min(1, "Pick at least one experience level.").max(2, "You can select at most 2 experience levels.").required().label("Target Experience Levels"),
1111
+ targetExperienceLevels: (0, import_yup30.array)().of((0, import_yup30.string)().oneOf(SupportedExperienceLevels).required()).min(1, "Pick at least one experience level.").max(2, "You can select at most 2 experience levels.").required().label("Target Experience Levels"),
741
1112
  /**
742
- * Specializations the user is searching for free-form titles.
1113
+ * Specializations the user is searching for - free-form titles.
743
1114
  *
744
1115
  * Job titles are an open vocabulary (think O*NET, ESCO, LinkedIn's title
745
1116
  * graph), so the schema only enforces length bounds per entry. The wizard
746
1117
  * surfaces a curated "Popular Roles" picker for discovery, but the user
747
1118
  * can ultimately add any title; matching/normalization happens downstream.
748
1119
  */
749
- jobRoles: (0, import_yup24.array)().of((0, import_yup24.string)().trim().max(120).required()).min(1, "Pick at least one role.").required().label("Job Roles"),
1120
+ jobRoles: (0, import_yup30.array)().of((0, import_yup30.string)().trim().max(120).required()).min(1, "Pick at least one role.").required().label("Job Roles"),
750
1121
  /**
751
1122
  * Minimum acceptable annual base salary, in `minSalaryCurrency`.
752
1123
  * Stored as an integer in the currency's major unit (e.g. dollars, not cents).
753
- * Defaults to 0 ("any salary") rather than being optional every job-seeker
1124
+ * Defaults to 0 ("any salary") rather than being optional - every job-seeker
754
1125
  * has a floor, even if it's zero.
755
1126
  */
756
- minSalary: (0, import_yup24.number)().integer().min(MIN_SALARY_LOWER_BOUND).max(MIN_SALARY_UPPER_BOUND).default(0).required().label("Minimum Salary"),
757
- minSalaryCurrency: (0, import_yup24.string)().oneOf(SupportedSalaryCurrencies).default("USD").required().label("Minimum Salary Currency"),
1127
+ minSalary: (0, import_yup30.number)().integer().min(MIN_SALARY_LOWER_BOUND).max(MIN_SALARY_UPPER_BOUND).default(0).required().label("Minimum Salary"),
1128
+ minSalaryCurrency: (0, import_yup30.string)().oneOf(SupportedSalaryCurrencies).default("USD").required().label("Minimum Salary Currency"),
758
1129
  /**
759
1130
  * Marketing-attribution capture from the final onboarding step.
760
1131
  */
761
- referralSource: (0, import_yup24.string)().oneOf(SupportedReferralSources).required().label("Referral Source"),
1132
+ referralSource: (0, import_yup30.string)().oneOf(SupportedReferralSources).required().label("Referral Source"),
762
1133
  /**
763
1134
  * Resumes the user has uploaded. Embedded directly on the user document
764
- * (capped at 5) they're cheap to denormalize, every wizard step that
1135
+ * (capped at 5) - they're cheap to denormalize, every wizard step that
765
1136
  * cares about them is already loading the user doc, and the cap keeps the
766
1137
  * subdoc bounded.
767
1138
  *
@@ -769,147 +1140,147 @@ var UserJobPreferencesSchema = (0, import_yup24.object)({
769
1140
  * the API can sign for download is kept here.
770
1141
  *
771
1142
  * Distinct from the `Resumes` collection used by the (currently unused)
772
- * AI resume-builder flow onboarding uploads land here, AI-built resumes
1143
+ * AI resume-builder flow - onboarding uploads land here, AI-built resumes
773
1144
  * live in their own collection.
774
1145
  */
775
- resumes: (0, import_yup24.array)().of(
776
- (0, import_yup24.object)({
777
- // Stable id assigned on upload used to address a specific entry
1146
+ resumes: (0, import_yup30.array)().of(
1147
+ (0, import_yup30.object)({
1148
+ // Stable id assigned on upload - used to address a specific entry
778
1149
  // for delete / set-primary operations without exposing the GCS URL
779
1150
  // as a route key.
780
- id: (0, import_yup24.string)().required().label("ID"),
781
- url: (0, import_yup24.string)().required().label("Resume URL"),
782
- filename: (0, import_yup24.string)().trim().max(255).optional().label("Filename"),
783
- sizeBytes: (0, import_yup24.number)().integer().min(0).optional().label("Size (bytes)"),
784
- mimeType: (0, import_yup24.string)().trim().max(120).optional().label("MIME Type"),
785
- uploadedAt: (0, import_yup24.date)().required().label("Uploaded At"),
786
- isPrimary: (0, import_yup24.boolean)().default(false).label("Is Primary")
1151
+ id: (0, import_yup30.string)().required().label("ID"),
1152
+ url: (0, import_yup30.string)().required().label("Resume URL"),
1153
+ filename: (0, import_yup30.string)().trim().max(255).optional().label("Filename"),
1154
+ sizeBytes: (0, import_yup30.number)().integer().min(0).optional().label("Size (bytes)"),
1155
+ mimeType: (0, import_yup30.string)().trim().max(120).optional().label("MIME Type"),
1156
+ uploadedAt: (0, import_yup30.date)().required().label("Uploaded At"),
1157
+ isPrimary: (0, import_yup30.boolean)().default(false).label("Is Primary")
787
1158
  }).noUnknown().strict().label("Resume")
788
1159
  ).max(5, "You can keep at most 5 resumes on file.").default([]).label("Resumes"),
789
1160
  /**
790
1161
  * Set when the user finishes the wizard's last step. Acts as the gate the
791
1162
  * onboarding hook checks to redirect users who haven't completed setup.
792
1163
  */
793
- onboardingCompletedAt: (0, import_yup24.date)().nullable().optional().label("Onboarding Completed At"),
1164
+ onboardingCompletedAt: (0, import_yup30.date)().nullable().optional().label("Onboarding Completed At"),
794
1165
  /**
795
1166
  * Parser-suggested values for wizard fields, written by the resume-upload
796
- * flow. Every parser-derived field lands here including profile-shaped
1167
+ * flow. Every parser-derived field lands here - including profile-shaped
797
1168
  * fields (headline, aboutMe, mobile, location, experienceLevel,
798
- * socialAccounts, workExperiences, educations) so nothing reaches the
1169
+ * socialAccounts, workExperiences, educations) - so nothing reaches the
799
1170
  * top-level user document until the user confirms it on the matching
800
1171
  * wizard step. When a user clicks Next on a step, the API drops the
801
1172
  * matching key from this sub-doc so a re-uploaded resume can't overwrite
802
1173
  * confirmed answers.
803
1174
  *
804
- * READ RULE strict:
1175
+ * READ RULE - strict:
805
1176
  * `pendingPrefill.<field>` is ONLY for seeding a wizard step's form
806
1177
  * initial value (e.g. `prefer(user.<field>, user.pendingPrefill?.<field>)`
807
- * in a step's `load`). It is NOT the user's actual value it's an
1178
+ * in a step's `load`). It is NOT the user's actual value - it's an
808
1179
  * unconfirmed suggestion. Never substitute it as a fallback in profile
809
1180
  * pages, search/match, recommendations, public profile, dashboards, or
810
1181
  * APIs. If `user.<field>` is empty there, the correct behavior is empty,
811
1182
  * because the user has not confirmed it yet.
812
1183
  */
813
- pendingPrefill: (0, import_yup24.object)({
814
- headline: (0, import_yup24.string)().trim().optional().label("Pending Headline"),
815
- aboutMe: (0, import_yup24.string)().trim().optional().label("Pending About Me"),
816
- mobile: (0, import_yup24.string)().trim().optional().label("Pending Mobile"),
1184
+ pendingPrefill: (0, import_yup30.object)({
1185
+ headline: (0, import_yup30.string)().trim().optional().label("Pending Headline"),
1186
+ aboutMe: (0, import_yup30.string)().trim().optional().label("Pending About Me"),
1187
+ mobile: (0, import_yup30.string)().trim().optional().label("Pending Mobile"),
817
1188
  location: LocationSchema.optional().default(void 0).label("Pending Location"),
818
- experienceLevel: (0, import_yup24.string)().oneOf(SupportedExperienceLevels).optional().label("Pending Experience Level"),
819
- socialAccounts: (0, import_yup24.array)().of(SocialAccountSchema.required()).optional().label("Pending Social Accounts"),
820
- workExperiences: (0, import_yup24.array)().of(WorkExperienceSchema.required()).optional().label("Pending Work Experiences"),
821
- educations: (0, import_yup24.array)().of(EducationSchema.required()).optional().label("Pending Educations")
1189
+ experienceLevel: (0, import_yup30.string)().oneOf(SupportedExperienceLevels).optional().label("Pending Experience Level"),
1190
+ socialAccounts: (0, import_yup30.array)().of(SocialAccountSchema.required()).optional().label("Pending Social Accounts"),
1191
+ workExperiences: (0, import_yup30.array)().of(WorkExperienceSchema.required()).optional().label("Pending Work Experiences"),
1192
+ educations: (0, import_yup30.array)().of(EducationSchema.required()).optional().label("Pending Educations")
822
1193
  }).nullable().optional().default(void 0).label("Pending Prefill")
823
1194
  }).noUnknown().strict().label("User Job Preferences Schema");
824
1195
 
825
1196
  // src/user/user-recruiter-profile.schema.ts
826
- var import_yup25 = require("yup");
827
- var RecruiterPageLinkSchema = (0, import_yup25.object)({
1197
+ var import_yup31 = require("yup");
1198
+ var RecruiterPageLinkSchema = (0, import_yup31.object)({
828
1199
  page: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Company Page"),
829
- jobTitle: (0, import_yup25.string)().trim().max(100).optional().label("Job Title")
1200
+ jobTitle: (0, import_yup31.string)().trim().max(100).optional().label("Job Title")
830
1201
  }).noUnknown().strict().label("Recruiter Page Link");
831
- var UserRecruiterProfileSchema = (0, import_yup25.object)({
832
- recruiterProfile: (0, import_yup25.object)({
833
- hiringFor: (0, import_yup25.array)().of(RecruiterPageLinkSchema).default([]).label("Hiring For")
1202
+ var UserRecruiterProfileSchema = (0, import_yup31.object)({
1203
+ recruiterProfile: (0, import_yup31.object)({
1204
+ hiringFor: (0, import_yup31.array)().of(RecruiterPageLinkSchema).default([]).label("Hiring For")
834
1205
  }).optional().default(void 0).label("Recruiter Profile")
835
1206
  }).noUnknown().strict().label("User Recruiter Profile");
836
1207
 
837
1208
  // src/user/user-coordinator-profile.schema.ts
838
- var import_yup26 = require("yup");
839
- var CoordinatorPageLinkSchema = (0, import_yup26.object)({
1209
+ var import_yup32 = require("yup");
1210
+ var CoordinatorPageLinkSchema = (0, import_yup32.object)({
840
1211
  page: PageSchema.pick(["name", "slug", "type", "logo"]).deepPartial().concat(PageSchema.pick(["name", "type"])).required().label("Institute Page"),
841
- jobTitle: (0, import_yup26.string)().trim().max(100).optional().label("Job Title")
1212
+ jobTitle: (0, import_yup32.string)().trim().max(100).optional().label("Job Title")
842
1213
  }).noUnknown().strict().label("Coordinator Page Link");
843
- var UserCoordinatorProfileSchema = (0, import_yup26.object)({
844
- coordinatorProfile: (0, import_yup26.object)({
845
- coordinatesAt: (0, import_yup26.array)().of(CoordinatorPageLinkSchema).default([]).label("Coordinates At")
1214
+ var UserCoordinatorProfileSchema = (0, import_yup32.object)({
1215
+ coordinatorProfile: (0, import_yup32.object)({
1216
+ coordinatesAt: (0, import_yup32.array)().of(CoordinatorPageLinkSchema).default([]).label("Coordinates At")
846
1217
  }).optional().default(void 0).label("Coordinator Profile")
847
1218
  }).noUnknown().strict().label("User Coordinator Profile");
848
1219
 
849
1220
  // src/user/user.schema.ts
850
- var UserSchema = (0, import_yup27.object)({
1221
+ var UserSchema = (0, import_yup33.object)({
851
1222
  /**
852
1223
  * Related auth account id from auth Server (e.g. Better auth https://auth.thejob.dev)
853
1224
  */
854
- authAccountId: (0, import_yup27.string)().required().label("Auth Account ID"),
1225
+ authAccountId: (0, import_yup33.string)().required().label("Auth Account ID"),
855
1226
  /**
856
1227
  * Social media information about the user (e.g. LinkedIn, GitHub, etc.)
857
1228
  */
858
- socialAccounts: (0, import_yup27.array)().of(SocialAccountSchema).default([]).label("Social Accounts"),
1229
+ socialAccounts: (0, import_yup33.array)().of(SocialAccountSchema).default([]).label("Social Accounts"),
859
1230
  /**
860
1231
  * Work experience information about the user
861
1232
  */
862
- workExperiences: (0, import_yup27.array)().of(WorkExperienceSchema).required().default([]).label("Work Experiences"),
1233
+ workExperiences: (0, import_yup33.array)().of(WorkExperienceSchema).required().default([]).label("Work Experiences"),
863
1234
  /**
864
1235
  * Education information about the user
865
1236
  */
866
- educations: (0, import_yup27.array)().of(EducationSchema).required().default([]).label("Educations"),
1237
+ educations: (0, import_yup33.array)().of(EducationSchema).required().default([]).label("Educations"),
867
1238
  /**
868
1239
  * Skills information about the user
869
1240
  */
870
- skills: (0, import_yup27.array)().of(UserSkillSchema).required().default([]).label("Skills"),
1241
+ skills: (0, import_yup33.array)().of(UserSkillSchema).required().default([]).label("Skills"),
871
1242
  /**
872
1243
  * Projects information about the user
873
1244
  */
874
- projects: (0, import_yup27.array)().of(UserProjectSchema).default([]).label("Projects"),
1245
+ projects: (0, import_yup33.array)().of(UserProjectSchema).default([]).label("Projects"),
875
1246
  /**
876
1247
  * Certifications information about the user
877
1248
  */
878
- certifications: (0, import_yup27.array)().of(UserCertificationSchema).default([]).label("Certifications"),
1249
+ certifications: (0, import_yup33.array)().of(UserCertificationSchema).default([]).label("Certifications"),
879
1250
  /**
880
1251
  * Interests information about the user.
881
1252
  */
882
- interests: (0, import_yup27.array)().of(UserInterestSchema).optional().default([]).label("Interests"),
1253
+ interests: (0, import_yup33.array)().of(UserInterestSchema).optional().default([]).label("Interests"),
883
1254
  /**
884
1255
  * Languages information about the user
885
1256
  */
886
- languages: (0, import_yup27.array)().of(UserLanguageSchema).required().default([]).label("Languages"),
1257
+ languages: (0, import_yup33.array)().of(UserLanguageSchema).required().default([]).label("Languages"),
887
1258
  /**
888
1259
  * Additional information about the user
889
1260
  */
890
- additionalInfo: (0, import_yup27.array)().of(UserAdditionalInfoSchema).default([]).label("Additional Information"),
1261
+ additionalInfo: (0, import_yup33.array)().of(UserAdditionalInfoSchema).default([]).label("Additional Information"),
891
1262
  /**
892
1263
  * Status of the user account
893
1264
  */
894
- status: (0, import_yup27.string)().oneOf(SupportedUserStatuses).required().label("Status"),
1265
+ status: (0, import_yup33.string)().oneOf(SupportedUserStatuses).required().label("Status"),
895
1266
  /**
896
1267
  * Roles assigned to the user
897
1268
  */
898
- roles: (0, import_yup27.array)().of((0, import_yup27.string)().oneOf(SupportedUserRoles)).required().default(DefaultUserRoles).label("Roles"),
1269
+ roles: (0, import_yup33.array)().of((0, import_yup33.string)().oneOf(SupportedUserRoles)).required().default(DefaultUserRoles).label("Roles"),
899
1270
  /**
900
1271
  * Vector embedding of the user's profile for semantic/hybrid search.
901
1272
  * Generated from a structured summary of skills, experience, education, etc.
902
1273
  * Only generated for public profiles with sufficient completeness (≥60%).
903
1274
  */
904
- embedding: (0, import_yup27.object)({
905
- vector: (0, import_yup27.array)((0, import_yup27.number)().required()).optional().label("Embedding vector"),
906
- model: (0, import_yup27.string)().optional().label("Embedding model")
1275
+ embedding: (0, import_yup33.object)({
1276
+ vector: (0, import_yup33.array)((0, import_yup33.number)().required()).optional().label("Embedding vector"),
1277
+ model: (0, import_yup33.string)().optional().label("Embedding model")
907
1278
  }).nullable().optional().label("Embedding")
908
1279
  }).concat(UserGeneralDetailSchema).concat(UserJobPreferencesSchema).concat(UserRecruiterProfileSchema).concat(UserCoordinatorProfileSchema).noUnknown().strict().label("User Schema");
909
1280
 
910
1281
  // src/user/user-completeness.schema.ts
911
- var import_yup28 = require("yup");
912
- var UserCompletenessSchema = (0, import_yup28.object)({
1282
+ var import_yup34 = require("yup");
1283
+ var UserCompletenessSchema = (0, import_yup34.object)({
913
1284
  additionalInfo: CompletenessScoreSchema(0).label("Additional Info"),
914
1285
  // Optional
915
1286
  certifications: CompletenessScoreSchema(0).label("Certifications"),
@@ -932,17 +1303,27 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
932
1303
  ]);
933
1304
  // Annotate the CommonJS export names for ESM import in node:
934
1305
  0 && (module.exports = {
1306
+ AnswerChoiceType,
1307
+ ApplicationReceivePreference,
1308
+ ChoiceQuestionSchema,
1309
+ Common,
1310
+ CompensationType,
935
1311
  CompletenessScoreSchema,
936
1312
  ContactTypes,
937
1313
  CoordinatorPageLinkSchema,
1314
+ DISPLAY_DATE_FORMAT,
1315
+ DISPLAY_DATE_FORMAT_SHORT,
938
1316
  DateStringSchema,
939
1317
  DbDefaultSchema,
940
1318
  DefaultPaginatedResponse,
941
1319
  DefaultPaginationOptions,
942
1320
  DefaultUserRoles,
943
1321
  DurationSchema,
1322
+ EMPTY_STRING,
944
1323
  EducationLevel,
945
1324
  EducationSchema,
1325
+ EmployeeCount,
1326
+ EmploymentType,
946
1327
  ExperienceLevel,
947
1328
  GeneraDetailFields,
948
1329
  GroupManagedBy,
@@ -952,7 +1333,10 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
952
1333
  GroupStatus,
953
1334
  GroupTranslationSchema,
954
1335
  GroupVisibility,
1336
+ InputQuestionSchema,
1337
+ JobSchema,
955
1338
  JobSearchUrgency,
1339
+ JobStatus,
956
1340
  LocationSchema,
957
1341
  MIN_SALARY_LOWER_BOUND,
958
1342
  MIN_SALARY_UPPER_BOUND,
@@ -961,27 +1345,45 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
961
1345
  PageType,
962
1346
  PaginationSchema,
963
1347
  ProficiencyLevel,
1348
+ QuestionSchema,
1349
+ QuestionType,
1350
+ ReadAndAcknowledgeQuestionSchema,
964
1351
  RecruiterPageLinkSchema,
965
1352
  ReferralSource,
1353
+ ReportReason,
1354
+ ReportSchema,
1355
+ ResourceType,
1356
+ SITEMAP_FORMAT,
1357
+ SYSTEM_DATE_FORMAT,
966
1358
  SkillSchema,
967
1359
  SocialAccount,
968
1360
  SocialAccountSchema,
969
1361
  StudentCompletenessSchema,
970
1362
  StudyType,
1363
+ SupportedAnswerChoiceTypes,
1364
+ SupportedApplicationReceivePreferences,
1365
+ SupportedCompensationTypes,
971
1366
  SupportedContactTypes,
972
1367
  SupportedEducationLevels,
1368
+ SupportedEmployeeCounts,
1369
+ SupportedEmploymentTypes,
973
1370
  SupportedExperienceLevels,
974
1371
  SupportedJobSearchUrgencies,
1372
+ SupportedJobStatuses,
975
1373
  SupportedPageStatuses,
976
1374
  SupportedPageTypes,
977
1375
  SupportedProficiencyLevels,
1376
+ SupportedQuestionTypes,
978
1377
  SupportedReferralSources,
1378
+ SupportedReportReasons,
1379
+ SupportedResourceTypes,
979
1380
  SupportedSalaryCurrencies,
980
1381
  SupportedSocialAccounts,
981
1382
  SupportedStudyTypes,
982
1383
  SupportedUserProfileVisibilities,
983
1384
  SupportedUserRoles,
984
1385
  SupportedUserStatuses,
1386
+ SupportedWorkModes,
985
1387
  TermsAcceptedSchema,
986
1388
  UserAdditionalInfoSchema,
987
1389
  UserCertificationSchema,
@@ -989,6 +1391,7 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
989
1391
  UserCoordinatorProfileSchema,
990
1392
  UserDetailType,
991
1393
  UserGeneralDetailSchema,
1394
+ UserIdAndCreatedAtSchema,
992
1395
  UserInterestSchema,
993
1396
  UserJobPreferencesSchema,
994
1397
  UserLanguageSchema,
@@ -1000,5 +1403,7 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
1000
1403
  UserSkillSchema,
1001
1404
  UserStatus,
1002
1405
  WorkExperienceSchema,
1003
- dateString
1406
+ WorkMode,
1407
+ dateString,
1408
+ getSchemaByQuestion
1004
1409
  });