@zyacreatives/shared 1.9.5 → 1.9.7
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/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/job-application.d.ts +34 -1
- package/dist/schemas/job-application.js +22 -0
- package/dist/schemas/job.d.ts +145 -21
- package/dist/schemas/job.js +58 -15
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/job-application.d.ts +1 -1
- package/dist/types/job.d.ts +11 -0
- package/dist/types/job.js +2 -0
- package/package.json +1 -1
- package/src/schemas/index.ts +1 -0
- package/src/schemas/job-application.ts +33 -0
- package/src/schemas/job.ts +65 -19
- package/src/types/index.ts +2 -1
- package/src/types/job-application.ts +1 -1
- package/src/types/job.ts +30 -0
package/dist/schemas/index.d.ts
CHANGED
package/dist/schemas/index.js
CHANGED
|
@@ -1 +1,34 @@
|
|
|
1
|
-
|
|
1
|
+
import z from "zod";
|
|
2
|
+
export declare const CreateJobApplicationInputSchema: z.ZodObject<{
|
|
3
|
+
firstName: z.ZodString;
|
|
4
|
+
lastName: z.ZodString;
|
|
5
|
+
emailAddress: z.ZodEmail;
|
|
6
|
+
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
7
|
+
currentRole: z.ZodString;
|
|
8
|
+
experienceLevel: z.ZodEnum<{
|
|
9
|
+
"0-1 year": "0-1 year";
|
|
10
|
+
"1-3 years": "1-3 years";
|
|
11
|
+
"3-5 years": "3-5 years";
|
|
12
|
+
"5+ years": "5+ years";
|
|
13
|
+
}>;
|
|
14
|
+
resumeUrl: z.ZodURL;
|
|
15
|
+
workSampleUrls: z.ZodOptional<z.ZodArray<z.ZodURL>>;
|
|
16
|
+
portfolioUrl: z.ZodOptional<z.ZodURL>;
|
|
17
|
+
coverLetterUrl: z.ZodOptional<z.ZodURL>;
|
|
18
|
+
receiveEmailUpdates: z.ZodBoolean;
|
|
19
|
+
wagesAmount: z.ZodString;
|
|
20
|
+
wagesType: z.ZodEnum<{
|
|
21
|
+
HOURLY: "HOURLY";
|
|
22
|
+
DAILY: "DAILY";
|
|
23
|
+
WEEKLY: "WEEKLY";
|
|
24
|
+
MONTHLY: "MONTHLY";
|
|
25
|
+
PROJECT_BASED: "PROJECT_BASED";
|
|
26
|
+
}>;
|
|
27
|
+
availability: z.ZodEnum<{
|
|
28
|
+
FULL_TIME: "FULL_TIME";
|
|
29
|
+
PART_TIME: "PART_TIME";
|
|
30
|
+
FREELANCE: "FREELANCE";
|
|
31
|
+
INTERNSHIP: "INTERNSHIP";
|
|
32
|
+
CONTRACT: "CONTRACT";
|
|
33
|
+
}>;
|
|
34
|
+
}, z.core.$strip>;
|
|
@@ -1,2 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CreateJobApplicationInputSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
const constants_1 = require("../constants");
|
|
9
|
+
exports.CreateJobApplicationInputSchema = zod_1.default.object({
|
|
10
|
+
firstName: zod_1.default.string(),
|
|
11
|
+
lastName: zod_1.default.string(),
|
|
12
|
+
emailAddress: zod_1.default.email(),
|
|
13
|
+
phoneNumber: zod_1.default.string().optional(),
|
|
14
|
+
currentRole: zod_1.default.string(),
|
|
15
|
+
experienceLevel: zod_1.default.enum(Object.values(constants_1.EXPERIENCE_LEVELS)),
|
|
16
|
+
resumeUrl: zod_1.default.url(),
|
|
17
|
+
workSampleUrls: zod_1.default.array(zod_1.default.url()).optional(),
|
|
18
|
+
portfolioUrl: zod_1.default.url().optional(),
|
|
19
|
+
coverLetterUrl: zod_1.default.url().optional(),
|
|
20
|
+
receiveEmailUpdates: zod_1.default.boolean(),
|
|
21
|
+
wagesAmount: zod_1.default.string(),
|
|
22
|
+
wagesType: zod_1.default.enum(Object.values(constants_1.WAGE_TYPES)),
|
|
23
|
+
availability: zod_1.default.enum(Object.values(constants_1.JOB_AVAILABILITY_TYPES)),
|
|
24
|
+
});
|
package/dist/schemas/job.d.ts
CHANGED
|
@@ -1,39 +1,162 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
export declare const JobEntitySchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodCUID2;
|
|
4
|
+
title: z.ZodString;
|
|
5
|
+
brandId: z.ZodCUID2;
|
|
6
|
+
brandName: z.ZodCUID2;
|
|
7
|
+
brandImgUrl: z.ZodOptional<z.ZodCUID2>;
|
|
8
|
+
jobType: z.ZodEnum<{
|
|
9
|
+
[x: string]: string;
|
|
10
|
+
}>;
|
|
11
|
+
employmentType: z.ZodNullable<z.ZodEnum<{
|
|
12
|
+
[x: string]: string;
|
|
13
|
+
}>>;
|
|
14
|
+
workMode: z.ZodEnum<{
|
|
15
|
+
[x: string]: string;
|
|
16
|
+
}>;
|
|
17
|
+
gigType: z.ZodNullable<z.ZodEnum<{
|
|
18
|
+
[x: string]: string;
|
|
19
|
+
}>>;
|
|
20
|
+
location: z.ZodArray<z.ZodEnum<{
|
|
21
|
+
Africa: "Africa";
|
|
22
|
+
Asia: "Asia";
|
|
23
|
+
Europe: "Europe";
|
|
24
|
+
"North America": "North America";
|
|
25
|
+
"South America": "South America";
|
|
26
|
+
"Middle East": "Middle East";
|
|
27
|
+
Oceania: "Oceania";
|
|
28
|
+
Global: "Global";
|
|
29
|
+
Other: "Other";
|
|
30
|
+
Remote: "Remote";
|
|
31
|
+
EMEA: "EMEA";
|
|
32
|
+
"Asia Pacific": "Asia Pacific";
|
|
33
|
+
}>>;
|
|
34
|
+
createdAt: z.ZodDate;
|
|
35
|
+
updatedAt: z.ZodDate;
|
|
36
|
+
}, z.core.$strip>;
|
|
37
|
+
export declare const GigJobEntitySchema: z.ZodObject<{
|
|
38
|
+
title: z.ZodString;
|
|
39
|
+
brandId: z.ZodCUID2;
|
|
40
|
+
brandName: z.ZodCUID2;
|
|
41
|
+
brandImgUrl: z.ZodOptional<z.ZodCUID2>;
|
|
42
|
+
workMode: z.ZodEnum<{
|
|
43
|
+
[x: string]: string;
|
|
44
|
+
}>;
|
|
45
|
+
location: z.ZodArray<z.ZodEnum<{
|
|
46
|
+
Africa: "Africa";
|
|
47
|
+
Asia: "Asia";
|
|
48
|
+
Europe: "Europe";
|
|
49
|
+
"North America": "North America";
|
|
50
|
+
"South America": "South America";
|
|
51
|
+
"Middle East": "Middle East";
|
|
52
|
+
Oceania: "Oceania";
|
|
53
|
+
Global: "Global";
|
|
54
|
+
Other: "Other";
|
|
55
|
+
Remote: "Remote";
|
|
56
|
+
EMEA: "EMEA";
|
|
57
|
+
"Asia Pacific": "Asia Pacific";
|
|
58
|
+
}>>;
|
|
59
|
+
createdAt: z.ZodDate;
|
|
60
|
+
updatedAt: z.ZodDate;
|
|
61
|
+
id: z.ZodCUID2;
|
|
62
|
+
jobType: z.ZodLiteral<string>;
|
|
63
|
+
employmentType: z.ZodNull;
|
|
64
|
+
gigType: z.ZodEnum<{
|
|
65
|
+
[x: string]: string;
|
|
66
|
+
}>;
|
|
67
|
+
overview: z.ZodString;
|
|
68
|
+
deliverables: z.ZodArray<z.ZodString>;
|
|
69
|
+
employeeRequirements: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
70
|
+
aboutCompany: z.ZodOptional<z.ZodString>;
|
|
71
|
+
requiredSkills: z.ZodArray<z.ZodString>;
|
|
72
|
+
wagesMin: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
wagesMax: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
wagesCurrency: z.ZodOptional<z.ZodEnum<{
|
|
75
|
+
USD: "USD";
|
|
76
|
+
EUR: "EUR";
|
|
77
|
+
GBP: "GBP";
|
|
78
|
+
NGN: "NGN";
|
|
79
|
+
CAD: "CAD";
|
|
80
|
+
AUD: "AUD";
|
|
81
|
+
JPY: "JPY";
|
|
82
|
+
CHF: "CHF";
|
|
83
|
+
INR: "INR";
|
|
84
|
+
ZAR: "ZAR";
|
|
85
|
+
}>>;
|
|
86
|
+
wagesType: z.ZodOptional<z.ZodEnum<{
|
|
87
|
+
HOURLY: "HOURLY";
|
|
88
|
+
DAILY: "DAILY";
|
|
89
|
+
WEEKLY: "WEEKLY";
|
|
90
|
+
MONTHLY: "MONTHLY";
|
|
91
|
+
PROJECT_BASED: "PROJECT_BASED";
|
|
92
|
+
}>>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
export declare const RoleJobEntitySchema: z.ZodObject<{
|
|
95
|
+
id: z.ZodCUID2;
|
|
96
|
+
title: z.ZodString;
|
|
97
|
+
brandId: z.ZodCUID2;
|
|
98
|
+
brandName: z.ZodCUID2;
|
|
99
|
+
brandImgUrl: z.ZodOptional<z.ZodCUID2>;
|
|
100
|
+
workMode: z.ZodEnum<{
|
|
101
|
+
[x: string]: string;
|
|
102
|
+
}>;
|
|
103
|
+
location: z.ZodArray<z.ZodEnum<{
|
|
104
|
+
Africa: "Africa";
|
|
105
|
+
Asia: "Asia";
|
|
106
|
+
Europe: "Europe";
|
|
107
|
+
"North America": "North America";
|
|
108
|
+
"South America": "South America";
|
|
109
|
+
"Middle East": "Middle East";
|
|
110
|
+
Oceania: "Oceania";
|
|
111
|
+
Global: "Global";
|
|
112
|
+
Other: "Other";
|
|
113
|
+
Remote: "Remote";
|
|
114
|
+
EMEA: "EMEA";
|
|
115
|
+
"Asia Pacific": "Asia Pacific";
|
|
116
|
+
}>>;
|
|
117
|
+
createdAt: z.ZodDate;
|
|
118
|
+
updatedAt: z.ZodDate;
|
|
119
|
+
jobType: z.ZodLiteral<string>;
|
|
120
|
+
gigType: z.ZodNull;
|
|
121
|
+
employmentType: z.ZodEnum<{
|
|
122
|
+
[x: string]: string;
|
|
123
|
+
}>;
|
|
8
124
|
experienceLevel: z.ZodEnum<{
|
|
9
125
|
"0-1 year": "0-1 year";
|
|
10
126
|
"1-3 years": "1-3 years";
|
|
11
127
|
"3-5 years": "3-5 years";
|
|
12
128
|
"5+ years": "5+ years";
|
|
13
129
|
}>;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
130
|
+
overview: z.ZodString;
|
|
131
|
+
keyResponsibilities: z.ZodArray<z.ZodString>;
|
|
132
|
+
requiredSkills: z.ZodArray<z.ZodString>;
|
|
133
|
+
employeeRequirements: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
134
|
+
companyBenefits: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
135
|
+
wagesMin: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
wagesMax: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
wagesCurrency: z.ZodOptional<z.ZodEnum<{
|
|
138
|
+
USD: "USD";
|
|
139
|
+
EUR: "EUR";
|
|
140
|
+
GBP: "GBP";
|
|
141
|
+
NGN: "NGN";
|
|
142
|
+
CAD: "CAD";
|
|
143
|
+
AUD: "AUD";
|
|
144
|
+
JPY: "JPY";
|
|
145
|
+
CHF: "CHF";
|
|
146
|
+
INR: "INR";
|
|
147
|
+
ZAR: "ZAR";
|
|
148
|
+
}>>;
|
|
149
|
+
wagesType: z.ZodOptional<z.ZodEnum<{
|
|
21
150
|
HOURLY: "HOURLY";
|
|
22
151
|
DAILY: "DAILY";
|
|
23
152
|
WEEKLY: "WEEKLY";
|
|
24
153
|
MONTHLY: "MONTHLY";
|
|
25
154
|
PROJECT_BASED: "PROJECT_BASED";
|
|
26
|
-
}
|
|
27
|
-
availability: z.ZodEnum<{
|
|
28
|
-
FULL_TIME: "FULL_TIME";
|
|
29
|
-
PART_TIME: "PART_TIME";
|
|
30
|
-
FREELANCE: "FREELANCE";
|
|
31
|
-
INTERNSHIP: "INTERNSHIP";
|
|
32
|
-
CONTRACT: "CONTRACT";
|
|
33
|
-
}>;
|
|
155
|
+
}>>;
|
|
34
156
|
}, z.core.$strip>;
|
|
35
157
|
export declare const CreateJobInputSchema: z.ZodObject<{
|
|
36
158
|
title: z.ZodString;
|
|
159
|
+
brandId: z.ZodCUID2;
|
|
37
160
|
jobType: z.ZodEnum<{
|
|
38
161
|
[x: string]: string;
|
|
39
162
|
}>;
|
|
@@ -195,6 +318,7 @@ export declare const UpdateGigJobInputSchema: z.ZodObject<{
|
|
|
195
318
|
}, z.core.$strip>;
|
|
196
319
|
export declare const UpdateJobInputSchema: z.ZodObject<{
|
|
197
320
|
title: z.ZodOptional<z.ZodString>;
|
|
321
|
+
brandId: z.ZodOptional<z.ZodCUID2>;
|
|
198
322
|
jobType: z.ZodOptional<z.ZodEnum<{
|
|
199
323
|
[x: string]: string;
|
|
200
324
|
}>>;
|
package/dist/schemas/job.js
CHANGED
|
@@ -1,27 +1,70 @@
|
|
|
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.UpdateJobInputSchema = exports.UpdateGigJobInputSchema = exports.UpdateRoleJobInputSchema = exports.CreateGigJobInputSchema = exports.CreateRoleJobInputSchema = exports.CreateJobInputSchema = exports.RoleJobEntitySchema = exports.GigJobEntitySchema = exports.JobEntitySchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
exports.JobEntitySchema = zod_1.z.object({
|
|
7
|
+
id: zod_1.z.cuid2(),
|
|
8
|
+
title: zod_1.z.string(),
|
|
9
|
+
brandId: zod_1.z.cuid2(),
|
|
10
|
+
brandName: zod_1.z.cuid2(),
|
|
11
|
+
brandImgUrl: zod_1.z.cuid2().optional(),
|
|
12
|
+
jobType: zod_1.z.enum(Object.values(constants_1.JOB_TYPE)),
|
|
13
|
+
employmentType: zod_1.z
|
|
14
|
+
.enum(Object.values(constants_1.EMPLOYMENT_TYPE))
|
|
15
|
+
.nullable(), // nullable because GIG jobs don’t have it
|
|
16
|
+
workMode: zod_1.z.enum(Object.values(constants_1.WORK_MODE)),
|
|
17
|
+
gigType: zod_1.z
|
|
18
|
+
.enum(Object.values(constants_1.GIG_TYPE))
|
|
19
|
+
.nullable(), // nullable because ROLE jobs don’t have it
|
|
20
|
+
location: zod_1.z
|
|
21
|
+
.array(zod_1.z.enum(Object.values(constants_1.JOB_LOCATIONS)))
|
|
22
|
+
.nonempty(),
|
|
23
|
+
createdAt: zod_1.z.date(),
|
|
24
|
+
updatedAt: zod_1.z.date(),
|
|
25
|
+
});
|
|
26
|
+
exports.GigJobEntitySchema = exports.JobEntitySchema.extend({
|
|
27
|
+
id: zod_1.z.cuid2(),
|
|
28
|
+
jobType: zod_1.z.literal(constants_1.JOB_TYPE.GIG),
|
|
29
|
+
employmentType: zod_1.z.null(), // enforce null for GIG
|
|
30
|
+
gigType: zod_1.z.enum(Object.values(constants_1.GIG_TYPE)),
|
|
31
|
+
overview: zod_1.z.string(),
|
|
32
|
+
deliverables: zod_1.z.array(zod_1.z.string()),
|
|
33
|
+
employeeRequirements: zod_1.z.array(zod_1.z.string()).optional(),
|
|
34
|
+
aboutCompany: zod_1.z.string().optional(),
|
|
35
|
+
requiredSkills: zod_1.z.array(zod_1.z.string()),
|
|
36
|
+
wagesMin: zod_1.z.number().optional(),
|
|
37
|
+
wagesMax: zod_1.z.number().optional(),
|
|
38
|
+
wagesCurrency: zod_1.z
|
|
39
|
+
.enum(Object.values(constants_1.WAGES_CURRENCY))
|
|
40
|
+
.optional(),
|
|
41
|
+
wagesType: zod_1.z
|
|
42
|
+
.enum(Object.values(constants_1.WAGE_TYPES))
|
|
43
|
+
.optional(),
|
|
44
|
+
});
|
|
45
|
+
exports.RoleJobEntitySchema = exports.JobEntitySchema.extend({
|
|
46
|
+
jobType: zod_1.z.literal(constants_1.JOB_TYPE.ROLE),
|
|
47
|
+
gigType: zod_1.z.null(), // enforce null for ROLE
|
|
48
|
+
employmentType: zod_1.z.enum(Object.values(constants_1.EMPLOYMENT_TYPE)),
|
|
12
49
|
experienceLevel: zod_1.z.enum(Object.values(constants_1.EXPERIENCE_LEVELS)),
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
50
|
+
overview: zod_1.z.string(),
|
|
51
|
+
keyResponsibilities: zod_1.z.array(zod_1.z.string()),
|
|
52
|
+
requiredSkills: zod_1.z.array(zod_1.z.string()),
|
|
53
|
+
employeeRequirements: zod_1.z.array(zod_1.z.string()).optional(),
|
|
54
|
+
companyBenefits: zod_1.z.array(zod_1.z.string()).optional(),
|
|
55
|
+
wagesMin: zod_1.z.number().optional(),
|
|
56
|
+
wagesMax: zod_1.z.number().optional(),
|
|
57
|
+
wagesCurrency: zod_1.z
|
|
58
|
+
.enum(Object.values(constants_1.WAGES_CURRENCY))
|
|
59
|
+
.optional(),
|
|
60
|
+
wagesType: zod_1.z
|
|
61
|
+
.enum(Object.values(constants_1.WAGE_TYPES))
|
|
62
|
+
.optional(),
|
|
21
63
|
});
|
|
22
64
|
exports.CreateJobInputSchema = zod_1.z
|
|
23
65
|
.object({
|
|
24
66
|
title: zod_1.z.string(),
|
|
67
|
+
brandId: zod_1.z.cuid2(),
|
|
25
68
|
jobType: zod_1.z.enum(Object.values(constants_1.JOB_TYPE)),
|
|
26
69
|
// status: z.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]]),
|
|
27
70
|
employmentType: zod_1.z.enum(Object.values(constants_1.EMPLOYMENT_TYPE)),
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { JobEntitySchema, GigJobEntitySchema, RoleJobEntitySchema, CreateJobInputSchema, CreateRoleJobInputSchema, CreateGigJobInputSchema, UpdateRoleJobInputSchema, UpdateGigJobInputSchema, UpdateJobInputSchema } from "../schemas/job";
|
|
3
|
+
export type JobEntity = z.infer<typeof JobEntitySchema>;
|
|
4
|
+
export type GigJobEntity = z.infer<typeof GigJobEntitySchema>;
|
|
5
|
+
export type RoleJobEntity = z.infer<typeof RoleJobEntitySchema>;
|
|
6
|
+
export type CreateJobInput = z.infer<typeof CreateJobInputSchema>;
|
|
7
|
+
export type CreateRoleJobInput = z.infer<typeof CreateRoleJobInputSchema>;
|
|
8
|
+
export type CreateGigJobInput = z.infer<typeof CreateGigJobInputSchema>;
|
|
9
|
+
export type UpdateRoleJobInput = z.infer<typeof UpdateRoleJobInputSchema>;
|
|
10
|
+
export type UpdateGigJobInput = z.infer<typeof UpdateGigJobInputSchema>;
|
|
11
|
+
export type UpdateJobInput = z.infer<typeof UpdateJobInputSchema>;
|
package/package.json
CHANGED
package/src/schemas/index.ts
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import {
|
|
3
|
+
EXPERIENCE_LEVELS,
|
|
4
|
+
ExperienceLevel,
|
|
5
|
+
JOB_AVAILABILITY_TYPES,
|
|
6
|
+
JobAvailabilityTypes,
|
|
7
|
+
WAGE_TYPES,
|
|
8
|
+
WageTypes,
|
|
9
|
+
} from "../constants";
|
|
10
|
+
|
|
11
|
+
export const CreateJobApplicationInputSchema = z.object({
|
|
12
|
+
firstName: z.string(),
|
|
13
|
+
lastName: z.string(),
|
|
14
|
+
emailAddress: z.email(),
|
|
15
|
+
phoneNumber: z.string().optional(),
|
|
16
|
+
currentRole: z.string(),
|
|
17
|
+
experienceLevel: z.enum(
|
|
18
|
+
Object.values(EXPERIENCE_LEVELS) as [ExperienceLevel, ...ExperienceLevel[]]
|
|
19
|
+
),
|
|
20
|
+
resumeUrl: z.url(),
|
|
21
|
+
workSampleUrls: z.array(z.url()).optional(),
|
|
22
|
+
portfolioUrl: z.url().optional(),
|
|
23
|
+
coverLetterUrl: z.url().optional(),
|
|
24
|
+
receiveEmailUpdates: z.boolean(),
|
|
25
|
+
wagesAmount: z.string(),
|
|
26
|
+
wagesType: z.enum(Object.values(WAGE_TYPES) as [WageTypes, ...WageTypes[]]),
|
|
27
|
+
availability: z.enum(
|
|
28
|
+
Object.values(JOB_AVAILABILITY_TYPES) as [
|
|
29
|
+
JobAvailabilityTypes,
|
|
30
|
+
...JobAvailabilityTypes[]
|
|
31
|
+
]
|
|
32
|
+
),
|
|
33
|
+
});
|
package/src/schemas/job.ts
CHANGED
|
@@ -21,33 +21,79 @@ import {
|
|
|
21
21
|
WorkMode,
|
|
22
22
|
} from "../constants";
|
|
23
23
|
|
|
24
|
-
export const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
export const JobEntitySchema = z.object({
|
|
25
|
+
id: z.cuid2(),
|
|
26
|
+
title: z.string(),
|
|
27
|
+
brandId: z.cuid2(),
|
|
28
|
+
brandName: z.cuid2(),
|
|
29
|
+
brandImgUrl: z.cuid2().optional(),
|
|
30
|
+
jobType: z.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]]),
|
|
31
|
+
employmentType: z
|
|
32
|
+
.enum(
|
|
33
|
+
Object.values(EMPLOYMENT_TYPE) as [EmploymentType, ...EmploymentType[]]
|
|
34
|
+
)
|
|
35
|
+
.nullable(), // nullable because GIG jobs don’t have it
|
|
36
|
+
workMode: z.enum(Object.values(WORK_MODE) as [WorkMode, ...WorkMode[]]),
|
|
37
|
+
gigType: z
|
|
38
|
+
.enum(Object.values(GIG_TYPE) as [GigType, ...GigType[]])
|
|
39
|
+
.nullable(), // nullable because ROLE jobs don’t have it
|
|
40
|
+
location: z
|
|
41
|
+
.array(
|
|
42
|
+
z.enum(Object.values(JOB_LOCATIONS) as [JobLocation, ...JobLocation[]])
|
|
43
|
+
)
|
|
44
|
+
.nonempty(),
|
|
45
|
+
createdAt: z.date(),
|
|
46
|
+
updatedAt: z.date(),
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export const GigJobEntitySchema = JobEntitySchema.extend({
|
|
50
|
+
id: z.cuid2(),
|
|
51
|
+
jobType: z.literal(JOB_TYPE.GIG),
|
|
52
|
+
employmentType: z.null(), // enforce null for GIG
|
|
53
|
+
gigType: z.enum(Object.values(GIG_TYPE) as [GigType, ...GigType[]]),
|
|
54
|
+
overview: z.string(),
|
|
55
|
+
deliverables: z.array(z.string()),
|
|
56
|
+
employeeRequirements: z.array(z.string()).optional(),
|
|
57
|
+
aboutCompany: z.string().optional(),
|
|
58
|
+
requiredSkills: z.array(z.string()),
|
|
59
|
+
wagesMin: z.number().optional(),
|
|
60
|
+
wagesMax: z.number().optional(),
|
|
61
|
+
wagesCurrency: z
|
|
62
|
+
.enum(Object.values(WAGES_CURRENCY) as [WagesCurrency, ...WagesCurrency[]])
|
|
63
|
+
.optional(),
|
|
64
|
+
wagesType: z
|
|
65
|
+
.enum(Object.values(WAGE_TYPES) as [WageTypes, ...WageTypes[]])
|
|
66
|
+
.optional(),
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export const RoleJobEntitySchema = JobEntitySchema.extend({
|
|
70
|
+
jobType: z.literal(JOB_TYPE.ROLE),
|
|
71
|
+
gigType: z.null(), // enforce null for ROLE
|
|
72
|
+
employmentType: z.enum(
|
|
73
|
+
Object.values(EMPLOYMENT_TYPE) as [EmploymentType, ...EmploymentType[]]
|
|
74
|
+
),
|
|
30
75
|
experienceLevel: z.enum(
|
|
31
76
|
Object.values(EXPERIENCE_LEVELS) as [ExperienceLevel, ...ExperienceLevel[]]
|
|
32
77
|
),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
Object.values(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
]
|
|
45
|
-
|
|
78
|
+
overview: z.string(),
|
|
79
|
+
keyResponsibilities: z.array(z.string()),
|
|
80
|
+
requiredSkills: z.array(z.string()),
|
|
81
|
+
employeeRequirements: z.array(z.string()).optional(),
|
|
82
|
+
companyBenefits: z.array(z.string()).optional(),
|
|
83
|
+
wagesMin: z.number().optional(),
|
|
84
|
+
wagesMax: z.number().optional(),
|
|
85
|
+
wagesCurrency: z
|
|
86
|
+
.enum(Object.values(WAGES_CURRENCY) as [WagesCurrency, ...WagesCurrency[]])
|
|
87
|
+
.optional(),
|
|
88
|
+
wagesType: z
|
|
89
|
+
.enum(Object.values(WAGE_TYPES) as [WageTypes, ...WageTypes[]])
|
|
90
|
+
.optional(),
|
|
46
91
|
});
|
|
47
92
|
|
|
48
93
|
export const CreateJobInputSchema = z
|
|
49
94
|
.object({
|
|
50
95
|
title: z.string(),
|
|
96
|
+
brandId: z.cuid2(),
|
|
51
97
|
jobType: z.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]]),
|
|
52
98
|
// status: z.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]]),
|
|
53
99
|
employmentType: z.enum(
|
package/src/types/index.ts
CHANGED
package/src/types/job.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import {
|
|
3
|
+
JobEntitySchema,
|
|
4
|
+
GigJobEntitySchema,
|
|
5
|
+
RoleJobEntitySchema,
|
|
6
|
+
CreateJobInputSchema,
|
|
7
|
+
CreateRoleJobInputSchema,
|
|
8
|
+
CreateGigJobInputSchema,
|
|
9
|
+
UpdateRoleJobInputSchema,
|
|
10
|
+
UpdateGigJobInputSchema,
|
|
11
|
+
UpdateJobInputSchema,
|
|
12
|
+
} from "../schemas/job";
|
|
13
|
+
|
|
14
|
+
export type JobEntity = z.infer<typeof JobEntitySchema>;
|
|
15
|
+
|
|
16
|
+
export type GigJobEntity = z.infer<typeof GigJobEntitySchema>;
|
|
17
|
+
|
|
18
|
+
export type RoleJobEntity = z.infer<typeof RoleJobEntitySchema>;
|
|
19
|
+
|
|
20
|
+
export type CreateJobInput = z.infer<typeof CreateJobInputSchema>;
|
|
21
|
+
|
|
22
|
+
export type CreateRoleJobInput = z.infer<typeof CreateRoleJobInputSchema>;
|
|
23
|
+
|
|
24
|
+
export type CreateGigJobInput = z.infer<typeof CreateGigJobInputSchema>;
|
|
25
|
+
|
|
26
|
+
export type UpdateRoleJobInput = z.infer<typeof UpdateRoleJobInputSchema>;
|
|
27
|
+
|
|
28
|
+
export type UpdateGigJobInput = z.infer<typeof UpdateGigJobInputSchema>;
|
|
29
|
+
|
|
30
|
+
export type UpdateJobInput = z.infer<typeof UpdateJobInputSchema>;
|