fix: wrong code gen (gen one instead of bulk)

This commit is contained in:
Methapon Metanipat 2024-11-15 11:46:13 +07:00
parent d67303d5cc
commit 3a978e16de

View file

@ -188,13 +188,13 @@ export class QuotationPayment extends Controller {
},
create: {
key: `REQUEST_${year}${month}`,
value: 1,
value: quotation.worker.length,
},
update: { value: { increment: 1 } },
update: { value: { increment: quotation.worker.length } },
});
return {
create: quotation.worker.map((v) => ({
code: `TR${year}${month}${lastRequest.value.toString().padStart(6, "0")}`,
create: quotation.worker.map((v, i) => ({
code: `TR${year}${month}${(lastRequest.value - quotation.worker.length + i + 1).toString().padStart(6, "0")}`,
employeeId: v.employeeId,
requestWork: {
create: quotation.productServiceList.flatMap((item) =>