source: src/schemas/employee.ts@ 057453c

main
Last change on this file since 057453c was 057453c, checked in by Naum Shapkarovski <naumshapkarovski@…>, 5 weeks ago

feat: implement employees

  • Property mode set to 100644
File size: 731 bytes
Line 
1import { z } from 'zod';
2
3export const employeeTableFilterValueSchema = z.union([z.string(), z.array(z.string())]);
4
5export const employeeTableFiltersSchema = z.object({
6 name: z.string(),
7 status: z.string(),
8});
9
10export const employeeStatusSchema = z.union([z.literal('active'), z.literal('inactive')]);
11
12export const employeeSchema = z.object({
13 id: z.string().optional(),
14 name: z.string(),
15 email: z.string().email(),
16 status: employeeStatusSchema.optional(),
17 iban: z.string().optional(),
18 cv: z.string().optional(),
19 photo: z.string().optional(),
20 project: z.string().optional(),
21});
22
23export const newEmployeeSchema = employeeSchema
24 .omit({
25 id: true,
26 })
27 .extend({
28 status: employeeStatusSchema,
29 });
Note: See TracBrowser for help on using the repository browser.