feat: prepare for dynamic user type

This commit is contained in:
Methapon2001 2024-04-23 11:28:44 +07:00
parent a2e38d7069
commit 3fcabd723b

View file

@ -30,10 +30,10 @@ async function userBranchCodeGen(branch: Branch, user: User[]) {
const last = await tx.runningNo.upsert({
where: {
key: `BR_USR_${branch.code.slice(4).padEnd(3, "0")}${typ !== "USER" ? typ.charAt(0) : ""}`,
key: `BR_USR_${branch.code.slice(4).padEnd(3, "0")}${typ !== "USER" ? typ.charAt(0).toLocaleUpperCase() : ""}`,
},
create: {
key: `BR_USR_${branch.code.slice(4).padEnd(3, "0")}${typ !== "USER" ? typ.charAt(0) : ""}`,
key: `BR_USR_${branch.code.slice(4).padEnd(3, "0")}${typ !== "USER" ? typ.charAt(0).toLocaleUpperCase() : ""}`,
value: 1,
},
update: { value: { increment: 1 } },