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;
|
[key: string]: any;
|
||||||
};
|
};
|
||||||
status?: Status;
|
status?: Status;
|
||||||
|
/**
|
||||||
|
* @isInt
|
||||||
|
*/
|
||||||
|
installments?: number;
|
||||||
workflowId?: string;
|
workflowId?: string;
|
||||||
work?: {
|
work?: {
|
||||||
name: string;
|
name: string;
|
||||||
productId: string[];
|
product: {
|
||||||
|
id: string;
|
||||||
|
/**
|
||||||
|
* @isInt
|
||||||
|
*/
|
||||||
|
installmentNo?: number;
|
||||||
|
}[];
|
||||||
attributes?: { [key: string]: any };
|
attributes?: { [key: string]: any };
|
||||||
}[];
|
}[];
|
||||||
shared?: boolean;
|
shared?: boolean;
|
||||||
|
|
@ -72,11 +82,21 @@ type ServiceUpdate = {
|
||||||
attributes?: {
|
attributes?: {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
};
|
};
|
||||||
|
/*
|
||||||
|
* @isInt
|
||||||
|
*/
|
||||||
|
installments?: number;
|
||||||
status?: "ACTIVE" | "INACTIVE";
|
status?: "ACTIVE" | "INACTIVE";
|
||||||
workflowId?: string;
|
workflowId?: string;
|
||||||
work?: {
|
work?: {
|
||||||
name: string;
|
name: string;
|
||||||
productId: string[];
|
product: {
|
||||||
|
id: string;
|
||||||
|
/*
|
||||||
|
* @isInt
|
||||||
|
*/
|
||||||
|
installmentNo?: number;
|
||||||
|
}[];
|
||||||
attributes?: { [key: string]: any };
|
attributes?: { [key: string]: any };
|
||||||
}[];
|
}[];
|
||||||
shared?: boolean;
|
shared?: boolean;
|
||||||
|
|
@ -303,8 +323,9 @@ export class ServiceController extends Controller {
|
||||||
order: wIdx + 1,
|
order: wIdx + 1,
|
||||||
attributes: w.attributes,
|
attributes: w.attributes,
|
||||||
productOnWork: {
|
productOnWork: {
|
||||||
create: w.productId.map((p, pIdx) => ({
|
create: w.product.map((p, pIdx) => ({
|
||||||
productId: p,
|
productId: p.id,
|
||||||
|
installmentNo: p.installmentNo,
|
||||||
order: pIdx + 1,
|
order: pIdx + 1,
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
|
|
@ -385,8 +406,9 @@ export class ServiceController extends Controller {
|
||||||
order: wIdx + 1,
|
order: wIdx + 1,
|
||||||
attributes: w.attributes,
|
attributes: w.attributes,
|
||||||
productOnWork: {
|
productOnWork: {
|
||||||
create: w.productId.map((p, pIdx) => ({
|
create: w.product.map((p, pIdx) => ({
|
||||||
productId: p,
|
productId: p.id,
|
||||||
|
installmentNo: p.installmentNo,
|
||||||
order: pIdx + 1,
|
order: pIdx + 1,
|
||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue