@zyacreatives/shared 2.1.98 → 2.2.0
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/schemas/job-application.d.ts +6 -0
- package/dist/schemas/job.d.ts +18 -0
- package/dist/schemas/job.js +13 -8
- package/dist/types/common.d.ts +4 -0
- package/package.json +1 -1
- package/src/schemas/job.ts +269 -297
- package/src/types/common.ts +5 -0
|
@@ -276,6 +276,7 @@ export declare const TrackedJobApplicationEntitySchema: z.ZodObject<{
|
|
|
276
276
|
Monthly: "Monthly";
|
|
277
277
|
"Project Based": "Project Based";
|
|
278
278
|
}>>;
|
|
279
|
+
version: z.ZodInt;
|
|
279
280
|
}, z.core.$strip>, z.ZodObject<{
|
|
280
281
|
id: z.ZodCUID2;
|
|
281
282
|
title: z.ZodString;
|
|
@@ -326,6 +327,7 @@ export declare const TrackedJobApplicationEntitySchema: z.ZodObject<{
|
|
|
326
327
|
}>>>;
|
|
327
328
|
isBookmarked: z.ZodBoolean;
|
|
328
329
|
createdAt: z.ZodDate;
|
|
330
|
+
version: z.ZodInt;
|
|
329
331
|
updatedAt: z.ZodDate;
|
|
330
332
|
}, z.core.$strip>, z.ZodObject<{
|
|
331
333
|
title: z.ZodString;
|
|
@@ -407,6 +409,7 @@ export declare const TrackedJobApplicationEntitySchema: z.ZodObject<{
|
|
|
407
409
|
Monthly: "Monthly";
|
|
408
410
|
"Project Based": "Project Based";
|
|
409
411
|
}>>;
|
|
412
|
+
version: z.ZodInt;
|
|
410
413
|
}, z.core.$strip>]>;
|
|
411
414
|
}, z.core.$strip>;
|
|
412
415
|
export declare const UpdateJobApplicationInputSchema: z.ZodObject<{
|
|
@@ -571,6 +574,7 @@ export declare const GetTrackedJobApplicationsOutputSchema: z.ZodObject<{
|
|
|
571
574
|
Monthly: "Monthly";
|
|
572
575
|
"Project Based": "Project Based";
|
|
573
576
|
}>>;
|
|
577
|
+
version: z.ZodInt;
|
|
574
578
|
}, z.core.$strip>, z.ZodObject<{
|
|
575
579
|
id: z.ZodCUID2;
|
|
576
580
|
title: z.ZodString;
|
|
@@ -621,6 +625,7 @@ export declare const GetTrackedJobApplicationsOutputSchema: z.ZodObject<{
|
|
|
621
625
|
}>>>;
|
|
622
626
|
isBookmarked: z.ZodBoolean;
|
|
623
627
|
createdAt: z.ZodDate;
|
|
628
|
+
version: z.ZodInt;
|
|
624
629
|
updatedAt: z.ZodDate;
|
|
625
630
|
}, z.core.$strip>, z.ZodObject<{
|
|
626
631
|
title: z.ZodString;
|
|
@@ -702,6 +707,7 @@ export declare const GetTrackedJobApplicationsOutputSchema: z.ZodObject<{
|
|
|
702
707
|
Monthly: "Monthly";
|
|
703
708
|
"Project Based": "Project Based";
|
|
704
709
|
}>>;
|
|
710
|
+
version: z.ZodInt;
|
|
705
711
|
}, z.core.$strip>]>;
|
|
706
712
|
}, z.core.$strip>>;
|
|
707
713
|
total: z.ZodNumber;
|
package/dist/schemas/job.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ export declare const BaseJobEntitySchema: z.ZodObject<{
|
|
|
55
55
|
[x: string]: string;
|
|
56
56
|
}>>>;
|
|
57
57
|
createdAt: z.ZodDate;
|
|
58
|
+
version: z.ZodInt;
|
|
58
59
|
updatedAt: z.ZodDate;
|
|
59
60
|
}, z.core.$strip>;
|
|
60
61
|
export declare const JobIdSchema: z.ZodObject<{
|
|
@@ -110,6 +111,7 @@ export declare const JobEntitySchema: z.ZodObject<{
|
|
|
110
111
|
}>>>;
|
|
111
112
|
isBookmarked: z.ZodBoolean;
|
|
112
113
|
createdAt: z.ZodDate;
|
|
114
|
+
version: z.ZodInt;
|
|
113
115
|
updatedAt: z.ZodDate;
|
|
114
116
|
}, z.core.$strip>;
|
|
115
117
|
export declare const GigJobEntitySchema: z.ZodObject<{
|
|
@@ -141,6 +143,7 @@ export declare const GigJobEntitySchema: z.ZodObject<{
|
|
|
141
143
|
Monthly: "Monthly";
|
|
142
144
|
"Project Based": "Project Based";
|
|
143
145
|
}>>;
|
|
146
|
+
version: z.ZodInt;
|
|
144
147
|
}, z.core.$strip>;
|
|
145
148
|
export declare const JobWithGigDetailsEntitySchema: z.ZodObject<{
|
|
146
149
|
title: z.ZodString;
|
|
@@ -216,6 +219,7 @@ export declare const JobWithGigDetailsEntitySchema: z.ZodObject<{
|
|
|
216
219
|
Monthly: "Monthly";
|
|
217
220
|
"Project Based": "Project Based";
|
|
218
221
|
}>>;
|
|
222
|
+
version: z.ZodInt;
|
|
219
223
|
}, z.core.$strip>;
|
|
220
224
|
export declare const RoleJobEntitySchema: z.ZodObject<{
|
|
221
225
|
id: z.ZodCUID2;
|
|
@@ -252,6 +256,7 @@ export declare const RoleJobEntitySchema: z.ZodObject<{
|
|
|
252
256
|
Monthly: "Monthly";
|
|
253
257
|
"Project Based": "Project Based";
|
|
254
258
|
}>>;
|
|
259
|
+
version: z.ZodInt;
|
|
255
260
|
}, z.core.$strip>;
|
|
256
261
|
export declare const JobWithRoleDetailsEntitySchema: z.ZodObject<{
|
|
257
262
|
title: z.ZodString;
|
|
@@ -333,6 +338,7 @@ export declare const JobWithRoleDetailsEntitySchema: z.ZodObject<{
|
|
|
333
338
|
Monthly: "Monthly";
|
|
334
339
|
"Project Based": "Project Based";
|
|
335
340
|
}>>;
|
|
341
|
+
version: z.ZodInt;
|
|
336
342
|
}, z.core.$strip>;
|
|
337
343
|
export declare const CreateJobInputSchema: z.ZodPipe<z.ZodObject<{
|
|
338
344
|
title: z.ZodString;
|
|
@@ -490,6 +496,7 @@ export declare const UpdateRoleJobInputSchema: z.ZodObject<{
|
|
|
490
496
|
Monthly: "Monthly";
|
|
491
497
|
"Project Based": "Project Based";
|
|
492
498
|
}>>>;
|
|
499
|
+
version: z.ZodInt;
|
|
493
500
|
}, z.core.$strip>;
|
|
494
501
|
export declare const UpdateGigJobInputSchema: z.ZodObject<{
|
|
495
502
|
id: z.ZodNonOptional<z.ZodOptional<z.ZodCUID2>>;
|
|
@@ -519,6 +526,7 @@ export declare const UpdateGigJobInputSchema: z.ZodObject<{
|
|
|
519
526
|
Monthly: "Monthly";
|
|
520
527
|
"Project Based": "Project Based";
|
|
521
528
|
}>>>;
|
|
529
|
+
version: z.ZodInt;
|
|
522
530
|
}, z.core.$strip>;
|
|
523
531
|
export declare const UpdateJobInputSchema: z.ZodObject<{
|
|
524
532
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -566,6 +574,7 @@ export declare const UpdateJobInputSchema: z.ZodObject<{
|
|
|
566
574
|
DRAFT: "DRAFT";
|
|
567
575
|
ARCHIVED: "ARCHIVED";
|
|
568
576
|
}>>;
|
|
577
|
+
version: z.ZodInt;
|
|
569
578
|
}, z.core.$strip>;
|
|
570
579
|
export declare const NormalizedJobSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
571
580
|
title: z.ZodString;
|
|
@@ -641,6 +650,7 @@ export declare const NormalizedJobSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
641
650
|
Monthly: "Monthly";
|
|
642
651
|
"Project Based": "Project Based";
|
|
643
652
|
}>>;
|
|
653
|
+
version: z.ZodInt;
|
|
644
654
|
}, z.core.$strip>, z.ZodObject<{
|
|
645
655
|
id: z.ZodCUID2;
|
|
646
656
|
title: z.ZodString;
|
|
@@ -691,6 +701,7 @@ export declare const NormalizedJobSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
691
701
|
}>>>;
|
|
692
702
|
isBookmarked: z.ZodBoolean;
|
|
693
703
|
createdAt: z.ZodDate;
|
|
704
|
+
version: z.ZodInt;
|
|
694
705
|
updatedAt: z.ZodDate;
|
|
695
706
|
}, z.core.$strip>, z.ZodObject<{
|
|
696
707
|
title: z.ZodString;
|
|
@@ -772,6 +783,7 @@ export declare const NormalizedJobSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
772
783
|
Monthly: "Monthly";
|
|
773
784
|
"Project Based": "Project Based";
|
|
774
785
|
}>>;
|
|
786
|
+
version: z.ZodInt;
|
|
775
787
|
}, z.core.$strip>]>;
|
|
776
788
|
export declare const GetCreatedJobsOutputSchema: z.ZodObject<{
|
|
777
789
|
jobs: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -848,6 +860,7 @@ export declare const GetCreatedJobsOutputSchema: z.ZodObject<{
|
|
|
848
860
|
Monthly: "Monthly";
|
|
849
861
|
"Project Based": "Project Based";
|
|
850
862
|
}>>;
|
|
863
|
+
version: z.ZodInt;
|
|
851
864
|
}, z.core.$strip>, z.ZodObject<{
|
|
852
865
|
id: z.ZodCUID2;
|
|
853
866
|
title: z.ZodString;
|
|
@@ -898,6 +911,7 @@ export declare const GetCreatedJobsOutputSchema: z.ZodObject<{
|
|
|
898
911
|
}>>>;
|
|
899
912
|
isBookmarked: z.ZodBoolean;
|
|
900
913
|
createdAt: z.ZodDate;
|
|
914
|
+
version: z.ZodInt;
|
|
901
915
|
updatedAt: z.ZodDate;
|
|
902
916
|
}, z.core.$strip>, z.ZodObject<{
|
|
903
917
|
title: z.ZodString;
|
|
@@ -979,6 +993,7 @@ export declare const GetCreatedJobsOutputSchema: z.ZodObject<{
|
|
|
979
993
|
Monthly: "Monthly";
|
|
980
994
|
"Project Based": "Project Based";
|
|
981
995
|
}>>;
|
|
996
|
+
version: z.ZodInt;
|
|
982
997
|
}, z.core.$strip>]>>;
|
|
983
998
|
noOfJobs: z.ZodNumber;
|
|
984
999
|
noOfActiveJobs: z.ZodNumber;
|
|
@@ -1099,6 +1114,7 @@ export declare const GetJobsOutputSchema: z.ZodObject<{
|
|
|
1099
1114
|
Monthly: "Monthly";
|
|
1100
1115
|
"Project Based": "Project Based";
|
|
1101
1116
|
}>>;
|
|
1117
|
+
version: z.ZodInt;
|
|
1102
1118
|
}, z.core.$strip>, z.ZodObject<{
|
|
1103
1119
|
id: z.ZodCUID2;
|
|
1104
1120
|
title: z.ZodString;
|
|
@@ -1149,6 +1165,7 @@ export declare const GetJobsOutputSchema: z.ZodObject<{
|
|
|
1149
1165
|
}>>>;
|
|
1150
1166
|
isBookmarked: z.ZodBoolean;
|
|
1151
1167
|
createdAt: z.ZodDate;
|
|
1168
|
+
version: z.ZodInt;
|
|
1152
1169
|
updatedAt: z.ZodDate;
|
|
1153
1170
|
}, z.core.$strip>, z.ZodObject<{
|
|
1154
1171
|
title: z.ZodString;
|
|
@@ -1230,6 +1247,7 @@ export declare const GetJobsOutputSchema: z.ZodObject<{
|
|
|
1230
1247
|
Monthly: "Monthly";
|
|
1231
1248
|
"Project Based": "Project Based";
|
|
1232
1249
|
}>>;
|
|
1250
|
+
version: z.ZodInt;
|
|
1233
1251
|
}, z.core.$strip>]>>;
|
|
1234
1252
|
total: z.ZodNumber;
|
|
1235
1253
|
page: z.ZodNumber;
|
package/dist/schemas/job.js
CHANGED
|
@@ -33,6 +33,7 @@ exports.BaseJobEntitySchema = zod_1.z.object({
|
|
|
33
33
|
constants_1.JOB_SECTIONS.COVER_LETTER,
|
|
34
34
|
]),
|
|
35
35
|
createdAt: zod_1.z.date(),
|
|
36
|
+
version: zod_1.z.int(),
|
|
36
37
|
updatedAt: zod_1.z.date(),
|
|
37
38
|
});
|
|
38
39
|
exports.JobIdSchema = zod_1.z.object({
|
|
@@ -64,6 +65,7 @@ exports.JobEntitySchema = zod_1.z.object({
|
|
|
64
65
|
]),
|
|
65
66
|
isBookmarked: zod_1.z.boolean(),
|
|
66
67
|
createdAt: zod_1.z.date(),
|
|
68
|
+
version: zod_1.z.int(),
|
|
67
69
|
updatedAt: zod_1.z.date(),
|
|
68
70
|
});
|
|
69
71
|
exports.GigJobEntitySchema = zod_1.z.object({
|
|
@@ -82,6 +84,7 @@ exports.GigJobEntitySchema = zod_1.z.object({
|
|
|
82
84
|
wagesType: zod_1.z
|
|
83
85
|
.enum(Object.values(constants_1.WAGE_TYPES))
|
|
84
86
|
.optional(),
|
|
87
|
+
version: zod_1.z.int(),
|
|
85
88
|
});
|
|
86
89
|
exports.JobWithGigDetailsEntitySchema = exports.JobEntitySchema.extend(exports.GigJobEntitySchema.shape);
|
|
87
90
|
exports.RoleJobEntitySchema = zod_1.z.object({
|
|
@@ -101,6 +104,7 @@ exports.RoleJobEntitySchema = zod_1.z.object({
|
|
|
101
104
|
wagesType: zod_1.z
|
|
102
105
|
.enum(Object.values(constants_1.WAGE_TYPES))
|
|
103
106
|
.optional(),
|
|
107
|
+
version: zod_1.z.int(),
|
|
104
108
|
});
|
|
105
109
|
exports.JobWithRoleDetailsEntitySchema = exports.JobEntitySchema.extend(exports.RoleJobEntitySchema.shape);
|
|
106
110
|
const CreateJobInputBaseSchema = zod_1.z.object({
|
|
@@ -163,9 +167,7 @@ exports.CreateRoleJobInputSchema = zod_1.z
|
|
|
163
167
|
.enum(Object.values(constants_1.WAGE_TYPES))
|
|
164
168
|
.optional(),
|
|
165
169
|
})
|
|
166
|
-
.refine(({ wagesMin, wagesMax }) => wagesMin === undefined ||
|
|
167
|
-
wagesMax === undefined ||
|
|
168
|
-
wagesMax > wagesMin, {
|
|
170
|
+
.refine(({ wagesMin, wagesMax }) => wagesMin === undefined || wagesMax === undefined || wagesMax > wagesMin, {
|
|
169
171
|
message: "wagesMax must be greater than wagesMin",
|
|
170
172
|
path: ["wagesMax"],
|
|
171
173
|
});
|
|
@@ -186,19 +188,22 @@ exports.CreateGigJobInputSchema = zod_1.z
|
|
|
186
188
|
.enum(Object.values(constants_1.WAGE_TYPES))
|
|
187
189
|
.optional(),
|
|
188
190
|
})
|
|
189
|
-
.refine(({ wagesMin, wagesMax }) => wagesMin === undefined ||
|
|
190
|
-
wagesMax === undefined ||
|
|
191
|
-
wagesMax > wagesMin, {
|
|
191
|
+
.refine(({ wagesMin, wagesMax }) => wagesMin === undefined || wagesMax === undefined || wagesMax > wagesMin, {
|
|
192
192
|
message: "wagesMax must be greater than wagesMin",
|
|
193
193
|
path: ["wagesMax"],
|
|
194
194
|
});
|
|
195
|
-
exports.UpdateRoleJobInputSchema = exports.CreateRoleJobInputSchema.partial()
|
|
196
|
-
|
|
195
|
+
exports.UpdateRoleJobInputSchema = exports.CreateRoleJobInputSchema.partial()
|
|
196
|
+
.extend({ version: zod_1.z.int() })
|
|
197
|
+
.required({ id: true });
|
|
198
|
+
exports.UpdateGigJobInputSchema = exports.CreateGigJobInputSchema.partial()
|
|
199
|
+
.extend({ version: zod_1.z.int() })
|
|
200
|
+
.required({ id: true });
|
|
197
201
|
exports.UpdateJobInputSchema = CreateJobInputBaseSchema.partial().extend({
|
|
198
202
|
id: zod_1.z.cuid2(),
|
|
199
203
|
status: zod_1.z
|
|
200
204
|
.enum(Object.values(constants_1.JOB_STATUS))
|
|
201
205
|
.optional(),
|
|
206
|
+
version: zod_1.z.int(),
|
|
202
207
|
});
|
|
203
208
|
exports.NormalizedJobSchema = zod_1.z.union([
|
|
204
209
|
exports.JobWithGigDetailsEntitySchema,
|
package/dist/types/common.d.ts
CHANGED
|
@@ -2,3 +2,7 @@ import z from "zod";
|
|
|
2
2
|
import { ProjectSocialGraphEntitySchema } from "../schemas";
|
|
3
3
|
export type ProjectSocialGraphEntity = z.infer<typeof ProjectSocialGraphEntitySchema>;
|
|
4
4
|
export type PostSocialGraphEntity = z.infer<typeof ProjectSocialGraphEntitySchema>;
|
|
5
|
+
export type Cursor = {
|
|
6
|
+
id: string;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
};
|
package/package.json
CHANGED
package/src/schemas/job.ts
CHANGED
|
@@ -1,364 +1,336 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
3
|
+
EMPLOYMENT_TYPE,
|
|
4
|
+
EmploymentType,
|
|
5
|
+
EXPERIENCE_LEVELS,
|
|
6
|
+
ExperienceLevel,
|
|
7
|
+
GIG_TYPE,
|
|
8
|
+
GigType,
|
|
9
|
+
JOB_LOCATIONS,
|
|
10
|
+
JOB_SECTIONS,
|
|
11
|
+
JOB_STATUS,
|
|
12
|
+
JOB_TYPE,
|
|
13
|
+
JobLocation,
|
|
14
|
+
JobStatus,
|
|
15
|
+
JobType,
|
|
16
|
+
WAGE_TYPES,
|
|
17
|
+
WAGES_CURRENCY,
|
|
18
|
+
WagesCurrency,
|
|
19
|
+
WageTypes,
|
|
20
|
+
WORK_MODE,
|
|
21
|
+
WorkMode,
|
|
22
22
|
} from "../constants";
|
|
23
23
|
|
|
24
24
|
const JobSectionEnum = z.enum(
|
|
25
|
-
|
|
25
|
+
Object.values(JOB_SECTIONS) as [string, ...string[]],
|
|
26
26
|
);
|
|
27
27
|
|
|
28
28
|
export const MinimalJobEntitySchema = z.object({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
id: z.cuid2(),
|
|
30
|
+
title: z.string(),
|
|
31
|
+
brandId: z.cuid2(),
|
|
32
|
+
jobType: z.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]]),
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
export const BaseJobEntitySchema = z.object({
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
createdAt: z.date(),
|
|
65
|
-
updatedAt: z.date(),
|
|
36
|
+
id: z.cuid2(),
|
|
37
|
+
title: z.string(),
|
|
38
|
+
brandId: z.cuid2(),
|
|
39
|
+
jobType: z.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]]),
|
|
40
|
+
employmentType: z
|
|
41
|
+
.enum(
|
|
42
|
+
Object.values(EMPLOYMENT_TYPE) as [EmploymentType, ...EmploymentType[]],
|
|
43
|
+
)
|
|
44
|
+
.optional(),
|
|
45
|
+
workMode: z.enum(Object.values(WORK_MODE) as [WorkMode, ...WorkMode[]]),
|
|
46
|
+
status: z.enum(Object.values(JOB_STATUS) as [JobStatus, ...JobStatus[]]),
|
|
47
|
+
gigType: z
|
|
48
|
+
.enum(Object.values(GIG_TYPE) as [GigType, ...GigType[]])
|
|
49
|
+
.optional(),
|
|
50
|
+
location: z.enum(
|
|
51
|
+
Object.values(JOB_LOCATIONS) as [JobLocation, ...JobLocation[]],
|
|
52
|
+
),
|
|
53
|
+
jobSections: z
|
|
54
|
+
.array(JobSectionEnum)
|
|
55
|
+
.default([
|
|
56
|
+
JOB_SECTIONS.PERSONAL_INFORMATION,
|
|
57
|
+
JOB_SECTIONS.PROFESSIONAL_INFORMATION,
|
|
58
|
+
JOB_SECTIONS.RESUME,
|
|
59
|
+
JOB_SECTIONS.COVER_LETTER,
|
|
60
|
+
]),
|
|
61
|
+
createdAt: z.date(),
|
|
62
|
+
version: z.int(),
|
|
63
|
+
updatedAt: z.date(),
|
|
66
64
|
});
|
|
67
65
|
|
|
68
66
|
export const JobIdSchema = z.object({
|
|
69
|
-
|
|
67
|
+
jobId: z.cuid2(),
|
|
70
68
|
});
|
|
71
69
|
|
|
72
70
|
export const JobEntitySchema = z.object({
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
createdAt: z.date(),
|
|
105
|
-
updatedAt: z.date(),
|
|
71
|
+
id: z.cuid2(),
|
|
72
|
+
title: z.string(),
|
|
73
|
+
brandId: z.cuid2(),
|
|
74
|
+
brandName: z.cuid2(),
|
|
75
|
+
brandImgUrl: z.cuid2().optional(),
|
|
76
|
+
jobType: z.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]]),
|
|
77
|
+
status: z.enum(Object.values(JOB_STATUS) as [JobStatus, ...JobStatus[]]),
|
|
78
|
+
employmentType: z
|
|
79
|
+
.enum(
|
|
80
|
+
Object.values(EMPLOYMENT_TYPE) as [EmploymentType, ...EmploymentType[]],
|
|
81
|
+
)
|
|
82
|
+
.optional(),
|
|
83
|
+
workMode: z.enum(Object.values(WORK_MODE) as [WorkMode, ...WorkMode[]]),
|
|
84
|
+
gigType: z
|
|
85
|
+
.enum(Object.values(GIG_TYPE) as [GigType, ...GigType[]])
|
|
86
|
+
.optional(),
|
|
87
|
+
location: z.enum(
|
|
88
|
+
Object.values(JOB_LOCATIONS) as [JobLocation, ...JobLocation[]],
|
|
89
|
+
),
|
|
90
|
+
jobSections: z
|
|
91
|
+
.array(JobSectionEnum)
|
|
92
|
+
.default([
|
|
93
|
+
JOB_SECTIONS.PERSONAL_INFORMATION,
|
|
94
|
+
JOB_SECTIONS.PROFESSIONAL_INFORMATION,
|
|
95
|
+
JOB_SECTIONS.RESUME,
|
|
96
|
+
JOB_SECTIONS.COVER_LETTER,
|
|
97
|
+
]),
|
|
98
|
+
isBookmarked: z.boolean(),
|
|
99
|
+
createdAt: z.date(),
|
|
100
|
+
version: z.int(),
|
|
101
|
+
updatedAt: z.date(),
|
|
106
102
|
});
|
|
107
103
|
|
|
108
104
|
export const GigJobEntitySchema = z.object({
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
.optional(),
|
|
126
|
-
wagesType: z
|
|
127
|
-
.enum(Object.values(WAGE_TYPES) as [WageTypes, ...WageTypes[]])
|
|
128
|
-
.optional(),
|
|
105
|
+
id: z.cuid2(),
|
|
106
|
+
jobType: z.literal(JOB_TYPE.GIG),
|
|
107
|
+
overview: z.string(),
|
|
108
|
+
deliverables: z.string(),
|
|
109
|
+
employeeRequirements: z.string().optional(),
|
|
110
|
+
aboutCompany: z.string().optional(),
|
|
111
|
+
requiredSkills: z.array(z.string()),
|
|
112
|
+
wagesMin: z.number().optional(),
|
|
113
|
+
wagesMax: z.number().optional(),
|
|
114
|
+
wagesCurrency: z
|
|
115
|
+
.enum(Object.values(WAGES_CURRENCY) as [WagesCurrency, ...WagesCurrency[]])
|
|
116
|
+
.optional(),
|
|
117
|
+
wagesType: z
|
|
118
|
+
.enum(Object.values(WAGE_TYPES) as [WageTypes, ...WageTypes[]])
|
|
119
|
+
.optional(),
|
|
120
|
+
version: z.int(),
|
|
129
121
|
});
|
|
130
122
|
|
|
131
123
|
export const JobWithGigDetailsEntitySchema = JobEntitySchema.extend(
|
|
132
|
-
|
|
124
|
+
GigJobEntitySchema.shape,
|
|
133
125
|
);
|
|
134
126
|
|
|
135
127
|
export const RoleJobEntitySchema = z.object({
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
...WagesCurrency[],
|
|
156
|
-
],
|
|
157
|
-
)
|
|
158
|
-
.optional(),
|
|
159
|
-
wagesType: z
|
|
160
|
-
.enum(Object.values(WAGE_TYPES) as [WageTypes, ...WageTypes[]])
|
|
161
|
-
.optional(),
|
|
128
|
+
id: z.cuid2(),
|
|
129
|
+
jobType: z.literal(JOB_TYPE.ROLE),
|
|
130
|
+
experienceLevel: z.enum(
|
|
131
|
+
Object.values(EXPERIENCE_LEVELS) as [ExperienceLevel, ...ExperienceLevel[]],
|
|
132
|
+
),
|
|
133
|
+
overview: z.string(),
|
|
134
|
+
keyResponsibilities: z.string(),
|
|
135
|
+
requiredSkills: z.array(z.string()),
|
|
136
|
+
employeeRequirements: z.string().optional(),
|
|
137
|
+
companyBenefits: z.string().optional(),
|
|
138
|
+
wagesMin: z.number().optional(),
|
|
139
|
+
wagesMax: z.number().optional(),
|
|
140
|
+
wagesCurrency: z
|
|
141
|
+
.enum(Object.values(WAGES_CURRENCY) as [WagesCurrency, ...WagesCurrency[]])
|
|
142
|
+
.optional(),
|
|
143
|
+
wagesType: z
|
|
144
|
+
.enum(Object.values(WAGE_TYPES) as [WageTypes, ...WageTypes[]])
|
|
145
|
+
.optional(),
|
|
146
|
+
version: z.int(),
|
|
162
147
|
});
|
|
163
148
|
|
|
164
149
|
export const JobWithRoleDetailsEntitySchema = JobEntitySchema.extend(
|
|
165
|
-
|
|
150
|
+
RoleJobEntitySchema.shape,
|
|
166
151
|
);
|
|
167
152
|
|
|
168
153
|
const CreateJobInputBaseSchema = z.object({
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
154
|
+
title: z.string(),
|
|
155
|
+
brandId: z.cuid2(),
|
|
156
|
+
jobType: z.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]]),
|
|
172
157
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
],
|
|
179
|
-
)
|
|
180
|
-
.optional(),
|
|
158
|
+
employmentType: z
|
|
159
|
+
.enum(
|
|
160
|
+
Object.values(EMPLOYMENT_TYPE) as [EmploymentType, ...EmploymentType[]],
|
|
161
|
+
)
|
|
162
|
+
.optional(),
|
|
181
163
|
|
|
182
|
-
|
|
164
|
+
workMode: z.enum(Object.values(WORK_MODE) as [WorkMode, ...WorkMode[]]),
|
|
183
165
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
166
|
+
gigType: z
|
|
167
|
+
.enum(Object.values(GIG_TYPE) as [GigType, ...GigType[]])
|
|
168
|
+
.optional(),
|
|
187
169
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
170
|
+
location: z
|
|
171
|
+
.enum(Object.values(JOB_LOCATIONS) as [JobLocation, ...JobLocation[]])
|
|
172
|
+
.default(JOB_LOCATIONS.REMOTE),
|
|
191
173
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
174
|
+
jobSections: z
|
|
175
|
+
.array(JobSectionEnum)
|
|
176
|
+
.min(1, { message: "At least one job section must be provided." }),
|
|
195
177
|
});
|
|
196
178
|
|
|
197
179
|
export const CreateJobInputSchema = CreateJobInputBaseSchema.superRefine(
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
if (data.jobType === JOB_TYPE.GIG && !data.gigType) {
|
|
208
|
-
ctx.addIssue({
|
|
209
|
-
path: ["gigType"],
|
|
210
|
-
code: "custom",
|
|
211
|
-
message: "gigType is required for GIG jobs",
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
).transform((data) => {
|
|
216
|
-
if (data.jobType === JOB_TYPE.ROLE) {
|
|
217
|
-
return { ...data, gigType: undefined };
|
|
180
|
+
(data, ctx) => {
|
|
181
|
+
if (data.jobType === JOB_TYPE.ROLE && !data.employmentType) {
|
|
182
|
+
ctx.addIssue({
|
|
183
|
+
path: ["employmentType"],
|
|
184
|
+
code: "custom",
|
|
185
|
+
message: "employmentType is required for ROLE jobs",
|
|
186
|
+
});
|
|
218
187
|
}
|
|
219
188
|
|
|
220
|
-
if (data.jobType === JOB_TYPE.GIG) {
|
|
221
|
-
|
|
189
|
+
if (data.jobType === JOB_TYPE.GIG && !data.gigType) {
|
|
190
|
+
ctx.addIssue({
|
|
191
|
+
path: ["gigType"],
|
|
192
|
+
code: "custom",
|
|
193
|
+
message: "gigType is required for GIG jobs",
|
|
194
|
+
});
|
|
222
195
|
}
|
|
196
|
+
},
|
|
197
|
+
).transform((data) => {
|
|
198
|
+
if (data.jobType === JOB_TYPE.ROLE) {
|
|
199
|
+
return { ...data, gigType: undefined };
|
|
200
|
+
}
|
|
223
201
|
|
|
224
|
-
|
|
202
|
+
if (data.jobType === JOB_TYPE.GIG) {
|
|
203
|
+
return { ...data, employmentType: undefined };
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return data;
|
|
225
207
|
});
|
|
226
208
|
|
|
227
209
|
export const CreateRoleJobInputSchema = z
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
{
|
|
261
|
-
message: "wagesMax must be greater than wagesMin",
|
|
262
|
-
path: ["wagesMax"],
|
|
263
|
-
},
|
|
264
|
-
);
|
|
210
|
+
.object({
|
|
211
|
+
id: z.cuid2(),
|
|
212
|
+
experienceLevel: z.enum(
|
|
213
|
+
Object.values(EXPERIENCE_LEVELS) as [
|
|
214
|
+
ExperienceLevel,
|
|
215
|
+
...ExperienceLevel[],
|
|
216
|
+
],
|
|
217
|
+
),
|
|
218
|
+
overview: z.string(),
|
|
219
|
+
keyResponsibilities: z.string(),
|
|
220
|
+
requiredSkills: z.array(z.string()),
|
|
221
|
+
employeeRequirements: z.string().optional(),
|
|
222
|
+
companyBenefits: z.string().optional(),
|
|
223
|
+
wagesMin: z.number().optional(),
|
|
224
|
+
wagesMax: z.number().optional(),
|
|
225
|
+
wagesCurrency: z
|
|
226
|
+
.enum(
|
|
227
|
+
Object.values(WAGES_CURRENCY) as [WagesCurrency, ...WagesCurrency[]],
|
|
228
|
+
)
|
|
229
|
+
.optional(),
|
|
230
|
+
wagesType: z
|
|
231
|
+
.enum(Object.values(WAGE_TYPES) as [WageTypes, ...WageTypes[]])
|
|
232
|
+
.optional(),
|
|
233
|
+
})
|
|
234
|
+
.refine(
|
|
235
|
+
({ wagesMin, wagesMax }) =>
|
|
236
|
+
wagesMin === undefined || wagesMax === undefined || wagesMax > wagesMin,
|
|
237
|
+
{
|
|
238
|
+
message: "wagesMax must be greater than wagesMin",
|
|
239
|
+
path: ["wagesMax"],
|
|
240
|
+
},
|
|
241
|
+
);
|
|
265
242
|
|
|
266
243
|
export const CreateGigJobInputSchema = z
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
{
|
|
294
|
-
message: "wagesMax must be greater than wagesMin",
|
|
295
|
-
path: ["wagesMax"],
|
|
296
|
-
},
|
|
297
|
-
);
|
|
244
|
+
.object({
|
|
245
|
+
id: z.cuid2(),
|
|
246
|
+
overview: z.string(),
|
|
247
|
+
deliverables: z.string(),
|
|
248
|
+
employeeRequirements: z.string().optional(),
|
|
249
|
+
aboutCompany: z.string().optional(),
|
|
250
|
+
requiredSkills: z.array(z.string()),
|
|
251
|
+
wagesMin: z.number().optional(),
|
|
252
|
+
wagesMax: z.number().optional(),
|
|
253
|
+
wagesCurrency: z
|
|
254
|
+
.enum(
|
|
255
|
+
Object.values(WAGES_CURRENCY) as [WagesCurrency, ...WagesCurrency[]],
|
|
256
|
+
)
|
|
257
|
+
.optional(),
|
|
258
|
+
wagesType: z
|
|
259
|
+
.enum(Object.values(WAGE_TYPES) as [WageTypes, ...WageTypes[]])
|
|
260
|
+
.optional(),
|
|
261
|
+
})
|
|
262
|
+
.refine(
|
|
263
|
+
({ wagesMin, wagesMax }) =>
|
|
264
|
+
wagesMin === undefined || wagesMax === undefined || wagesMax > wagesMin,
|
|
265
|
+
{
|
|
266
|
+
message: "wagesMax must be greater than wagesMin",
|
|
267
|
+
path: ["wagesMax"],
|
|
268
|
+
},
|
|
269
|
+
);
|
|
298
270
|
|
|
299
|
-
export const UpdateRoleJobInputSchema =
|
|
300
|
-
|
|
271
|
+
export const UpdateRoleJobInputSchema = CreateRoleJobInputSchema.partial()
|
|
272
|
+
.extend({ version: z.int() })
|
|
273
|
+
.required({ id: true });
|
|
301
274
|
|
|
302
|
-
export const UpdateGigJobInputSchema =
|
|
303
|
-
|
|
275
|
+
export const UpdateGigJobInputSchema = CreateGigJobInputSchema.partial()
|
|
276
|
+
.extend({ version: z.int() })
|
|
277
|
+
.required({ id: true });
|
|
304
278
|
|
|
305
279
|
export const UpdateJobInputSchema = CreateJobInputBaseSchema.partial().extend({
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
280
|
+
id: z.cuid2(),
|
|
281
|
+
status: z
|
|
282
|
+
.enum(Object.values(JOB_STATUS) as [JobStatus, ...JobStatus[]])
|
|
283
|
+
.optional(),
|
|
284
|
+
version: z.int(),
|
|
310
285
|
});
|
|
311
286
|
|
|
312
287
|
export const NormalizedJobSchema = z.union([
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
288
|
+
JobWithGigDetailsEntitySchema,
|
|
289
|
+
JobEntitySchema,
|
|
290
|
+
JobWithRoleDetailsEntitySchema,
|
|
316
291
|
]);
|
|
317
292
|
|
|
318
293
|
export const GetCreatedJobsOutputSchema = z.object({
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
294
|
+
jobs: z.array(NormalizedJobSchema),
|
|
295
|
+
noOfJobs: z.number(),
|
|
296
|
+
noOfActiveJobs: z.number(),
|
|
297
|
+
noOfArchivedJobs: z.number(),
|
|
323
298
|
});
|
|
324
299
|
|
|
325
300
|
export const GetJobsInputSchema = z.object({
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
.string()
|
|
349
|
-
.optional()
|
|
350
|
-
.describe("Comma-separated: React,Node.js"),
|
|
301
|
+
q: z.string().optional(),
|
|
302
|
+
jobType: z
|
|
303
|
+
.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]])
|
|
304
|
+
.optional(),
|
|
305
|
+
workMode: z
|
|
306
|
+
.enum(Object.values(WORK_MODE) as [WorkMode, ...WorkMode[]])
|
|
307
|
+
.optional(),
|
|
308
|
+
location: z
|
|
309
|
+
.enum(Object.values(JOB_LOCATIONS) as [JobLocation, ...JobLocation[]])
|
|
310
|
+
.optional(),
|
|
311
|
+
employmentType: z
|
|
312
|
+
.enum(
|
|
313
|
+
Object.values(EMPLOYMENT_TYPE) as [EmploymentType, ...EmploymentType[]],
|
|
314
|
+
)
|
|
315
|
+
.optional(),
|
|
316
|
+
gigType: z
|
|
317
|
+
.enum(Object.values(GIG_TYPE) as [GigType, ...GigType[]])
|
|
318
|
+
.optional(),
|
|
319
|
+
requiredSkills: z
|
|
320
|
+
.string()
|
|
321
|
+
.optional()
|
|
322
|
+
.describe("Comma-separated: React,Node.js"),
|
|
351
323
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
324
|
+
status: z.string().optional(),
|
|
325
|
+
page: z.coerce.number().min(1).default(1),
|
|
326
|
+
limit: z.coerce.number().min(1).max(100).default(20),
|
|
355
327
|
});
|
|
356
328
|
|
|
357
329
|
export const GetJobsOutputSchema = z.object({
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
330
|
+
jobs: z.array(NormalizedJobSchema),
|
|
331
|
+
total: z.number(),
|
|
332
|
+
page: z.number(),
|
|
333
|
+
totalPages: z.number(),
|
|
334
|
+
hasNextPage: z.boolean(),
|
|
335
|
+
hasPrevPage: z.boolean(),
|
|
364
336
|
});
|