diff --git a/src/controllers/04-service-controller.ts b/src/controllers/04-service-controller.ts index c8b5b90..e36bf08 100644 --- a/src/controllers/04-service-controller.ts +++ b/src/controllers/04-service-controller.ts @@ -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, })), },