From 15bbbdf8a0d74d2cf386ffdd7a233a907475203e Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Thu, 3 Oct 2024 14:23:52 +0700 Subject: [PATCH] fix: type quotation --- src/stores/quotations/types.ts | 37 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/src/stores/quotations/types.ts b/src/stores/quotations/types.ts index 7cc7620a..51c5ae0d 100644 --- a/src/stores/quotations/types.ts +++ b/src/stores/quotations/types.ts @@ -224,10 +224,10 @@ export type QuotationFull = { amount: number; productId: string; product: ProductRelation; - workId: string; - work: WorkRelation; - serviceId: string; - service: ServiceRelation; + workId: string | null; + work: WorkRelation | null; + serviceId: string | null; + service: ServiceRelation | null; }[]; id: string; @@ -237,8 +237,9 @@ export type QuotationFull = { totalPrice: number; urgent: boolean; workerCount: number; - payBillDate: string | Date; - paySplitCount: number; + payBillDate: string | Date | null; + paySplitCount: number | null; + paySplit: { no: number; date: string | Date; amount: number }[]; payCondition: 'Full' | 'Split' | 'BillFull' | 'BillSplit'; date: string | Date; dueDate: string | Date; @@ -261,21 +262,21 @@ export type QuotationFull = { export type QuotationPayload = { productServiceList: { - vat: number; - pricePerUnit: number; - discount: number; + vat?: number; + pricePerUnit?: number; + discount?: number; amount: number; - productId: string; - workId: string; - serviceId: string; + product: ProductRelation; + work?: WorkRelation | null; + service?: ServiceRelation | null; }[]; - urgent: boolean; customerBranchId: string; + urgent: boolean; worker: EmployeeWorker[]; workerCount: 0; - payBillDate: Date; - paySplit: Date[]; - paySplitCount: number; // int + payBillDate?: Date | null; + paySplit: { no: number; date: string | Date; amount: number }[]; + paySplitCount?: number | null; // int payCondition: 'Full' | 'Split' | 'BillFull' | 'BillSplit'; dueDate: Date; documentReceivePoint: string; @@ -288,8 +289,8 @@ export type QuotationPayload = { export type EmployeeWorker = { id?: string; - alienReferencNumber: string; - documentExpireDate: Date | undefined; + alienReferencNumber?: string; + documentExpireDate?: Date | undefined; lastNameEN: string; lastName: string; middleNameEN: string;