@zyacreatives/shared 2.5.25 → 2.5.27
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 +150 -135
- package/dist/schemas/job-application.js +0 -3
- package/dist/schemas/job.d.ts +522 -474
- package/dist/schemas/job.js +93 -200
- package/dist/schemas/user.d.ts +2 -0
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.js +0 -1
- package/dist/types/job.d.ts +1 -27
- package/package.json +1 -1
- package/src/schemas/job-application.ts +0 -3
- package/src/schemas/job.ts +138 -224
- package/src/types/index.ts +0 -1
- package/src/types/job.ts +0 -77
package/src/schemas/job.ts
CHANGED
|
@@ -25,15 +25,12 @@ const JobSectionEnum = z
|
|
|
25
25
|
.enum(Object.values(JOB_SECTIONS) as [string, ...string[]])
|
|
26
26
|
.openapi({ example: "PROFESSIONAL_INFORMATION" });
|
|
27
27
|
|
|
28
|
-
export const
|
|
29
|
-
|
|
30
|
-
title: z.string().openapi({ example: "Senior Frontend Engineer" }),
|
|
31
|
-
brandId: z.cuid2().openapi({ example: "ckj1a2b3c0000brnd" }),
|
|
32
|
-
jobType: z
|
|
33
|
-
.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]])
|
|
34
|
-
.openapi({ example: "ROLE" }),
|
|
28
|
+
export const JobIdSchema = z.object({
|
|
29
|
+
jobId: z.cuid2().openapi({ example: "ckj1a2b3c0000job1" }),
|
|
35
30
|
});
|
|
36
31
|
|
|
32
|
+
export type JobIdInput = z.infer<typeof JobIdSchema>;
|
|
33
|
+
|
|
37
34
|
export const BaseJobEntitySchema = z.object({
|
|
38
35
|
id: z.cuid2().openapi({ example: "ckj1a2b3c0000job1" }),
|
|
39
36
|
title: z.string().openapi({ example: "Senior Frontend Engineer" }),
|
|
@@ -76,61 +73,25 @@ export const BaseJobEntitySchema = z.object({
|
|
|
76
73
|
"COVER_LETTER",
|
|
77
74
|
],
|
|
78
75
|
}),
|
|
79
|
-
createdAt: z.date().openapi({ example: "2026-
|
|
80
|
-
version: z.int().openapi({ example: 1 }),
|
|
81
|
-
updatedAt: z.date().openapi({ example: "2026-
|
|
76
|
+
createdAt: z.date().openapi({ example: "2026-04-09T12:00:00.000Z" }),
|
|
77
|
+
version: z.number().int().openapi({ example: 1 }),
|
|
78
|
+
updatedAt: z.date().openapi({ example: "2026-04-09T12:00:00.000Z" }),
|
|
82
79
|
});
|
|
83
80
|
|
|
84
|
-
export
|
|
85
|
-
jobId: z.cuid2().openapi({ example: "ckj1a2b3c0000job1" }),
|
|
86
|
-
});
|
|
81
|
+
export type BaseJobEntity = z.infer<typeof BaseJobEntitySchema>;
|
|
87
82
|
|
|
88
|
-
export const JobEntitySchema =
|
|
89
|
-
id: z.cuid2().openapi({ example: "ckj1a2b3c0000job1" }),
|
|
90
|
-
title: z.string().openapi({ example: "Senior Frontend Engineer" }),
|
|
91
|
-
brandId: z.cuid2().openapi({ example: "ckj1a2b3c0000brnd" }),
|
|
83
|
+
export const JobEntitySchema = BaseJobEntitySchema.extend({
|
|
92
84
|
brandName: z.string().openapi({ example: "Acme Corp" }),
|
|
85
|
+
isApplied: z.boolean().default(false).optional(),
|
|
93
86
|
brandImgUrl: z
|
|
94
87
|
.url()
|
|
95
88
|
.optional()
|
|
96
89
|
.openapi({ example: "https://example.com/logo.png" }),
|
|
97
|
-
jobType: z
|
|
98
|
-
.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]])
|
|
99
|
-
.openapi({ example: "ROLE" }),
|
|
100
|
-
status: z
|
|
101
|
-
.enum(Object.values(JOB_STATUS) as [JobStatus, ...JobStatus[]])
|
|
102
|
-
.openapi({ example: "OPEN" }),
|
|
103
|
-
employmentType: z
|
|
104
|
-
.enum(
|
|
105
|
-
Object.values(EMPLOYMENT_TYPE) as [EmploymentType, ...EmploymentType[]],
|
|
106
|
-
)
|
|
107
|
-
.optional()
|
|
108
|
-
.openapi({ example: "FULL_TIME" }),
|
|
109
|
-
workMode: z
|
|
110
|
-
.enum(Object.values(WORK_MODE) as [WorkMode, ...WorkMode[]])
|
|
111
|
-
.openapi({ example: "REMOTE" }),
|
|
112
|
-
gigType: z
|
|
113
|
-
.enum(Object.values(GIG_TYPE) as [GigType, ...GigType[]])
|
|
114
|
-
.optional()
|
|
115
|
-
.openapi({ example: "PROJECT_BASED" }),
|
|
116
|
-
location: z
|
|
117
|
-
.enum(Object.values(JOB_LOCATIONS) as [JobLocation, ...JobLocation[]])
|
|
118
|
-
.openapi({ example: "LAGOS" }),
|
|
119
|
-
jobSections: z
|
|
120
|
-
.array(JobSectionEnum)
|
|
121
|
-
.default([
|
|
122
|
-
JOB_SECTIONS.PERSONAL_INFORMATION,
|
|
123
|
-
JOB_SECTIONS.PROFESSIONAL_INFORMATION,
|
|
124
|
-
JOB_SECTIONS.RESUME,
|
|
125
|
-
JOB_SECTIONS.COVER_LETTER,
|
|
126
|
-
])
|
|
127
|
-
.openapi({ example: ["PERSONAL_INFORMATION", "RESUME"] }),
|
|
128
90
|
isBookmarked: z.boolean().openapi({ example: false }),
|
|
129
|
-
createdAt: z.date().openapi({ example: "2026-03-11T09:00:00.000Z" }),
|
|
130
|
-
version: z.int().openapi({ example: 1 }),
|
|
131
|
-
updatedAt: z.date().openapi({ example: "2026-03-11T09:00:00.000Z" }),
|
|
132
91
|
});
|
|
133
92
|
|
|
93
|
+
export type JobEntity = z.infer<typeof JobEntitySchema>;
|
|
94
|
+
|
|
134
95
|
export const GigJobEntitySchema = z.object({
|
|
135
96
|
id: z.cuid2().openapi({ example: "ckj1a2b3c0000gig1" }),
|
|
136
97
|
jobType: z.literal(JOB_TYPE.GIG).openapi({ example: "GIG" }),
|
|
@@ -151,8 +112,8 @@ export const GigJobEntitySchema = z.object({
|
|
|
151
112
|
requiredSkills: z
|
|
152
113
|
.array(z.string())
|
|
153
114
|
.openapi({ example: ["Figma", "UI Design"] }),
|
|
154
|
-
wagesMin: z.number().optional().openapi({ example: 500 }),
|
|
155
|
-
wagesMax: z.number().optional().openapi({ example: 1000 }),
|
|
115
|
+
wagesMin: z.number().optional().nullable().openapi({ example: 500 }),
|
|
116
|
+
wagesMax: z.number().optional().nullable().openapi({ example: 1000 }),
|
|
156
117
|
wagesCurrency: z
|
|
157
118
|
.enum(Object.values(WAGES_CURRENCY) as [WagesCurrency, ...WagesCurrency[]])
|
|
158
119
|
.optional()
|
|
@@ -163,10 +124,16 @@ export const GigJobEntitySchema = z.object({
|
|
|
163
124
|
.openapi({ example: "FIXED" }),
|
|
164
125
|
});
|
|
165
126
|
|
|
127
|
+
export type GigJobEntity = z.infer<typeof GigJobEntitySchema>;
|
|
128
|
+
|
|
166
129
|
export const JobWithGigDetailsEntitySchema = JobEntitySchema.extend(
|
|
167
|
-
GigJobEntitySchema.shape,
|
|
130
|
+
GigJobEntitySchema.omit({ id: true, jobType: true }).shape,
|
|
168
131
|
);
|
|
169
132
|
|
|
133
|
+
export type JobWithGigDetailsEntity = z.infer<
|
|
134
|
+
typeof JobWithGigDetailsEntitySchema
|
|
135
|
+
>;
|
|
136
|
+
|
|
170
137
|
export const RoleJobEntitySchema = z.object({
|
|
171
138
|
id: z.cuid2().openapi({ example: "ckj1a2b3c0000rol1" }),
|
|
172
139
|
jobType: z.literal(JOB_TYPE.ROLE).openapi({ example: "ROLE" }),
|
|
@@ -207,38 +174,51 @@ export const RoleJobEntitySchema = z.object({
|
|
|
207
174
|
.openapi({ example: "YEARLY" }),
|
|
208
175
|
});
|
|
209
176
|
|
|
177
|
+
export type RoleJobEntity = z.infer<typeof RoleJobEntitySchema>;
|
|
178
|
+
|
|
210
179
|
export const JobWithRoleDetailsEntitySchema = JobEntitySchema.extend(
|
|
211
|
-
RoleJobEntitySchema.shape,
|
|
180
|
+
RoleJobEntitySchema.omit({ id: true, jobType: true }).shape,
|
|
212
181
|
);
|
|
213
182
|
|
|
183
|
+
export type JobWithRoleDetailsEntity = z.infer<
|
|
184
|
+
typeof JobWithRoleDetailsEntitySchema
|
|
185
|
+
>;
|
|
186
|
+
|
|
187
|
+
export const NormalizedJobSchema = z.union([
|
|
188
|
+
JobWithGigDetailsEntitySchema,
|
|
189
|
+
JobWithRoleDetailsEntitySchema,
|
|
190
|
+
JobEntitySchema,
|
|
191
|
+
]);
|
|
192
|
+
|
|
193
|
+
export type NormalizedJobEntity = z.infer<typeof NormalizedJobSchema>;
|
|
194
|
+
|
|
214
195
|
const CreateJobInputBaseSchema = z.object({
|
|
215
|
-
title: z
|
|
196
|
+
title: z
|
|
197
|
+
.string()
|
|
198
|
+
.min(3)
|
|
199
|
+
.max(255)
|
|
200
|
+
.openapi({ example: "Senior Frontend Engineer" }),
|
|
216
201
|
brandId: z.cuid2().openapi({ example: "ckj1a2b3c0000brnd" }),
|
|
217
202
|
jobType: z
|
|
218
203
|
.enum(Object.values(JOB_TYPE) as [JobType, ...JobType[]])
|
|
219
204
|
.openapi({ example: "ROLE" }),
|
|
220
|
-
|
|
221
205
|
employmentType: z
|
|
222
206
|
.enum(
|
|
223
207
|
Object.values(EMPLOYMENT_TYPE) as [EmploymentType, ...EmploymentType[]],
|
|
224
208
|
)
|
|
225
209
|
.optional()
|
|
226
210
|
.openapi({ example: "FULL_TIME" }),
|
|
227
|
-
|
|
228
211
|
workMode: z
|
|
229
212
|
.enum(Object.values(WORK_MODE) as [WorkMode, ...WorkMode[]])
|
|
230
213
|
.openapi({ example: "REMOTE" }),
|
|
231
|
-
|
|
232
214
|
gigType: z
|
|
233
215
|
.enum(Object.values(GIG_TYPE) as [GigType, ...GigType[]])
|
|
234
216
|
.optional()
|
|
235
217
|
.openapi({ example: "PROJECT_BASED" }),
|
|
236
|
-
|
|
237
218
|
location: z
|
|
238
219
|
.enum(Object.values(JOB_LOCATIONS) as [JobLocation, ...JobLocation[]])
|
|
239
220
|
.default(JOB_LOCATIONS.REMOTE)
|
|
240
221
|
.openapi({ example: "REMOTE" }),
|
|
241
|
-
|
|
242
222
|
jobSections: z
|
|
243
223
|
.array(JobSectionEnum)
|
|
244
224
|
.min(1, { message: "At least one job section must be provided." })
|
|
@@ -254,7 +234,6 @@ export const CreateJobInputSchema = CreateJobInputBaseSchema.superRefine(
|
|
|
254
234
|
message: "employmentType is required for ROLE jobs",
|
|
255
235
|
});
|
|
256
236
|
}
|
|
257
|
-
|
|
258
237
|
if (data.jobType === JOB_TYPE.GIG && !data.gigType) {
|
|
259
238
|
ctx.addIssue({
|
|
260
239
|
path: ["gigType"],
|
|
@@ -264,58 +243,19 @@ export const CreateJobInputSchema = CreateJobInputBaseSchema.superRefine(
|
|
|
264
243
|
}
|
|
265
244
|
},
|
|
266
245
|
).transform((data) => {
|
|
267
|
-
if (data.jobType === JOB_TYPE.ROLE) {
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
if (data.jobType === JOB_TYPE.GIG) {
|
|
246
|
+
if (data.jobType === JOB_TYPE.ROLE) return { ...data, gigType: undefined };
|
|
247
|
+
if (data.jobType === JOB_TYPE.GIG)
|
|
272
248
|
return { ...data, employmentType: undefined };
|
|
273
|
-
}
|
|
274
|
-
|
|
275
249
|
return data;
|
|
276
250
|
});
|
|
277
251
|
|
|
278
|
-
export
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
...ExperienceLevel[],
|
|
286
|
-
],
|
|
287
|
-
)
|
|
288
|
-
.openapi({ example: "MID_LEVEL" }),
|
|
289
|
-
overview: z
|
|
290
|
-
.string()
|
|
291
|
-
.openapi({ example: "Build cool features for our app." }),
|
|
292
|
-
keyResponsibilities: z
|
|
293
|
-
.string()
|
|
294
|
-
.openapi({ example: "Write code, review PRs." }),
|
|
295
|
-
requiredSkills: z
|
|
296
|
-
.array(z.string())
|
|
297
|
-
.openapi({ example: ["JavaScript", "React"] }),
|
|
298
|
-
employeeRequirements: z
|
|
299
|
-
.string()
|
|
300
|
-
.optional()
|
|
301
|
-
.openapi({ example: "Good communication skills." }),
|
|
302
|
-
companyBenefits: z
|
|
303
|
-
.string()
|
|
304
|
-
.optional()
|
|
305
|
-
.openapi({ example: "Unlimited PTO." }),
|
|
306
|
-
wagesMin: z.number().optional().nullable().openapi({ example: 60000 }),
|
|
307
|
-
wagesMax: z.number().optional().nullable().openapi({ example: 90000 }),
|
|
308
|
-
wagesCurrency: z
|
|
309
|
-
.enum(
|
|
310
|
-
Object.values(WAGES_CURRENCY) as [WagesCurrency, ...WagesCurrency[]],
|
|
311
|
-
)
|
|
312
|
-
.optional()
|
|
313
|
-
.openapi({ example: "USD" }),
|
|
314
|
-
wagesType: z
|
|
315
|
-
.enum(Object.values(WAGE_TYPES) as [WageTypes, ...WageTypes[]])
|
|
316
|
-
.optional()
|
|
317
|
-
.openapi({ example: "YEARLY" }),
|
|
318
|
-
})
|
|
252
|
+
export type CreateJobInput = z.infer<typeof CreateJobInputSchema>;
|
|
253
|
+
|
|
254
|
+
export const CreateRoleJobInputSchema = RoleJobEntitySchema.omit({
|
|
255
|
+
id: true,
|
|
256
|
+
jobType: true,
|
|
257
|
+
})
|
|
258
|
+
.extend({ id: z.cuid2() })
|
|
319
259
|
.refine(
|
|
320
260
|
({ wagesMin, wagesMax }) =>
|
|
321
261
|
wagesMin == null || wagesMax == null || wagesMax > wagesMin,
|
|
@@ -325,39 +265,13 @@ export const CreateRoleJobInputSchema = z
|
|
|
325
265
|
},
|
|
326
266
|
);
|
|
327
267
|
|
|
328
|
-
export
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
.string()
|
|
336
|
-
.openapi({ example: "Vector files, PNGs, and a brand guide." }),
|
|
337
|
-
employeeRequirements: z
|
|
338
|
-
.string()
|
|
339
|
-
.optional()
|
|
340
|
-
.openapi({ example: "Portfolio required." }),
|
|
341
|
-
aboutCompany: z
|
|
342
|
-
.string()
|
|
343
|
-
.optional()
|
|
344
|
-
.openapi({ example: "E-commerce store." }),
|
|
345
|
-
requiredSkills: z
|
|
346
|
-
.array(z.string())
|
|
347
|
-
.openapi({ example: ["Graphic Design", "Illustrator"] }),
|
|
348
|
-
wagesMin: z.number().optional().nullable().openapi({ example: 100 }),
|
|
349
|
-
wagesMax: z.number().optional().nullable().openapi({ example: 500 }),
|
|
350
|
-
wagesCurrency: z
|
|
351
|
-
.enum(
|
|
352
|
-
Object.values(WAGES_CURRENCY) as [WagesCurrency, ...WagesCurrency[]],
|
|
353
|
-
)
|
|
354
|
-
.optional()
|
|
355
|
-
.openapi({ example: "USD" }),
|
|
356
|
-
wagesType: z
|
|
357
|
-
.enum(Object.values(WAGE_TYPES) as [WageTypes, ...WageTypes[]])
|
|
358
|
-
.optional()
|
|
359
|
-
.openapi({ example: "FIXED" }),
|
|
360
|
-
})
|
|
268
|
+
export type CreateRoleJobInput = z.infer<typeof CreateRoleJobInputSchema>;
|
|
269
|
+
|
|
270
|
+
export const CreateGigJobInputSchema = GigJobEntitySchema.omit({
|
|
271
|
+
id: true,
|
|
272
|
+
jobType: true,
|
|
273
|
+
})
|
|
274
|
+
.extend({ id: z.cuid2() })
|
|
361
275
|
.refine(
|
|
362
276
|
({ wagesMin, wagesMax }) =>
|
|
363
277
|
wagesMin == null || wagesMax == null || wagesMax > wagesMin,
|
|
@@ -367,103 +281,103 @@ export const CreateGigJobInputSchema = z
|
|
|
367
281
|
},
|
|
368
282
|
);
|
|
369
283
|
|
|
370
|
-
export
|
|
371
|
-
.extend({ version: z.int().openapi({ example: 2 }) })
|
|
372
|
-
.required({ id: true });
|
|
373
|
-
|
|
374
|
-
export const UpdateGigJobInputSchema = CreateGigJobInputSchema.partial()
|
|
375
|
-
.extend({ version: z.int().openapi({ example: 2 }) })
|
|
376
|
-
.required({ id: true });
|
|
284
|
+
export type CreateGigJobInput = z.infer<typeof CreateGigJobInputSchema>;
|
|
377
285
|
|
|
378
286
|
export const UpdateJobInputSchema = CreateJobInputBaseSchema.partial().extend({
|
|
379
287
|
id: z.cuid2().openapi({ example: "ckj1a2b3c0000job1" }),
|
|
380
288
|
status: z
|
|
381
289
|
.enum(Object.values(JOB_STATUS) as [JobStatus, ...JobStatus[]])
|
|
382
|
-
.optional()
|
|
383
|
-
|
|
384
|
-
version: z.int().openapi({ example: 2 }),
|
|
290
|
+
.optional(),
|
|
291
|
+
version: z.number().int().openapi({ example: 2 }),
|
|
385
292
|
});
|
|
386
293
|
|
|
387
|
-
export
|
|
388
|
-
JobWithGigDetailsEntitySchema,
|
|
389
|
-
JobEntitySchema,
|
|
390
|
-
JobWithRoleDetailsEntitySchema,
|
|
391
|
-
]);
|
|
392
|
-
|
|
393
|
-
export const GetCreatedJobsOutputSchema = z.object({
|
|
394
|
-
jobs: z.array(NormalizedJobSchema).openapi({ example: [] }),
|
|
395
|
-
noOfJobs: z.number().openapi({ example: 45 }),
|
|
396
|
-
noOfActiveJobs: z.number().openapi({ example: 12 }),
|
|
397
|
-
noOfArchivedJobs: z.number().openapi({ example: 33 }),
|
|
398
|
-
});
|
|
294
|
+
export type UpdateJobInput = z.infer<typeof UpdateJobInputSchema>;
|
|
399
295
|
|
|
400
296
|
export const GetJobsInputSchema = z.object({
|
|
401
297
|
q: z.string().optional().openapi({ example: "frontend engineer" }),
|
|
402
|
-
jobType: z
|
|
403
|
-
|
|
404
|
-
.optional()
|
|
405
|
-
.openapi({ example: "ROLE" }),
|
|
406
|
-
workMode: z
|
|
407
|
-
.string()
|
|
408
|
-
.optional()
|
|
409
|
-
.describe("Comma-separated values, e.g. 'Remote,Hybrid'")
|
|
410
|
-
.openapi({ example: "Remote,Hybrid" }),
|
|
298
|
+
jobType: z.enum(Object.values(JOB_TYPE) as [string, ...string[]]).optional(),
|
|
299
|
+
workMode: z.string().optional().describe("Comma-separated values"),
|
|
411
300
|
location: z
|
|
412
301
|
.enum(Object.values(JOB_LOCATIONS) as [string, ...string[]])
|
|
413
|
-
.optional()
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
gigType: z
|
|
421
|
-
.enum(Object.values(GIG_TYPE) as [string, ...string[]])
|
|
422
|
-
.optional()
|
|
423
|
-
.openapi({ example: "PROJECT_BASED" }),
|
|
424
|
-
requiredSkills: z
|
|
425
|
-
.string()
|
|
426
|
-
.optional()
|
|
427
|
-
.describe("Comma-separated skills")
|
|
428
|
-
.openapi({ example: "React,TypeScript" }),
|
|
429
|
-
status: z.string().optional().openapi({ example: "OPEN" }),
|
|
430
|
-
page: z.coerce.number().min(1).default(1).openapi({ example: 1 }),
|
|
431
|
-
limit: z.coerce.number().min(1).max(100).default(20).openapi({ example: 20 }),
|
|
302
|
+
.optional(),
|
|
303
|
+
employmentType: z.string().optional().describe("Comma-separated values"),
|
|
304
|
+
gigType: z.enum(Object.values(GIG_TYPE) as [string, ...string[]]).optional(),
|
|
305
|
+
requiredSkills: z.string().optional().describe("Comma-separated skills"),
|
|
306
|
+
status: z.string().optional(),
|
|
307
|
+
page: z.coerce.number().int().min(1).default(1),
|
|
308
|
+
limit: z.coerce.number().int().min(1).max(100).default(20),
|
|
432
309
|
});
|
|
433
310
|
|
|
311
|
+
export type GetJobsInput = z.infer<typeof GetJobsInputSchema>;
|
|
312
|
+
|
|
434
313
|
export const GetJobsOutputSchema = z.object({
|
|
435
|
-
jobs: z.array(NormalizedJobSchema)
|
|
436
|
-
total: z.number()
|
|
437
|
-
page: z.number()
|
|
438
|
-
limit: z.number()
|
|
439
|
-
totalPages: z.number()
|
|
440
|
-
hasNextPage: z.boolean()
|
|
441
|
-
hasPrevPage: z.boolean()
|
|
314
|
+
jobs: z.array(NormalizedJobSchema),
|
|
315
|
+
total: z.number(),
|
|
316
|
+
page: z.number(),
|
|
317
|
+
limit: z.number(),
|
|
318
|
+
totalPages: z.number(),
|
|
319
|
+
hasNextPage: z.boolean(),
|
|
320
|
+
hasPrevPage: z.boolean(),
|
|
442
321
|
});
|
|
443
322
|
|
|
323
|
+
export type GetJobsOutput = z.infer<typeof GetJobsOutputSchema>;
|
|
444
324
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
brandName: z.string().openapi({ example: "Acme Corp" }),
|
|
451
|
-
brandImgUrl: z.string().nullable().optional().openapi({ example: "https://example.com/logo.png" }),
|
|
452
|
-
jobType: z.enum(["GIG", "ROLE"]).openapi({ example: "ROLE" }),
|
|
453
|
-
status: z.string().optional().openapi({ example: "OPEN" }),
|
|
454
|
-
employmentType: z.string().nullable().optional().openapi({ example: "FULL_TIME" }),
|
|
455
|
-
workMode: z.string().openapi({ example: "REMOTE" }),
|
|
456
|
-
gigType: z.string().nullable().optional().openapi({ example: "PROJECT_BASED" }),
|
|
457
|
-
location: z.string().openapi({ example: "LAGOS" }),
|
|
458
|
-
overview: z.string().openapi({ example: "Looking for a seasoned engineer to lead our product development." }),
|
|
459
|
-
requiredSkills: z.array(z.string()).openapi({ example: ["React", "TypeScript", "Next.js"] }),
|
|
460
|
-
wagesMin: z.number().nullable().optional().openapi({ example: 80000 }),
|
|
461
|
-
wagesMax: z.number().nullable().optional().openapi({ example: 120000 }),
|
|
462
|
-
wagesCurrency: z.string().nullable().optional().openapi({ example: "USD" }),
|
|
463
|
-
wagesType: z.string().nullable().optional().openapi({ example: "YEARLY" }),
|
|
464
|
-
createdAt: z.string().openapi({ example: "2026-03-11T09:00:00.000Z" }),
|
|
465
|
-
updatedAt: z.string().openapi({ example: "2026-03-11T09:00:00.000Z" }),
|
|
466
|
-
}).openapi({
|
|
467
|
-
title: "Job Search Document",
|
|
468
|
-
description: "Flattened schema used for indexing jobs in search engines.",
|
|
325
|
+
export const GetCreatedJobsOutputSchema = z.object({
|
|
326
|
+
jobs: z.array(NormalizedJobSchema),
|
|
327
|
+
noOfJobs: z.number(),
|
|
328
|
+
noOfActiveJobs: z.number(),
|
|
329
|
+
noOfArchivedJobs: z.number(),
|
|
469
330
|
});
|
|
331
|
+
|
|
332
|
+
export type GetCreatedJobsOutput = z.infer<typeof GetCreatedJobsOutputSchema>;
|
|
333
|
+
|
|
334
|
+
export const JobSearchDocumentSchema = z
|
|
335
|
+
.object({
|
|
336
|
+
id: z.cuid2(),
|
|
337
|
+
title: z.string(),
|
|
338
|
+
isApplied: z.boolean().default(false).optional(),
|
|
339
|
+
brandId: z.cuid2(),
|
|
340
|
+
brandName: z.string(),
|
|
341
|
+
brandImgUrl: z.string().nullable().optional(),
|
|
342
|
+
jobType: z.enum(["GIG", "ROLE"]),
|
|
343
|
+
status: z.string().optional(),
|
|
344
|
+
employmentType: z.string().nullable().optional(),
|
|
345
|
+
workMode: z.string(),
|
|
346
|
+
gigType: z.string().nullable().optional(),
|
|
347
|
+
location: z.string(),
|
|
348
|
+
overview: z.string(),
|
|
349
|
+
requiredSkills: z.array(z.string()),
|
|
350
|
+
wagesMin: z.number().nullable().optional(),
|
|
351
|
+
wagesMax: z.number().nullable().optional(),
|
|
352
|
+
wagesCurrency: z.string().nullable().optional(),
|
|
353
|
+
wagesType: z.string().nullable().optional(),
|
|
354
|
+
createdAt: z.string(),
|
|
355
|
+
updatedAt: z.string(),
|
|
356
|
+
})
|
|
357
|
+
.openapi("JobSearchDocument");
|
|
358
|
+
|
|
359
|
+
export type JobSearchDocument = z.infer<typeof JobSearchDocumentSchema>;
|
|
360
|
+
|
|
361
|
+
export const UpdateRoleJobInputSchema = CreateRoleJobInputSchema.partial()
|
|
362
|
+
.extend({
|
|
363
|
+
version: z.number().int().openapi({ example: 2 })
|
|
364
|
+
})
|
|
365
|
+
.required({
|
|
366
|
+
id: true
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
export type UpdateRoleJobInput = z.infer<typeof UpdateRoleJobInputSchema>;
|
|
370
|
+
|
|
371
|
+
export const UpdateGigJobInputSchema = CreateGigJobInputSchema.partial()
|
|
372
|
+
.extend({
|
|
373
|
+
version: z.number().int().openapi({ example: 2 })
|
|
374
|
+
})
|
|
375
|
+
.required({
|
|
376
|
+
id: true
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
export type UpdateGigJobInput = z.infer<typeof UpdateGigJobInputSchema>;
|
|
380
|
+
|
|
381
|
+
export type UpdateRoleJobOutput = z.infer<typeof RoleJobEntitySchema>;
|
|
382
|
+
|
|
383
|
+
export type UpdateGigJobOutput = z.infer<typeof GigJobEntitySchema>;
|
package/src/types/index.ts
CHANGED
package/src/types/job.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
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
|
-
JobWithGigDetailsEntitySchema,
|
|
13
|
-
JobWithRoleDetailsEntitySchema,
|
|
14
|
-
BaseJobEntitySchema,
|
|
15
|
-
JobIdSchema,
|
|
16
|
-
GetJobsOutputSchema,
|
|
17
|
-
GetJobsInputSchema,
|
|
18
|
-
GetCreatedJobsOutputSchema,
|
|
19
|
-
JobSearchDocumentSchema,
|
|
20
|
-
} from "../schemas/job";
|
|
21
|
-
|
|
22
|
-
export type BaseJobEntity = z.infer<typeof BaseJobEntitySchema>;
|
|
23
|
-
|
|
24
|
-
export type JobIdInput = z.infer<typeof JobIdSchema>;
|
|
25
|
-
|
|
26
|
-
export type JobEntity = z.infer<typeof JobEntitySchema>;
|
|
27
|
-
|
|
28
|
-
export type GigJobEntity = z.infer<typeof GigJobEntitySchema>;
|
|
29
|
-
|
|
30
|
-
export type RoleJobEntity = z.infer<typeof RoleJobEntitySchema>;
|
|
31
|
-
|
|
32
|
-
export type CreateJobInput = z.infer<typeof CreateJobInputSchema>;
|
|
33
|
-
|
|
34
|
-
export type CreateJobOutput = z.infer<typeof BaseJobEntitySchema>;
|
|
35
|
-
|
|
36
|
-
export type CreateRoleJobInput = z.infer<typeof CreateRoleJobInputSchema>;
|
|
37
|
-
|
|
38
|
-
export type CreateRoleJobOutput = z.infer<typeof RoleJobEntitySchema>;
|
|
39
|
-
|
|
40
|
-
export type CreateGigJobInput = z.infer<typeof CreateGigJobInputSchema>;
|
|
41
|
-
|
|
42
|
-
export type CreateGigJobOutput = z.infer<typeof GigJobEntitySchema>;
|
|
43
|
-
|
|
44
|
-
export type UpdateRoleJobInput = z.infer<typeof UpdateRoleJobInputSchema>;
|
|
45
|
-
|
|
46
|
-
export type UpdateRoleJobOutput = z.infer<typeof RoleJobEntitySchema>;
|
|
47
|
-
|
|
48
|
-
export type UpdateGigJobInput = z.infer<typeof UpdateGigJobInputSchema>;
|
|
49
|
-
|
|
50
|
-
export type UpdateGigJobOutput = z.infer<typeof GigJobEntitySchema>;
|
|
51
|
-
|
|
52
|
-
export type UpdateJobInput = z.infer<typeof UpdateJobInputSchema>;
|
|
53
|
-
|
|
54
|
-
export type UpdateJobOutput = z.infer<typeof BaseJobEntitySchema>;
|
|
55
|
-
|
|
56
|
-
export type GetJobOutput = z.infer<typeof BaseJobEntitySchema>;
|
|
57
|
-
|
|
58
|
-
export type JobWithGigDetailsEntity = z.infer<
|
|
59
|
-
typeof JobWithGigDetailsEntitySchema
|
|
60
|
-
>;
|
|
61
|
-
|
|
62
|
-
export type JobWithRoleDetailsEntity = z.infer<
|
|
63
|
-
typeof JobWithRoleDetailsEntitySchema
|
|
64
|
-
>;
|
|
65
|
-
|
|
66
|
-
export type GetJobsInput = z.infer<typeof GetJobsInputSchema>;
|
|
67
|
-
|
|
68
|
-
export type GetJobsOutput = z.infer<typeof GetJobsOutputSchema>;
|
|
69
|
-
|
|
70
|
-
export type GetCreatedJobsOutput = z.infer<typeof GetCreatedJobsOutputSchema>;
|
|
71
|
-
|
|
72
|
-
export type NormalizedJobEntity =
|
|
73
|
-
| JobEntity
|
|
74
|
-
| JobWithGigDetailsEntity
|
|
75
|
-
| JobWithRoleDetailsEntity;
|
|
76
|
-
|
|
77
|
-
export type JobSearchDocument = z.infer<typeof JobSearchDocumentSchema>;
|