feat(service): add installments to payload
This commit is contained in:
parent
bfc44bc7b5
commit
65c70ffec3
1 changed files with 28 additions and 6 deletions
|
|
@ -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,
|
||||
})),
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue