fix: validate error
This commit is contained in:
parent
e5dcc86747
commit
2c134aa68a
1 changed files with 66 additions and 3 deletions
|
|
@ -18,7 +18,6 @@ import prisma from "../db";
|
|||
import minio from "../services/minio";
|
||||
import HttpStatus from "../interfaces/http-status";
|
||||
import HttpError from "../interfaces/http-error";
|
||||
import { CustomerBranchCreate } from "./customer-branch-controller";
|
||||
|
||||
if (!process.env.MINIO_BUCKET) {
|
||||
throw Error("Require MinIO bucket.");
|
||||
|
|
@ -32,7 +31,38 @@ export type CustomerCreate = {
|
|||
customerName: string;
|
||||
customerNameEN: string;
|
||||
taxNo?: string | null;
|
||||
customerBranch?: Omit<CustomerBranchCreate, "customerId">[];
|
||||
customerBranch?: {
|
||||
status?: Status;
|
||||
|
||||
legalPersonNo: string;
|
||||
|
||||
taxNo: string | null;
|
||||
name: string;
|
||||
nameEN: string;
|
||||
addressEN: string;
|
||||
address: string;
|
||||
zipCode: string;
|
||||
email: string;
|
||||
telephoneNo: string;
|
||||
|
||||
registerName: string;
|
||||
registerDate: Date;
|
||||
authorizedCapital: string;
|
||||
|
||||
employmentOffice: string;
|
||||
bussinessType: string;
|
||||
bussinessTypeEN: string;
|
||||
jobPosition: string;
|
||||
jobPositionEN: string;
|
||||
jobDescription: string;
|
||||
saleEmployee: string;
|
||||
payDate: string;
|
||||
wageDate: string;
|
||||
|
||||
subDistrictId?: string | null;
|
||||
districtId?: string | null;
|
||||
provinceId?: string | null;
|
||||
}[];
|
||||
};
|
||||
|
||||
export type CustomerUpdate = {
|
||||
|
|
@ -41,7 +71,40 @@ export type CustomerUpdate = {
|
|||
customerName?: string;
|
||||
customerNameEN?: string;
|
||||
taxNo?: string | null;
|
||||
customerBranch?: (Omit<CustomerBranchCreate, "customerId"> & { id?: string })[];
|
||||
customerBranch?: {
|
||||
id?: string;
|
||||
|
||||
status?: Status;
|
||||
|
||||
legalPersonNo: string;
|
||||
|
||||
taxNo: string | null;
|
||||
name: string;
|
||||
nameEN: string;
|
||||
addressEN: string;
|
||||
address: string;
|
||||
zipCode: string;
|
||||
email: string;
|
||||
telephoneNo: string;
|
||||
|
||||
registerName: string;
|
||||
registerDate: Date;
|
||||
authorizedCapital: string;
|
||||
|
||||
employmentOffice: string;
|
||||
bussinessType: string;
|
||||
bussinessTypeEN: string;
|
||||
jobPosition: string;
|
||||
jobPositionEN: string;
|
||||
jobDescription: string;
|
||||
saleEmployee: string;
|
||||
payDate: string;
|
||||
wageDate: string;
|
||||
|
||||
subDistrictId?: string | null;
|
||||
districtId?: string | null;
|
||||
provinceId?: string | null;
|
||||
}[];
|
||||
};
|
||||
|
||||
function imageLocation(id: string) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue