2026-07-06 10:57:33 +00:00
|
|
|
import { EmailSchema, TinSchema, WebsiteSchema } from "@erp/core";
|
|
|
|
|
import { z } from "zod/v4";
|
|
|
|
|
|
|
|
|
|
export const CompanyStatusResponseSchema = z.enum(["active", "disabled"]);
|
|
|
|
|
|
|
|
|
|
export const CompanyResponseSchema = z.object({
|
|
|
|
|
id: z.uuid(),
|
|
|
|
|
legal_name: z.string(),
|
|
|
|
|
trade_name: z.string().nullable(),
|
|
|
|
|
tin: TinSchema.nullable(),
|
|
|
|
|
slug: z.string(),
|
|
|
|
|
email: EmailSchema.nullable(),
|
|
|
|
|
phone: z.string().nullable(),
|
|
|
|
|
website: WebsiteSchema.nullable(),
|
2026-08-17 09:25:34 +00:00
|
|
|
default_payment_term_id: z.uuid().nullable(),
|
2026-07-06 10:57:33 +00:00
|
|
|
status: CompanyStatusResponseSchema,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export type CompanyResponseDTO = z.infer<typeof CompanyResponseSchema>;
|