22 lines
503 B
TypeScript
22 lines
503 B
TypeScript
import { z } from 'zod';
|
|
import {
|
|
booleanString,
|
|
idSchema,
|
|
optionalEmail,
|
|
optionalText,
|
|
requiredText
|
|
} from './shared.schema';
|
|
|
|
export const contactCreateSchema = z.object({
|
|
clientId: requiredText('Client'),
|
|
name: requiredText('Contact name'),
|
|
role: optionalText(120),
|
|
email: optionalEmail,
|
|
phone: optionalText(80),
|
|
isPrimary: booleanString,
|
|
receivesInvoices: booleanString,
|
|
receivesContracts: booleanString
|
|
});
|
|
|
|
export const contactEditSchema = contactCreateSchema.extend(idSchema.shape);
|