diff --git a/src/controllers/03-customer-branch-controller.ts b/src/controllers/03-customer-branch-controller.ts index 98d7501..0f8e9ca 100644 --- a/src/controllers/03-customer-branch-controller.ts +++ b/src/controllers/03-customer-branch-controller.ts @@ -59,24 +59,28 @@ function attachmentLocation(customerId: string, branchId: string) { return `customer/${customerId}/branch/${branchId}`; } -export type CustomerBranchCreate = ( - | { - // NOTE: About (Natural Person) - citizenId: string; - } - | { - // NOTE: About (Legal Entity) - legalPersonNo: string; - registerName: string; - registerNameEN: string; - registerDate: Date; - authorizedCapital: string; - authorizedName: string; - authorizedNameEN: string; - } -) & { +export type CustomerBranchCreate = { customerId: string; - customerName: string; + + // NOTE: About (Natural Person) + citizenId?: string; + namePrefix?: string; + firstName?: string; + firstNameEN?: string; + lastName?: string; + lastNameEN?: string; + gender?: string; + birthDate?: Date; + + // NOTE: About (Legal Entity) + legalPersonNo?: string; + registerName?: string; + registerNameEN?: string; + registerDate?: Date; + authorizedCapital?: string; + authorizedName?: string; + authorizedNameEN?: string; + customerName?: string; telephoneNo: string; diff --git a/src/controllers/03-customer-controller.ts b/src/controllers/03-customer-controller.ts index a804dc0..2e07d49 100644 --- a/src/controllers/03-customer-controller.ts +++ b/src/controllers/03-customer-controller.ts @@ -51,23 +51,26 @@ export type CustomerCreate = { status?: Status; selectedImage?: string; - branch: (( - | { - // NOTE: About (Natural Person) - citizenId: string; - } - | { - // NOTE: About (Legal Entity) - legalPersonNo: string; - registerName: string; - registerNameEN: string; - registerDate: Date; - authorizedCapital: string; - authorizedName: string; - authorizedNameEN: string; - } - ) & { - customerName: string; + branch: { + // NOTE: About (Natural Person) + citizenId?: string; + namePrefix?: string; + firstName?: string; + firstNameEN?: string; + lastName?: string; + lastNameEN?: string; + gender?: string; + birthDate?: Date; + + // NOTE: About (Legal Entity) + legalPersonNo?: string; + registerName?: string; + registerNameEN?: string; + registerDate?: Date; + authorizedCapital?: string; + authorizedName?: string; + authorizedNameEN?: string; + customerName?: string; telephoneNo: string; @@ -102,7 +105,7 @@ export type CustomerCreate = { subDistrictId?: string | null; districtId?: string | null; provinceId?: string | null; - })[]; + }[]; }; export type CustomerUpdate = {