@thejob/schema 2.1.0 → 2.1.1

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
@@ -64,6 +64,7 @@ __export(index_exports, {
64
64
  GroupVisibility: () => GroupVisibility,
65
65
  InputQuestionSchema: () => InputQuestionSchema,
66
66
  JOB_TAXONOMY: () => JOB_TAXONOMY,
67
+ JobAlertFrequency: () => JobAlertFrequency,
67
68
  JobCategory: () => JobCategory,
68
69
  JobIndustry: () => JobIndustry,
69
70
  JobSchema: () => JobSchema,
@@ -108,6 +109,7 @@ __export(index_exports, {
108
109
  SupportedEmployeeCounts: () => SupportedEmployeeCounts,
109
110
  SupportedEmploymentTypes: () => SupportedEmploymentTypes,
110
111
  SupportedExperienceLevels: () => SupportedExperienceLevels,
112
+ SupportedJobAlertFrequencies: () => SupportedJobAlertFrequencies,
111
113
  SupportedJobCategories: () => SupportedJobCategories,
112
114
  SupportedJobIndustries: () => SupportedJobIndustries,
113
115
  SupportedJobSearchUrgencies: () => SupportedJobSearchUrgencies,
@@ -2140,6 +2142,13 @@ var ReferralSource = /* @__PURE__ */ ((ReferralSource2) => {
2140
2142
  return ReferralSource2;
2141
2143
  })(ReferralSource || {});
2142
2144
  var SupportedReferralSources = Object.values(ReferralSource);
2145
+ var JobAlertFrequency = /* @__PURE__ */ ((JobAlertFrequency2) => {
2146
+ JobAlertFrequency2["Off"] = "off";
2147
+ JobAlertFrequency2["Daily"] = "daily";
2148
+ JobAlertFrequency2["Weekly"] = "weekly";
2149
+ return JobAlertFrequency2;
2150
+ })(JobAlertFrequency || {});
2151
+ var SupportedJobAlertFrequencies = Object.values(JobAlertFrequency);
2143
2152
  var SupportedSalaryCurrencies = ["USD", "EUR", "GBP", "SEK", "INR"];
2144
2153
  var MIN_SALARY_LOWER_BOUND = 0;
2145
2154
  var MIN_SALARY_UPPER_BOUND = 1e6;
@@ -2625,7 +2634,13 @@ var UserSchema = (0, import_yup35.object)({
2625
2634
  /** Epoch ms of the last consent change (opt-in or opt-out). */
2626
2635
  updatedAt: (0, import_yup35.number)().optional().label("Consent updated at"),
2627
2636
  /** Where the consent change originated, e.g. `onboarding`, `unsubscribe`, `settings`. */
2628
- source: (0, import_yup35.string)().optional().label("Consent source")
2637
+ source: (0, import_yup35.string)().optional().label("Consent source"),
2638
+ /**
2639
+ * How often the user receives job-alert emails. `off` disables job alerts
2640
+ * only; other marketing stays governed by `subscribed`. Unset means the
2641
+ * user has not chosen a cadence yet.
2642
+ */
2643
+ jobAlertFrequency: (0, import_yup35.string)().oneOf(SupportedJobAlertFrequencies).optional().label("Job alert frequency")
2629
2644
  }).default({ subscribed: false }).label("Marketing Consent"),
2630
2645
  /**
2631
2646
  * Vector embedding of the user's profile for semantic/hybrid search.
@@ -2697,6 +2712,7 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
2697
2712
  GroupVisibility,
2698
2713
  InputQuestionSchema,
2699
2714
  JOB_TAXONOMY,
2715
+ JobAlertFrequency,
2700
2716
  JobCategory,
2701
2717
  JobIndustry,
2702
2718
  JobSchema,
@@ -2741,6 +2757,7 @@ var StudentCompletenessSchema = UserCompletenessSchema.omit([
2741
2757
  SupportedEmployeeCounts,
2742
2758
  SupportedEmploymentTypes,
2743
2759
  SupportedExperienceLevels,
2760
+ SupportedJobAlertFrequencies,
2744
2761
  SupportedJobCategories,
2745
2762
  SupportedJobIndustries,
2746
2763
  SupportedJobSearchUrgencies,
package/dist/index.d.cts CHANGED
@@ -1640,6 +1640,17 @@ declare enum ReferralSource {
1640
1640
  Other = "other"
1641
1641
  }
1642
1642
  declare const SupportedReferralSources: ReferralSource[];
1643
+ /**
1644
+ * How often a subscribed user receives job-alert emails. `Off` disables job
1645
+ * alerts specifically while leaving other marketing (newsletters, product
1646
+ * updates) governed by `marketingConsent.subscribed`.
1647
+ */
1648
+ declare enum JobAlertFrequency {
1649
+ Off = "off",
1650
+ Daily = "daily",
1651
+ Weekly = "weekly"
1652
+ }
1653
+ declare const SupportedJobAlertFrequencies: JobAlertFrequency[];
1643
1654
  /** ISO-4217 currency codes accepted for the salary preference (extend as needed). */
1644
1655
  declare const SupportedSalaryCurrencies: readonly ["USD", "EUR", "GBP", "SEK", "INR"];
1645
1656
  type SupportedSalaryCurrency = (typeof SupportedSalaryCurrencies)[number];
@@ -1771,6 +1782,7 @@ declare const UserSchema: yup.ObjectSchema<{
1771
1782
  marketingConsent: {
1772
1783
  updatedAt?: number | undefined;
1773
1784
  source?: string | undefined;
1785
+ jobAlertFrequency?: JobAlertFrequency | undefined;
1774
1786
  subscribed: boolean;
1775
1787
  };
1776
1788
  embedding: {
@@ -2860,4 +2872,4 @@ declare const StudentCompletenessSchema: yup.ObjectSchema<{
2860
2872
  };
2861
2873
  }, "">;
2862
2874
 
2863
- export { AnswerChoiceType, ApplicationReceivePreference, CampaignSchema, CampaignStatus, ChoiceQuestionSchema, Common, CompensationType, CompletenessScoreSchema, ContactTypes, CoordinatorPageLinkSchema, DISPLAY_DATE_FORMAT, DISPLAY_DATE_FORMAT_SHORT, DateStringSchema, DbDefaultSchema, DefaultPaginatedResponse, DefaultPaginationOptions, DefaultUserRoles, DurationSchema, EMPTY_STRING, EducationLevel, EducationSchema, EmployeeCount, EmploymentType, ExperienceLevel, GeneraDetailFields, GroupManagedBy, GroupMembershipSchema, GroupMembershipStatus, GroupSchema, GroupStatus, GroupTranslationSchema, GroupVisibility, InputQuestionSchema, JOB_TAXONOMY, JobCategory, JobIndustry, JobSchema, JobSearchUrgency, JobStatus, JobSubCategory, ListFilterSchema, LocationSchema, MIN_SALARY_LOWER_BOUND, MIN_SALARY_UPPER_BOUND, MailingListSchema, PREFILL_MIRRORED_KEYS, PRIVATE_PROFILE_FIELDS, PageSchema, PageStatus, PageType, type PaginatedResponse, PaginationSchema, PostSchema, PostStatus, type PrefillMirroredKey, type PrivateProfileField, ProficiencyLevel, QuestionSchema, QuestionType, ReadAndAcknowledgeQuestionSchema, RecruiterPageLinkSchema, ReferralSource, ReportReason, ReportSchema, ResourceType, SITEMAP_FORMAT, SYSTEM_DATE_FORMAT, SkillSchema, SocialAccount, SocialAccountSchema, StudentCompletenessSchema, StudyType, SupportedAnswerChoiceTypes, SupportedApplicationReceivePreferences, SupportedCampaignStatuses, SupportedCompensationTypes, SupportedContactTypes, SupportedEducationLevels, SupportedEmployeeCounts, SupportedEmploymentTypes, SupportedExperienceLevels, SupportedJobCategories, SupportedJobIndustries, SupportedJobSearchUrgencies, SupportedJobStatuses, SupportedJobSubCategories, SupportedPageStatuses, SupportedPageTypes, SupportedPostStatuses, SupportedProficiencyLevels, SupportedQuestionTypes, SupportedReferralSources, SupportedReportReasons, SupportedResourceTypes, SupportedSalaryCurrencies, type SupportedSalaryCurrency, SupportedSocialAccounts, SupportedStudyTypes, SupportedUserProfileVisibilities, SupportedUserRoles, SupportedUserStatuses, SupportedWorkModes, TAXONOMY_LABELS, type TChoiceQuestionSchema, type TDurationSchema, type TInputQuestionSchema, type TJobSchema, type TPostSchema, type TQuestionSchema, type TReadAndAcknowledgeQuestionSchema, type TUserIdAndCreatedAtSchema, TermsAcceptedSchema, UserAdditionalInfoSchema, UserCertificationSchema, UserCompletenessSchema, UserCoordinatorProfileSchema, UserDetailType, UserGeneralDetailSchema, UserIdAndCreatedAtSchema, UserInterestSchema, UserJobPreferencesSchema, UserLanguageSchema, type UserProfileOverview, UserProfileVisibility, UserProjectSchema, UserRecruiterProfileSchema, UserRole, UserSchema, UserSkillSchema, UserStatus, WorkExperienceSchema, WorkMode, categoryOfIndustry, categoryOfSubCategory, dateString, deriveIndustry, getSchemaByQuestion, industriesOfCategory, industryOfSubCategory, subCategoriesOfIndustry };
2875
+ export { AnswerChoiceType, ApplicationReceivePreference, CampaignSchema, CampaignStatus, ChoiceQuestionSchema, Common, CompensationType, CompletenessScoreSchema, ContactTypes, CoordinatorPageLinkSchema, DISPLAY_DATE_FORMAT, DISPLAY_DATE_FORMAT_SHORT, DateStringSchema, DbDefaultSchema, DefaultPaginatedResponse, DefaultPaginationOptions, DefaultUserRoles, DurationSchema, EMPTY_STRING, EducationLevel, EducationSchema, EmployeeCount, EmploymentType, ExperienceLevel, GeneraDetailFields, GroupManagedBy, GroupMembershipSchema, GroupMembershipStatus, GroupSchema, GroupStatus, GroupTranslationSchema, GroupVisibility, InputQuestionSchema, JOB_TAXONOMY, JobAlertFrequency, JobCategory, JobIndustry, JobSchema, JobSearchUrgency, JobStatus, JobSubCategory, ListFilterSchema, LocationSchema, MIN_SALARY_LOWER_BOUND, MIN_SALARY_UPPER_BOUND, MailingListSchema, PREFILL_MIRRORED_KEYS, PRIVATE_PROFILE_FIELDS, PageSchema, PageStatus, PageType, type PaginatedResponse, PaginationSchema, PostSchema, PostStatus, type PrefillMirroredKey, type PrivateProfileField, ProficiencyLevel, QuestionSchema, QuestionType, ReadAndAcknowledgeQuestionSchema, RecruiterPageLinkSchema, ReferralSource, ReportReason, ReportSchema, ResourceType, SITEMAP_FORMAT, SYSTEM_DATE_FORMAT, SkillSchema, SocialAccount, SocialAccountSchema, StudentCompletenessSchema, StudyType, SupportedAnswerChoiceTypes, SupportedApplicationReceivePreferences, SupportedCampaignStatuses, SupportedCompensationTypes, SupportedContactTypes, SupportedEducationLevels, SupportedEmployeeCounts, SupportedEmploymentTypes, SupportedExperienceLevels, SupportedJobAlertFrequencies, SupportedJobCategories, SupportedJobIndustries, SupportedJobSearchUrgencies, SupportedJobStatuses, SupportedJobSubCategories, SupportedPageStatuses, SupportedPageTypes, SupportedPostStatuses, SupportedProficiencyLevels, SupportedQuestionTypes, SupportedReferralSources, SupportedReportReasons, SupportedResourceTypes, SupportedSalaryCurrencies, type SupportedSalaryCurrency, SupportedSocialAccounts, SupportedStudyTypes, SupportedUserProfileVisibilities, SupportedUserRoles, SupportedUserStatuses, SupportedWorkModes, TAXONOMY_LABELS, type TChoiceQuestionSchema, type TDurationSchema, type TInputQuestionSchema, type TJobSchema, type TPostSchema, type TQuestionSchema, type TReadAndAcknowledgeQuestionSchema, type TUserIdAndCreatedAtSchema, TermsAcceptedSchema, UserAdditionalInfoSchema, UserCertificationSchema, UserCompletenessSchema, UserCoordinatorProfileSchema, UserDetailType, UserGeneralDetailSchema, UserIdAndCreatedAtSchema, UserInterestSchema, UserJobPreferencesSchema, UserLanguageSchema, type UserProfileOverview, UserProfileVisibility, UserProjectSchema, UserRecruiterProfileSchema, UserRole, UserSchema, UserSkillSchema, UserStatus, WorkExperienceSchema, WorkMode, categoryOfIndustry, categoryOfSubCategory, dateString, deriveIndustry, getSchemaByQuestion, industriesOfCategory, industryOfSubCategory, subCategoriesOfIndustry };
package/dist/index.d.ts CHANGED
@@ -1640,6 +1640,17 @@ declare enum ReferralSource {
1640
1640
  Other = "other"
1641
1641
  }
1642
1642
  declare const SupportedReferralSources: ReferralSource[];
1643
+ /**
1644
+ * How often a subscribed user receives job-alert emails. `Off` disables job
1645
+ * alerts specifically while leaving other marketing (newsletters, product
1646
+ * updates) governed by `marketingConsent.subscribed`.
1647
+ */
1648
+ declare enum JobAlertFrequency {
1649
+ Off = "off",
1650
+ Daily = "daily",
1651
+ Weekly = "weekly"
1652
+ }
1653
+ declare const SupportedJobAlertFrequencies: JobAlertFrequency[];
1643
1654
  /** ISO-4217 currency codes accepted for the salary preference (extend as needed). */
1644
1655
  declare const SupportedSalaryCurrencies: readonly ["USD", "EUR", "GBP", "SEK", "INR"];
1645
1656
  type SupportedSalaryCurrency = (typeof SupportedSalaryCurrencies)[number];
@@ -1771,6 +1782,7 @@ declare const UserSchema: yup.ObjectSchema<{
1771
1782
  marketingConsent: {
1772
1783
  updatedAt?: number | undefined;
1773
1784
  source?: string | undefined;
1785
+ jobAlertFrequency?: JobAlertFrequency | undefined;
1774
1786
  subscribed: boolean;
1775
1787
  };
1776
1788
  embedding: {
@@ -2860,4 +2872,4 @@ declare const StudentCompletenessSchema: yup.ObjectSchema<{
2860
2872
  };
2861
2873
  }, "">;
2862
2874
 
2863
- export { AnswerChoiceType, ApplicationReceivePreference, CampaignSchema, CampaignStatus, ChoiceQuestionSchema, Common, CompensationType, CompletenessScoreSchema, ContactTypes, CoordinatorPageLinkSchema, DISPLAY_DATE_FORMAT, DISPLAY_DATE_FORMAT_SHORT, DateStringSchema, DbDefaultSchema, DefaultPaginatedResponse, DefaultPaginationOptions, DefaultUserRoles, DurationSchema, EMPTY_STRING, EducationLevel, EducationSchema, EmployeeCount, EmploymentType, ExperienceLevel, GeneraDetailFields, GroupManagedBy, GroupMembershipSchema, GroupMembershipStatus, GroupSchema, GroupStatus, GroupTranslationSchema, GroupVisibility, InputQuestionSchema, JOB_TAXONOMY, JobCategory, JobIndustry, JobSchema, JobSearchUrgency, JobStatus, JobSubCategory, ListFilterSchema, LocationSchema, MIN_SALARY_LOWER_BOUND, MIN_SALARY_UPPER_BOUND, MailingListSchema, PREFILL_MIRRORED_KEYS, PRIVATE_PROFILE_FIELDS, PageSchema, PageStatus, PageType, type PaginatedResponse, PaginationSchema, PostSchema, PostStatus, type PrefillMirroredKey, type PrivateProfileField, ProficiencyLevel, QuestionSchema, QuestionType, ReadAndAcknowledgeQuestionSchema, RecruiterPageLinkSchema, ReferralSource, ReportReason, ReportSchema, ResourceType, SITEMAP_FORMAT, SYSTEM_DATE_FORMAT, SkillSchema, SocialAccount, SocialAccountSchema, StudentCompletenessSchema, StudyType, SupportedAnswerChoiceTypes, SupportedApplicationReceivePreferences, SupportedCampaignStatuses, SupportedCompensationTypes, SupportedContactTypes, SupportedEducationLevels, SupportedEmployeeCounts, SupportedEmploymentTypes, SupportedExperienceLevels, SupportedJobCategories, SupportedJobIndustries, SupportedJobSearchUrgencies, SupportedJobStatuses, SupportedJobSubCategories, SupportedPageStatuses, SupportedPageTypes, SupportedPostStatuses, SupportedProficiencyLevels, SupportedQuestionTypes, SupportedReferralSources, SupportedReportReasons, SupportedResourceTypes, SupportedSalaryCurrencies, type SupportedSalaryCurrency, SupportedSocialAccounts, SupportedStudyTypes, SupportedUserProfileVisibilities, SupportedUserRoles, SupportedUserStatuses, SupportedWorkModes, TAXONOMY_LABELS, type TChoiceQuestionSchema, type TDurationSchema, type TInputQuestionSchema, type TJobSchema, type TPostSchema, type TQuestionSchema, type TReadAndAcknowledgeQuestionSchema, type TUserIdAndCreatedAtSchema, TermsAcceptedSchema, UserAdditionalInfoSchema, UserCertificationSchema, UserCompletenessSchema, UserCoordinatorProfileSchema, UserDetailType, UserGeneralDetailSchema, UserIdAndCreatedAtSchema, UserInterestSchema, UserJobPreferencesSchema, UserLanguageSchema, type UserProfileOverview, UserProfileVisibility, UserProjectSchema, UserRecruiterProfileSchema, UserRole, UserSchema, UserSkillSchema, UserStatus, WorkExperienceSchema, WorkMode, categoryOfIndustry, categoryOfSubCategory, dateString, deriveIndustry, getSchemaByQuestion, industriesOfCategory, industryOfSubCategory, subCategoriesOfIndustry };
2875
+ export { AnswerChoiceType, ApplicationReceivePreference, CampaignSchema, CampaignStatus, ChoiceQuestionSchema, Common, CompensationType, CompletenessScoreSchema, ContactTypes, CoordinatorPageLinkSchema, DISPLAY_DATE_FORMAT, DISPLAY_DATE_FORMAT_SHORT, DateStringSchema, DbDefaultSchema, DefaultPaginatedResponse, DefaultPaginationOptions, DefaultUserRoles, DurationSchema, EMPTY_STRING, EducationLevel, EducationSchema, EmployeeCount, EmploymentType, ExperienceLevel, GeneraDetailFields, GroupManagedBy, GroupMembershipSchema, GroupMembershipStatus, GroupSchema, GroupStatus, GroupTranslationSchema, GroupVisibility, InputQuestionSchema, JOB_TAXONOMY, JobAlertFrequency, JobCategory, JobIndustry, JobSchema, JobSearchUrgency, JobStatus, JobSubCategory, ListFilterSchema, LocationSchema, MIN_SALARY_LOWER_BOUND, MIN_SALARY_UPPER_BOUND, MailingListSchema, PREFILL_MIRRORED_KEYS, PRIVATE_PROFILE_FIELDS, PageSchema, PageStatus, PageType, type PaginatedResponse, PaginationSchema, PostSchema, PostStatus, type PrefillMirroredKey, type PrivateProfileField, ProficiencyLevel, QuestionSchema, QuestionType, ReadAndAcknowledgeQuestionSchema, RecruiterPageLinkSchema, ReferralSource, ReportReason, ReportSchema, ResourceType, SITEMAP_FORMAT, SYSTEM_DATE_FORMAT, SkillSchema, SocialAccount, SocialAccountSchema, StudentCompletenessSchema, StudyType, SupportedAnswerChoiceTypes, SupportedApplicationReceivePreferences, SupportedCampaignStatuses, SupportedCompensationTypes, SupportedContactTypes, SupportedEducationLevels, SupportedEmployeeCounts, SupportedEmploymentTypes, SupportedExperienceLevels, SupportedJobAlertFrequencies, SupportedJobCategories, SupportedJobIndustries, SupportedJobSearchUrgencies, SupportedJobStatuses, SupportedJobSubCategories, SupportedPageStatuses, SupportedPageTypes, SupportedPostStatuses, SupportedProficiencyLevels, SupportedQuestionTypes, SupportedReferralSources, SupportedReportReasons, SupportedResourceTypes, SupportedSalaryCurrencies, type SupportedSalaryCurrency, SupportedSocialAccounts, SupportedStudyTypes, SupportedUserProfileVisibilities, SupportedUserRoles, SupportedUserStatuses, SupportedWorkModes, TAXONOMY_LABELS, type TChoiceQuestionSchema, type TDurationSchema, type TInputQuestionSchema, type TJobSchema, type TPostSchema, type TQuestionSchema, type TReadAndAcknowledgeQuestionSchema, type TUserIdAndCreatedAtSchema, TermsAcceptedSchema, UserAdditionalInfoSchema, UserCertificationSchema, UserCompletenessSchema, UserCoordinatorProfileSchema, UserDetailType, UserGeneralDetailSchema, UserIdAndCreatedAtSchema, UserInterestSchema, UserJobPreferencesSchema, UserLanguageSchema, type UserProfileOverview, UserProfileVisibility, UserProjectSchema, UserRecruiterProfileSchema, UserRole, UserSchema, UserSkillSchema, UserStatus, WorkExperienceSchema, WorkMode, categoryOfIndustry, categoryOfSubCategory, dateString, deriveIndustry, getSchemaByQuestion, industriesOfCategory, industryOfSubCategory, subCategoriesOfIndustry };
package/dist/index.js CHANGED
@@ -1978,6 +1978,13 @@ var ReferralSource = /* @__PURE__ */ ((ReferralSource2) => {
1978
1978
  return ReferralSource2;
1979
1979
  })(ReferralSource || {});
1980
1980
  var SupportedReferralSources = Object.values(ReferralSource);
1981
+ var JobAlertFrequency = /* @__PURE__ */ ((JobAlertFrequency2) => {
1982
+ JobAlertFrequency2["Off"] = "off";
1983
+ JobAlertFrequency2["Daily"] = "daily";
1984
+ JobAlertFrequency2["Weekly"] = "weekly";
1985
+ return JobAlertFrequency2;
1986
+ })(JobAlertFrequency || {});
1987
+ var SupportedJobAlertFrequencies = Object.values(JobAlertFrequency);
1981
1988
  var SupportedSalaryCurrencies = ["USD", "EUR", "GBP", "SEK", "INR"];
1982
1989
  var MIN_SALARY_LOWER_BOUND = 0;
1983
1990
  var MIN_SALARY_UPPER_BOUND = 1e6;
@@ -2463,7 +2470,13 @@ var UserSchema = object32({
2463
2470
  /** Epoch ms of the last consent change (opt-in or opt-out). */
2464
2471
  updatedAt: number10().optional().label("Consent updated at"),
2465
2472
  /** Where the consent change originated, e.g. `onboarding`, `unsubscribe`, `settings`. */
2466
- source: string30().optional().label("Consent source")
2473
+ source: string30().optional().label("Consent source"),
2474
+ /**
2475
+ * How often the user receives job-alert emails. `off` disables job alerts
2476
+ * only; other marketing stays governed by `subscribed`. Unset means the
2477
+ * user has not chosen a cadence yet.
2478
+ */
2479
+ jobAlertFrequency: string30().oneOf(SupportedJobAlertFrequencies).optional().label("Job alert frequency")
2467
2480
  }).default({ subscribed: false }).label("Marketing Consent"),
2468
2481
  /**
2469
2482
  * Vector embedding of the user's profile for semantic/hybrid search.
@@ -2534,6 +2547,7 @@ export {
2534
2547
  GroupVisibility,
2535
2548
  InputQuestionSchema,
2536
2549
  JOB_TAXONOMY,
2550
+ JobAlertFrequency,
2537
2551
  JobCategory,
2538
2552
  JobIndustry,
2539
2553
  JobSchema,
@@ -2578,6 +2592,7 @@ export {
2578
2592
  SupportedEmployeeCounts,
2579
2593
  SupportedEmploymentTypes,
2580
2594
  SupportedExperienceLevels,
2595
+ SupportedJobAlertFrequencies,
2581
2596
  SupportedJobCategories,
2582
2597
  SupportedJobIndustries,
2583
2598
  SupportedJobSearchUrgencies,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thejob/schema",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -84,6 +84,19 @@ export enum ReferralSource {
84
84
 
85
85
  export const SupportedReferralSources = Object.values(ReferralSource);
86
86
 
87
+ /**
88
+ * How often a subscribed user receives job-alert emails. `Off` disables job
89
+ * alerts specifically while leaving other marketing (newsletters, product
90
+ * updates) governed by `marketingConsent.subscribed`.
91
+ */
92
+ export enum JobAlertFrequency {
93
+ Off = "off",
94
+ Daily = "daily",
95
+ Weekly = "weekly",
96
+ }
97
+
98
+ export const SupportedJobAlertFrequencies = Object.values(JobAlertFrequency);
99
+
87
100
  /** ISO-4217 currency codes accepted for the salary preference (extend as needed). */
88
101
  export const SupportedSalaryCurrencies = ["USD", "EUR", "GBP", "SEK", "INR"] as const;
89
102
  export type SupportedSalaryCurrency = (typeof SupportedSalaryCurrencies)[number];
@@ -2,6 +2,7 @@ import { array, boolean, number, object, string } from "yup";
2
2
 
3
3
  import {
4
4
  DefaultUserRoles,
5
+ SupportedJobAlertFrequencies,
5
6
  SupportedUserRoles,
6
7
  SupportedUserStatuses,
7
8
  } from "./user.constant.js";
@@ -127,6 +128,15 @@ export const UserSchema = object({
127
128
  updatedAt: number().optional().label("Consent updated at"),
128
129
  /** Where the consent change originated, e.g. `onboarding`, `unsubscribe`, `settings`. */
129
130
  source: string().optional().label("Consent source"),
131
+ /**
132
+ * How often the user receives job-alert emails. `off` disables job alerts
133
+ * only; other marketing stays governed by `subscribed`. Unset means the
134
+ * user has not chosen a cadence yet.
135
+ */
136
+ jobAlertFrequency: string()
137
+ .oneOf(SupportedJobAlertFrequencies)
138
+ .optional()
139
+ .label("Job alert frequency"),
130
140
  })
131
141
  .default({ subscribed: false })
132
142
  .label("Marketing Consent"),