This commit is contained in:
@@ -1,6 +1,16 @@
|
|||||||
import { z } from "zod";
|
import { z } from "zod";
|
||||||
|
|
||||||
import { createApiResponseSchema } from "./Factory";
|
import { createApiResponseSchema } from "./Factory";
|
||||||
|
|
||||||
|
const nullableStringArraySchema = z
|
||||||
|
.array(z.string())
|
||||||
|
.nullish()
|
||||||
|
.transform((value) => value ?? []);
|
||||||
|
|
||||||
|
const nullableArraySchema = z
|
||||||
|
.array(z.any())
|
||||||
|
.nullish()
|
||||||
|
.transform((value) => value ?? []);
|
||||||
export interface IAddress {
|
export interface IAddress {
|
||||||
street: string;
|
street: string;
|
||||||
city: string;
|
city: string;
|
||||||
@@ -57,16 +67,21 @@ export const companySchema = z.object({
|
|||||||
phone: z.string().optional(),
|
phone: z.string().optional(),
|
||||||
website: z.string(),
|
website: z.string(),
|
||||||
type: z.string(),
|
type: z.string(),
|
||||||
|
status: z.string().optional(),
|
||||||
description: z.string(),
|
description: z.string(),
|
||||||
founded_year: z.number(),
|
founded_year: z.number().nullish(),
|
||||||
employee_count: z.number(),
|
employee_count: z.number().nullish(),
|
||||||
annual_revenue: z.number(),
|
annual_revenue: z.number().nullish(),
|
||||||
currency: z.string(),
|
currency: z.string(),
|
||||||
industry: z.string(),
|
industry: z.string(),
|
||||||
language: z.string(),
|
language: z.string(),
|
||||||
tax_id: z.string(),
|
tax_id: z.string(),
|
||||||
registration_number: z.string(),
|
registration_number: z.string(),
|
||||||
timezone: z.string(),
|
timezone: z.string(),
|
||||||
|
is_verified: z.boolean().optional(),
|
||||||
|
is_compliant: z.boolean().optional(),
|
||||||
|
created_at: z.number().optional(),
|
||||||
|
updated_at: z.number().optional(),
|
||||||
address: z.object({
|
address: z.object({
|
||||||
street: z.string(),
|
street: z.string(),
|
||||||
city: z.string(),
|
city: z.string(),
|
||||||
@@ -85,13 +100,14 @@ export const companySchema = z.object({
|
|||||||
position: z.string(),
|
position: z.string(),
|
||||||
is_primary: z.boolean(),
|
is_primary: z.boolean(),
|
||||||
})
|
})
|
||||||
|
.nullable()
|
||||||
.optional(),
|
.optional(),
|
||||||
tags: z.object({
|
tags: z.object({
|
||||||
keywords: z.array(z.string()).or(z.null()).optional(),
|
keywords: nullableStringArraySchema,
|
||||||
categories: z.array(z.any()).or(z.null()).optional(),
|
categories: nullableArraySchema,
|
||||||
specializations: z.array(z.string()).or(z.null()).optional(),
|
specializations: nullableStringArraySchema,
|
||||||
certifications: z.array(z.string()).or(z.null()).optional(),
|
certifications: nullableStringArraySchema,
|
||||||
cpv_codes: z.array(z.string()).or(z.null()).optional(),
|
cpv_codes: nullableStringArraySchema,
|
||||||
}),
|
}),
|
||||||
document_file_ids: z.array(z.string()).or(z.null()).optional(),
|
document_file_ids: z.array(z.string()).or(z.null()).optional(),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user