feat: add code customer field

This commit is contained in:
Methapon Metanipat 2024-08-23 10:33:53 +07:00
parent 03d25219c1
commit fffd20ea0f
3 changed files with 11 additions and 1 deletions

View file

@ -376,6 +376,7 @@ export class CustomerBranchController extends Controller {
data: {
...rest,
code: `${runningKey.replace("CUSTOMER_BRANCH_", "")}-${`${last.value - 1}`.padStart(2, "0")}`,
codeCustomer: runningKey.replace("CUSTOMER_BRANCH_", ""),
customer: { connect: { id: customerId } },
province: { connect: provinceId ? { id: provinceId } : undefined },
district: { connect: districtId ? { id: districtId } : undefined },