@zyacreatives/shared 1.9.92 → 1.9.93
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.d.ts +161 -4
- package/dist/schemas/job.js +27 -4
- package/dist/types/job.d.ts +12 -3
- package/package.json +1 -1
- package/src/schemas/job.ts +33 -3
- package/src/types/job.ts +30 -10
package/dist/schemas/job.d.ts
CHANGED
|
@@ -1,4 +1,40 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
export declare const BaseJobEntitySchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodCUID2;
|
|
4
|
+
title: z.ZodString;
|
|
5
|
+
brandId: z.ZodCUID2;
|
|
6
|
+
jobType: z.ZodEnum<{
|
|
7
|
+
[x: string]: string;
|
|
8
|
+
}>;
|
|
9
|
+
employmentType: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
[x: string]: string;
|
|
11
|
+
}>>;
|
|
12
|
+
workMode: z.ZodEnum<{
|
|
13
|
+
[x: string]: string;
|
|
14
|
+
}>;
|
|
15
|
+
gigType: z.ZodOptional<z.ZodEnum<{
|
|
16
|
+
[x: string]: string;
|
|
17
|
+
}>>;
|
|
18
|
+
location: z.ZodEnum<{
|
|
19
|
+
Africa: "Africa";
|
|
20
|
+
Asia: "Asia";
|
|
21
|
+
Europe: "Europe";
|
|
22
|
+
"North America": "North America";
|
|
23
|
+
"South America": "South America";
|
|
24
|
+
"Middle East": "Middle East";
|
|
25
|
+
Oceania: "Oceania";
|
|
26
|
+
Global: "Global";
|
|
27
|
+
Other: "Other";
|
|
28
|
+
Remote: "Remote";
|
|
29
|
+
EMEA: "EMEA";
|
|
30
|
+
"Asia Pacific": "Asia Pacific";
|
|
31
|
+
}>;
|
|
32
|
+
createdAt: z.ZodDate;
|
|
33
|
+
updatedAt: z.ZodDate;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export declare const JobIdSchema: z.ZodObject<{
|
|
36
|
+
jobId: z.ZodCUID2;
|
|
37
|
+
}, z.core.$strip>;
|
|
2
38
|
export declare const JobEntitySchema: z.ZodObject<{
|
|
3
39
|
id: z.ZodCUID2;
|
|
4
40
|
title: z.ZodString;
|
|
@@ -92,7 +128,7 @@ export declare const GigJobEntitySchema: z.ZodObject<{
|
|
|
92
128
|
}>>;
|
|
93
129
|
jobSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
94
130
|
}, z.core.$strip>;
|
|
95
|
-
export declare const
|
|
131
|
+
export declare const GetJobWithGigDetailsOutputSchema: z.ZodObject<{
|
|
96
132
|
title: z.ZodString;
|
|
97
133
|
brandId: z.ZodCUID2;
|
|
98
134
|
brandName: z.ZodCUID2;
|
|
@@ -151,7 +187,6 @@ export declare const JobWithGigDetailsEntitySchema: z.ZodObject<{
|
|
|
151
187
|
jobSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
152
188
|
}, z.core.$strip>;
|
|
153
189
|
export declare const RoleJobEntitySchema: z.ZodObject<{
|
|
154
|
-
id: z.ZodCUID2;
|
|
155
190
|
title: z.ZodString;
|
|
156
191
|
brandId: z.ZodCUID2;
|
|
157
192
|
brandName: z.ZodCUID2;
|
|
@@ -175,6 +210,7 @@ export declare const RoleJobEntitySchema: z.ZodObject<{
|
|
|
175
210
|
}>;
|
|
176
211
|
createdAt: z.ZodDate;
|
|
177
212
|
updatedAt: z.ZodDate;
|
|
213
|
+
id: z.ZodCUID2;
|
|
178
214
|
jobType: z.ZodLiteral<string>;
|
|
179
215
|
gigType: z.ZodNull;
|
|
180
216
|
employmentType: z.ZodEnum<{
|
|
@@ -214,8 +250,7 @@ export declare const RoleJobEntitySchema: z.ZodObject<{
|
|
|
214
250
|
}>>;
|
|
215
251
|
jobSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
216
252
|
}, z.core.$strip>;
|
|
217
|
-
export declare const
|
|
218
|
-
id: z.ZodCUID2;
|
|
253
|
+
export declare const GetJobWithRoleDetailsOutputSchema: z.ZodObject<{
|
|
219
254
|
title: z.ZodString;
|
|
220
255
|
brandId: z.ZodCUID2;
|
|
221
256
|
brandName: z.ZodCUID2;
|
|
@@ -239,6 +274,7 @@ export declare const JobWithRoleDetailsEntitySchema: z.ZodObject<{
|
|
|
239
274
|
}>;
|
|
240
275
|
createdAt: z.ZodDate;
|
|
241
276
|
updatedAt: z.ZodDate;
|
|
277
|
+
id: z.ZodCUID2;
|
|
242
278
|
jobType: z.ZodLiteral<string>;
|
|
243
279
|
gigType: z.ZodNull;
|
|
244
280
|
employmentType: z.ZodEnum<{
|
|
@@ -475,3 +511,124 @@ export declare const UpdateJobInputSchema: z.ZodObject<{
|
|
|
475
511
|
}>>>>;
|
|
476
512
|
id: z.ZodCUID2;
|
|
477
513
|
}, z.core.$strip>;
|
|
514
|
+
export declare const NormalizedJobOutputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
515
|
+
title: z.ZodString;
|
|
516
|
+
brandId: z.ZodCUID2;
|
|
517
|
+
brandName: z.ZodCUID2;
|
|
518
|
+
brandImgUrl: z.ZodOptional<z.ZodCUID2>;
|
|
519
|
+
workMode: z.ZodEnum<{
|
|
520
|
+
[x: string]: string;
|
|
521
|
+
}>;
|
|
522
|
+
location: z.ZodEnum<{
|
|
523
|
+
Africa: "Africa";
|
|
524
|
+
Asia: "Asia";
|
|
525
|
+
Europe: "Europe";
|
|
526
|
+
"North America": "North America";
|
|
527
|
+
"South America": "South America";
|
|
528
|
+
"Middle East": "Middle East";
|
|
529
|
+
Oceania: "Oceania";
|
|
530
|
+
Global: "Global";
|
|
531
|
+
Other: "Other";
|
|
532
|
+
Remote: "Remote";
|
|
533
|
+
EMEA: "EMEA";
|
|
534
|
+
"Asia Pacific": "Asia Pacific";
|
|
535
|
+
}>;
|
|
536
|
+
createdAt: z.ZodDate;
|
|
537
|
+
updatedAt: z.ZodDate;
|
|
538
|
+
id: z.ZodCUID2;
|
|
539
|
+
jobType: z.ZodLiteral<string>;
|
|
540
|
+
employmentType: z.ZodNull;
|
|
541
|
+
gigType: z.ZodEnum<{
|
|
542
|
+
[x: string]: string;
|
|
543
|
+
}>;
|
|
544
|
+
overview: z.ZodString;
|
|
545
|
+
deliverables: z.ZodArray<z.ZodString>;
|
|
546
|
+
employeeRequirements: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
547
|
+
aboutCompany: z.ZodOptional<z.ZodString>;
|
|
548
|
+
requiredSkills: z.ZodArray<z.ZodString>;
|
|
549
|
+
wagesMin: z.ZodOptional<z.ZodNumber>;
|
|
550
|
+
wagesMax: z.ZodOptional<z.ZodNumber>;
|
|
551
|
+
wagesCurrency: z.ZodOptional<z.ZodEnum<{
|
|
552
|
+
USD: "USD";
|
|
553
|
+
EUR: "EUR";
|
|
554
|
+
GBP: "GBP";
|
|
555
|
+
NGN: "NGN";
|
|
556
|
+
CAD: "CAD";
|
|
557
|
+
AUD: "AUD";
|
|
558
|
+
JPY: "JPY";
|
|
559
|
+
CHF: "CHF";
|
|
560
|
+
INR: "INR";
|
|
561
|
+
ZAR: "ZAR";
|
|
562
|
+
}>>;
|
|
563
|
+
wagesType: z.ZodOptional<z.ZodEnum<{
|
|
564
|
+
HOURLY: "HOURLY";
|
|
565
|
+
DAILY: "DAILY";
|
|
566
|
+
WEEKLY: "WEEKLY";
|
|
567
|
+
MONTHLY: "MONTHLY";
|
|
568
|
+
PROJECT_BASED: "PROJECT_BASED";
|
|
569
|
+
}>>;
|
|
570
|
+
jobSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
571
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
572
|
+
title: z.ZodString;
|
|
573
|
+
brandId: z.ZodCUID2;
|
|
574
|
+
brandName: z.ZodCUID2;
|
|
575
|
+
brandImgUrl: z.ZodOptional<z.ZodCUID2>;
|
|
576
|
+
workMode: z.ZodEnum<{
|
|
577
|
+
[x: string]: string;
|
|
578
|
+
}>;
|
|
579
|
+
location: z.ZodEnum<{
|
|
580
|
+
Africa: "Africa";
|
|
581
|
+
Asia: "Asia";
|
|
582
|
+
Europe: "Europe";
|
|
583
|
+
"North America": "North America";
|
|
584
|
+
"South America": "South America";
|
|
585
|
+
"Middle East": "Middle East";
|
|
586
|
+
Oceania: "Oceania";
|
|
587
|
+
Global: "Global";
|
|
588
|
+
Other: "Other";
|
|
589
|
+
Remote: "Remote";
|
|
590
|
+
EMEA: "EMEA";
|
|
591
|
+
"Asia Pacific": "Asia Pacific";
|
|
592
|
+
}>;
|
|
593
|
+
createdAt: z.ZodDate;
|
|
594
|
+
updatedAt: z.ZodDate;
|
|
595
|
+
id: z.ZodCUID2;
|
|
596
|
+
jobType: z.ZodLiteral<string>;
|
|
597
|
+
gigType: z.ZodNull;
|
|
598
|
+
employmentType: z.ZodEnum<{
|
|
599
|
+
[x: string]: string;
|
|
600
|
+
}>;
|
|
601
|
+
experienceLevel: z.ZodEnum<{
|
|
602
|
+
"0-1 year": "0-1 year";
|
|
603
|
+
"1-3 years": "1-3 years";
|
|
604
|
+
"3-5 years": "3-5 years";
|
|
605
|
+
"5+ years": "5+ years";
|
|
606
|
+
}>;
|
|
607
|
+
overview: z.ZodString;
|
|
608
|
+
keyResponsibilities: z.ZodArray<z.ZodString>;
|
|
609
|
+
requiredSkills: z.ZodArray<z.ZodString>;
|
|
610
|
+
employeeRequirements: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
611
|
+
companyBenefits: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
612
|
+
wagesMin: z.ZodOptional<z.ZodNumber>;
|
|
613
|
+
wagesMax: z.ZodOptional<z.ZodNumber>;
|
|
614
|
+
wagesCurrency: z.ZodOptional<z.ZodEnum<{
|
|
615
|
+
USD: "USD";
|
|
616
|
+
EUR: "EUR";
|
|
617
|
+
GBP: "GBP";
|
|
618
|
+
NGN: "NGN";
|
|
619
|
+
CAD: "CAD";
|
|
620
|
+
AUD: "AUD";
|
|
621
|
+
JPY: "JPY";
|
|
622
|
+
CHF: "CHF";
|
|
623
|
+
INR: "INR";
|
|
624
|
+
ZAR: "ZAR";
|
|
625
|
+
}>>;
|
|
626
|
+
wagesType: z.ZodOptional<z.ZodEnum<{
|
|
627
|
+
HOURLY: "HOURLY";
|
|
628
|
+
DAILY: "DAILY";
|
|
629
|
+
WEEKLY: "WEEKLY";
|
|
630
|
+
MONTHLY: "MONTHLY";
|
|
631
|
+
PROJECT_BASED: "PROJECT_BASED";
|
|
632
|
+
}>>;
|
|
633
|
+
jobSections: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
634
|
+
}, z.core.$strip>], "jobType">;
|
package/dist/schemas/job.js
CHANGED
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UpdateJobInputSchema = exports.UpdateGigJobInputSchema = exports.UpdateRoleJobInputSchema = exports.CreateGigJobInputSchema = exports.CreateRoleJobInputSchema = exports.CreateJobInputSchema = exports.
|
|
3
|
+
exports.NormalizedJobOutputSchema = exports.UpdateJobInputSchema = exports.UpdateGigJobInputSchema = exports.UpdateRoleJobInputSchema = exports.CreateGigJobInputSchema = exports.CreateRoleJobInputSchema = exports.CreateJobInputSchema = exports.GetJobWithRoleDetailsOutputSchema = exports.RoleJobEntitySchema = exports.GetJobWithGigDetailsOutputSchema = exports.GigJobEntitySchema = exports.JobEntitySchema = exports.JobIdSchema = exports.BaseJobEntitySchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
|
+
exports.BaseJobEntitySchema = zod_1.z.object({
|
|
7
|
+
id: zod_1.z.cuid2(),
|
|
8
|
+
title: zod_1.z.string(),
|
|
9
|
+
brandId: zod_1.z.cuid2(),
|
|
10
|
+
jobType: zod_1.z.enum(Object.values(constants_1.JOB_TYPE)),
|
|
11
|
+
employmentType: zod_1.z
|
|
12
|
+
.enum(Object.values(constants_1.EMPLOYMENT_TYPE))
|
|
13
|
+
.optional(),
|
|
14
|
+
workMode: zod_1.z.enum(Object.values(constants_1.WORK_MODE)),
|
|
15
|
+
gigType: zod_1.z
|
|
16
|
+
.enum(Object.values(constants_1.GIG_TYPE))
|
|
17
|
+
.optional(),
|
|
18
|
+
location: zod_1.z.enum(Object.values(constants_1.JOB_LOCATIONS)),
|
|
19
|
+
createdAt: zod_1.z.date(),
|
|
20
|
+
updatedAt: zod_1.z.date(),
|
|
21
|
+
});
|
|
22
|
+
exports.JobIdSchema = zod_1.z.object({
|
|
23
|
+
jobId: zod_1.z.cuid2(),
|
|
24
|
+
});
|
|
6
25
|
exports.JobEntitySchema = zod_1.z.object({
|
|
7
26
|
id: zod_1.z.cuid2(),
|
|
8
27
|
title: zod_1.z.string(),
|
|
@@ -43,8 +62,9 @@ exports.GigJobEntitySchema = exports.JobEntitySchema.extend({
|
|
|
43
62
|
.array(zod_1.z.string())
|
|
44
63
|
.default(["PERSONAL_INFORMATION", "PROFESSIONAL_INFORMATION", "RESUME"]),
|
|
45
64
|
});
|
|
46
|
-
exports.
|
|
65
|
+
exports.GetJobWithGigDetailsOutputSchema = exports.JobEntitySchema.extend(exports.GigJobEntitySchema.shape);
|
|
47
66
|
exports.RoleJobEntitySchema = exports.JobEntitySchema.extend({
|
|
67
|
+
id: zod_1.z.cuid2(),
|
|
48
68
|
jobType: zod_1.z.literal(constants_1.JOB_TYPE.ROLE),
|
|
49
69
|
gigType: zod_1.z.null(), // enforce null for ROLE
|
|
50
70
|
employmentType: zod_1.z.enum(Object.values(constants_1.EMPLOYMENT_TYPE)),
|
|
@@ -66,13 +86,12 @@ exports.RoleJobEntitySchema = exports.JobEntitySchema.extend({
|
|
|
66
86
|
.array(zod_1.z.string())
|
|
67
87
|
.default(["PERSONAL_INFORMATION", "PROFESSIONAL_INFORMATION", "RESUME"]),
|
|
68
88
|
});
|
|
69
|
-
exports.
|
|
89
|
+
exports.GetJobWithRoleDetailsOutputSchema = exports.JobEntitySchema.extend(exports.RoleJobEntitySchema.shape);
|
|
70
90
|
exports.CreateJobInputSchema = zod_1.z
|
|
71
91
|
.object({
|
|
72
92
|
title: zod_1.z.string(),
|
|
73
93
|
brandId: zod_1.z.cuid2(),
|
|
74
94
|
jobType: zod_1.z.enum(Object.values(constants_1.JOB_TYPE)),
|
|
75
|
-
// status: z.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]]),
|
|
76
95
|
employmentType: zod_1.z
|
|
77
96
|
.enum(Object.values(constants_1.EMPLOYMENT_TYPE))
|
|
78
97
|
.optional(),
|
|
@@ -186,3 +205,7 @@ exports.UpdateGigJobInputSchema = exports.CreateGigJobInputSchema.partial().exte
|
|
|
186
205
|
exports.UpdateJobInputSchema = exports.CreateJobInputSchema.partial().extend({
|
|
187
206
|
id: zod_1.z.cuid2(),
|
|
188
207
|
});
|
|
208
|
+
exports.NormalizedJobOutputSchema = zod_1.z.discriminatedUnion("jobType", [
|
|
209
|
+
exports.GetJobWithGigDetailsOutputSchema,
|
|
210
|
+
exports.GetJobWithRoleDetailsOutputSchema,
|
|
211
|
+
]);
|
package/dist/types/job.d.ts
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { JobEntitySchema, GigJobEntitySchema, RoleJobEntitySchema, CreateJobInputSchema, CreateRoleJobInputSchema, CreateGigJobInputSchema, UpdateRoleJobInputSchema, UpdateGigJobInputSchema, UpdateJobInputSchema,
|
|
2
|
+
import { JobEntitySchema, GigJobEntitySchema, RoleJobEntitySchema, CreateJobInputSchema, CreateRoleJobInputSchema, CreateGigJobInputSchema, UpdateRoleJobInputSchema, UpdateGigJobInputSchema, UpdateJobInputSchema, GetJobWithGigDetailsOutputSchema, GetJobWithRoleDetailsOutputSchema, BaseJobEntitySchema, JobIdSchema } from "../schemas/job";
|
|
3
|
+
export type BaseJobEntity = z.infer<typeof BaseJobEntitySchema>;
|
|
4
|
+
export type JobIdInput = z.infer<typeof JobIdSchema>;
|
|
3
5
|
export type JobEntity = z.infer<typeof JobEntitySchema>;
|
|
4
6
|
export type GigJobEntity = z.infer<typeof GigJobEntitySchema>;
|
|
5
7
|
export type RoleJobEntity = z.infer<typeof RoleJobEntitySchema>;
|
|
6
|
-
export type JobWithGigDetailsEntity = z.infer<typeof JobWithGigDetailsEntitySchema>;
|
|
7
|
-
export type JobWithRoleDetailsEntity = z.infer<typeof JobWithRoleDetailsEntitySchema>;
|
|
8
8
|
export type CreateJobInput = z.infer<typeof CreateJobInputSchema>;
|
|
9
|
+
export type CreateJobOutput = z.infer<typeof BaseJobEntitySchema>;
|
|
9
10
|
export type CreateRoleJobInput = z.infer<typeof CreateRoleJobInputSchema>;
|
|
11
|
+
export type CreateRoleJobOutput = z.infer<typeof RoleJobEntitySchema>;
|
|
10
12
|
export type CreateGigJobInput = z.infer<typeof CreateGigJobInputSchema>;
|
|
13
|
+
export type CreateGigJobOutput = z.infer<typeof GigJobEntitySchema>;
|
|
11
14
|
export type UpdateRoleJobInput = z.infer<typeof UpdateRoleJobInputSchema>;
|
|
15
|
+
export type UpdateRoleJobOutput = z.infer<typeof RoleJobEntitySchema>;
|
|
12
16
|
export type UpdateGigJobInput = z.infer<typeof UpdateGigJobInputSchema>;
|
|
17
|
+
export type UpdateGigJobOutput = z.infer<typeof GigJobEntitySchema>;
|
|
13
18
|
export type UpdateJobInput = z.infer<typeof UpdateJobInputSchema>;
|
|
19
|
+
export type UpdateJobOutput = z.infer<typeof BaseJobEntitySchema>;
|
|
20
|
+
export type GetJobOutput = z.infer<typeof BaseJobEntitySchema>;
|
|
21
|
+
export type GetJobWithGigDetailsOutput = z.infer<typeof GetJobWithGigDetailsOutputSchema>;
|
|
22
|
+
export type GetJobWithRoleDetailsOutput = z.infer<typeof GetJobWithRoleDetailsOutputSchema>;
|
package/package.json
CHANGED
package/src/schemas/job.ts
CHANGED
|
@@ -21,6 +21,31 @@ import {
|
|
|
21
21
|
WorkMode,
|
|
22
22
|
} from "../constants";
|
|
23
23
|
|
|
24
|
+
export const BaseJobEntitySchema = z.object({
|
|
25
|
+
id: z.cuid2(),
|
|
26
|
+
title: z.string(),
|
|
27
|
+
brandId: z.cuid2(),
|
|
28
|
+
jobType: z.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]]),
|
|
29
|
+
employmentType: z
|
|
30
|
+
.enum(
|
|
31
|
+
Object.values(EMPLOYMENT_TYPE) as [EmploymentType, ...EmploymentType[]]
|
|
32
|
+
)
|
|
33
|
+
.optional(),
|
|
34
|
+
workMode: z.enum(Object.values(WORK_MODE) as [WorkMode, ...WorkMode[]]),
|
|
35
|
+
gigType: z
|
|
36
|
+
.enum(Object.values(GIG_TYPE) as [GigType, ...GigType[]])
|
|
37
|
+
.optional(),
|
|
38
|
+
location: z.enum(
|
|
39
|
+
Object.values(JOB_LOCATIONS) as [JobLocation, ...JobLocation[]]
|
|
40
|
+
),
|
|
41
|
+
createdAt: z.date(),
|
|
42
|
+
updatedAt: z.date(),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export const JobIdSchema = z.object({
|
|
46
|
+
jobId: z.cuid2(),
|
|
47
|
+
});
|
|
48
|
+
|
|
24
49
|
export const JobEntitySchema = z.object({
|
|
25
50
|
id: z.cuid2(),
|
|
26
51
|
title: z.string(),
|
|
@@ -67,11 +92,12 @@ export const GigJobEntitySchema = JobEntitySchema.extend({
|
|
|
67
92
|
.default(["PERSONAL_INFORMATION", "PROFESSIONAL_INFORMATION", "RESUME"]),
|
|
68
93
|
});
|
|
69
94
|
|
|
70
|
-
export const
|
|
95
|
+
export const GetJobWithGigDetailsOutputSchema = JobEntitySchema.extend(
|
|
71
96
|
GigJobEntitySchema.shape
|
|
72
97
|
);
|
|
73
98
|
|
|
74
99
|
export const RoleJobEntitySchema = JobEntitySchema.extend({
|
|
100
|
+
id: z.cuid2(),
|
|
75
101
|
jobType: z.literal(JOB_TYPE.ROLE),
|
|
76
102
|
gigType: z.null(), // enforce null for ROLE
|
|
77
103
|
employmentType: z.enum(
|
|
@@ -98,7 +124,7 @@ export const RoleJobEntitySchema = JobEntitySchema.extend({
|
|
|
98
124
|
.default(["PERSONAL_INFORMATION", "PROFESSIONAL_INFORMATION", "RESUME"]),
|
|
99
125
|
});
|
|
100
126
|
|
|
101
|
-
export const
|
|
127
|
+
export const GetJobWithRoleDetailsOutputSchema = JobEntitySchema.extend(
|
|
102
128
|
RoleJobEntitySchema.shape
|
|
103
129
|
);
|
|
104
130
|
|
|
@@ -107,7 +133,6 @@ export const CreateJobInputSchema = z
|
|
|
107
133
|
title: z.string(),
|
|
108
134
|
brandId: z.cuid2(),
|
|
109
135
|
jobType: z.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]]),
|
|
110
|
-
// status: z.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]]),
|
|
111
136
|
employmentType: z
|
|
112
137
|
.enum(
|
|
113
138
|
Object.values(EMPLOYMENT_TYPE) as [EmploymentType, ...EmploymentType[]]
|
|
@@ -249,3 +274,8 @@ export const UpdateGigJobInputSchema = CreateGigJobInputSchema.partial().extend(
|
|
|
249
274
|
export const UpdateJobInputSchema = CreateJobInputSchema.partial().extend({
|
|
250
275
|
id: z.cuid2(),
|
|
251
276
|
});
|
|
277
|
+
|
|
278
|
+
export const NormalizedJobOutputSchema = z.discriminatedUnion("jobType", [
|
|
279
|
+
GetJobWithGigDetailsOutputSchema,
|
|
280
|
+
GetJobWithRoleDetailsOutputSchema,
|
|
281
|
+
]);
|
package/src/types/job.ts
CHANGED
|
@@ -9,32 +9,52 @@ import {
|
|
|
9
9
|
UpdateRoleJobInputSchema,
|
|
10
10
|
UpdateGigJobInputSchema,
|
|
11
11
|
UpdateJobInputSchema,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
GetJobWithGigDetailsOutputSchema,
|
|
13
|
+
GetJobWithRoleDetailsOutputSchema,
|
|
14
|
+
BaseJobEntitySchema,
|
|
15
|
+
JobIdSchema,
|
|
14
16
|
} from "../schemas/job";
|
|
15
17
|
|
|
18
|
+
export type BaseJobEntity = z.infer<typeof BaseJobEntitySchema>;
|
|
19
|
+
|
|
20
|
+
export type JobIdInput = z.infer<typeof JobIdSchema>;
|
|
21
|
+
|
|
16
22
|
export type JobEntity = z.infer<typeof JobEntitySchema>;
|
|
17
23
|
|
|
18
24
|
export type GigJobEntity = z.infer<typeof GigJobEntitySchema>;
|
|
19
25
|
|
|
20
26
|
export type RoleJobEntity = z.infer<typeof RoleJobEntitySchema>;
|
|
21
27
|
|
|
22
|
-
export type JobWithGigDetailsEntity = z.infer<
|
|
23
|
-
typeof JobWithGigDetailsEntitySchema
|
|
24
|
-
>;
|
|
25
|
-
|
|
26
|
-
export type JobWithRoleDetailsEntity = z.infer<
|
|
27
|
-
typeof JobWithRoleDetailsEntitySchema
|
|
28
|
-
>;
|
|
29
|
-
|
|
30
28
|
export type CreateJobInput = z.infer<typeof CreateJobInputSchema>;
|
|
31
29
|
|
|
30
|
+
export type CreateJobOutput = z.infer<typeof BaseJobEntitySchema>;
|
|
31
|
+
|
|
32
32
|
export type CreateRoleJobInput = z.infer<typeof CreateRoleJobInputSchema>;
|
|
33
33
|
|
|
34
|
+
export type CreateRoleJobOutput = z.infer<typeof RoleJobEntitySchema>;
|
|
35
|
+
|
|
34
36
|
export type CreateGigJobInput = z.infer<typeof CreateGigJobInputSchema>;
|
|
35
37
|
|
|
38
|
+
export type CreateGigJobOutput = z.infer<typeof GigJobEntitySchema>;
|
|
39
|
+
|
|
36
40
|
export type UpdateRoleJobInput = z.infer<typeof UpdateRoleJobInputSchema>;
|
|
37
41
|
|
|
42
|
+
export type UpdateRoleJobOutput = z.infer<typeof RoleJobEntitySchema>;
|
|
43
|
+
|
|
38
44
|
export type UpdateGigJobInput = z.infer<typeof UpdateGigJobInputSchema>;
|
|
39
45
|
|
|
46
|
+
export type UpdateGigJobOutput = z.infer<typeof GigJobEntitySchema>;
|
|
47
|
+
|
|
40
48
|
export type UpdateJobInput = z.infer<typeof UpdateJobInputSchema>;
|
|
49
|
+
|
|
50
|
+
export type UpdateJobOutput = z.infer<typeof BaseJobEntitySchema>;
|
|
51
|
+
|
|
52
|
+
export type GetJobOutput = z.infer<typeof BaseJobEntitySchema>;
|
|
53
|
+
|
|
54
|
+
export type GetJobWithGigDetailsOutput = z.infer<
|
|
55
|
+
typeof GetJobWithGigDetailsOutputSchema
|
|
56
|
+
>;
|
|
57
|
+
|
|
58
|
+
export type GetJobWithRoleDetailsOutput = z.infer<
|
|
59
|
+
typeof GetJobWithRoleDetailsOutputSchema
|
|
60
|
+
>;
|