feat(service): add installments to payload

This commit is contained in:
Methapon Metanipat 2024-10-22 11:57:14 +07:00
parent bfc44bc7b5
commit 65c70ffec3

View file

@ -55,10 +55,20 @@ type ServiceCreate = {
[key: string]: any;
};
status?: Status;
/**
* @isInt
*/
installments?: number;
workflowId?: string;
work?: {
name: string;
productId: string[];
product: {
id: string;
/**
* @isInt
*/
installmentNo?: number;
}[];
attributes?: { [key: string]: any };
}[];
shared?: boolean;
@ -72,11 +82,21 @@ type ServiceUpdate = {
attributes?: {
[key: string]: any;
};
/*
* @isInt
*/
installments?: number;
status?: "ACTIVE" | "INACTIVE";
workflowId?: string;
work?: {
name: string;
productId: string[];
product: {
id: string;
/*
* @isInt
*/
installmentNo?: number;
}[];
attributes?: { [key: string]: any };
}[];
shared?: boolean;
@ -303,8 +323,9 @@ export class ServiceController extends Controller {
order: wIdx + 1,
attributes: w.attributes,
productOnWork: {
create: w.productId.map((p, pIdx) => ({
productId: p,
create: w.product.map((p, pIdx) => ({
productId: p.id,
installmentNo: p.installmentNo,
order: pIdx + 1,
})),
},
@ -385,8 +406,9 @@ export class ServiceController extends Controller {
order: wIdx + 1,
attributes: w.attributes,
productOnWork: {
create: w.productId.map((p, pIdx) => ({
productId: p,
create: w.product.map((p, pIdx) => ({
productId: p.id,
installmentNo: p.installmentNo,
order: pIdx + 1,
})),
},