Open TinyMurky opened 2 hours ago
已確認 ICounterparty
與 ICounterpartyValidator
相同
export interface ICounterparty {
id: number;
companyId: number;
name: string;
taxId: string;
type: string;
note: string;
createdAt: number;
updatedAt: number;
}
/**
* Info: (20241105 - Murky)
* @description 這個是給前端用的 ICounterparty
*/
export const ICounterpartyValidator = z.object({
id: z.number(),
companyId: z.number(),
name: z.string(),
taxId: z.string(),
type: z.nativeEnum(CounterpartyType),
note: z.string(),
createdAt: z.number(),
updatedAt: z.number(),
});
更改 IInvoiceBetaValidator
來符合 IInvoiceBeta
/**
* Info: (20241022 - tzuhan)
* @description for frontend
* @Murky, @Jacky 這裡是參考 data model 來更新 IInvoiceBeta 的介面,需要確認是否有遺漏或錯誤
*/
export interface IInvoiceBeta {
id: number;
isComplete: boolean;
counterParty: ICounterparty; // Info: (20241108 - Tzuhan) !!! not provided by backend @Murky
inputOrOutput: InvoiceTransactionDirection;
date: number;
no: string;
currencyAlias: CurrencyType;
priceBeforeTax: number;
taxType: InvoiceTaxType;
taxRatio: number;
taxPrice: number;
totalPrice: number;
type: InvoiceType;
deductible: boolean;
createdAt: number;
updatedAt: number;
}
IInvoiceBetaValidator
/**
* Info: (20241105 - Murky)
* @description 這個是給前端用的 IInvoiceBeta
*/
export const IInvoiceBetaValidator = z.object({
id: z.number(),
isComplete: z.boolean(),
counterParty: ICounterpartyValidator,
inputOrOutput: z.nativeEnum(InvoiceTransactionDirection),
date: z.number(),
no: z.string(),
currencyAlias: z.nativeEnum(CurrencyType),
priceBeforeTax: z.number(),
taxType: z.nativeEnum(InvoiceTaxType),
taxRatio: z.number(),
taxPrice: z.number(),
totalPrice: z.number(),
type: z.nativeEnum(InvoiceType),
deductible: z.boolean(),
createdAt: z.number(),
updatedAt: z.number(),
name: z.string().describe('name of invoice, not in IInvoiceBeta right now'),
});
ICertifcate
與ICertificateValidator
export interface ICertificate {
id: number;
name: string;
companyId: number;
unRead: boolean; // Info: (20241108 - tzuhan) !!! not provided by backend yet @Murky
file: IFileBeta; // Info: (20241108 - Tzuhan) !!! removed IFileBeta and update IFile
invoice: IInvoiceBetaOptional;
voucherNo: string | null;
aiResultId?: string;
aiStatus?: string;
createdAt: number;
updatedAt: number;
uploader: string; // Info: (20241108 - tzuhan) moved from IInvoiceBetaOptional
}
export const ICertificateValidator = z.object({
id: z.number(),
name: z.string().describe('Name of certificate, but get it from Invoice'),
companyId: z.number(),
unRead: z.boolean(),
file: IFileBetaValidator, // Info: (20241105 - Murky) 使用已定義的 IFileUIBetaValidator
invoice: IInvoiceBetaValidator, // Info: (20241105 - Murky) 使用已定義的 IInvoiceBetaValidator
voucherNo: z.string().nullable(),
aiResultId: z.string().optional(),
aiStatus: z.string().optional(),
createdAt: z.number(),
updatedAt: z.number(),
uploader: z.string(),
});
Summary
修改後端傳的ICertificate和 IInvoiceBeta
Tasks
Dependencies
No response
Other Dependencies
No response
Additional Notes
No response