sysone-api-mapper 1.0.47 → 1.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -393,6 +393,20 @@ export const tenantsConfig = {
|
|
|
393
393
|
responseMapper: (response) => getQuotationsList(response)
|
|
394
394
|
}
|
|
395
395
|
},
|
|
396
|
+
GET_QUOTATION_DETAILS: {
|
|
397
|
+
default: {
|
|
398
|
+
url: '{0}/v1/quotations/{1}',
|
|
399
|
+
method: methods.GET,
|
|
400
|
+
requestMapper: (request) => ({ mappedParams: request }),
|
|
401
|
+
responseMapper: (response) => response
|
|
402
|
+
},
|
|
403
|
+
cnp: {
|
|
404
|
+
url: 'quotation/v1/quotations/{0}',
|
|
405
|
+
method: methods.GET,
|
|
406
|
+
requestMapper: request => ({ mappedParams: request }),
|
|
407
|
+
responseMapper: (response) => response
|
|
408
|
+
}
|
|
409
|
+
},
|
|
396
410
|
|
|
397
411
|
//------------- POST -----------------------------
|
|
398
412
|
POST_INSURED_UPDATE: {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { mapPaymentFrequency, mapProductCode } from "../../helpers/mappingHelpers";
|
|
2
2
|
|
|
3
3
|
export const getQuotationsList = async (response) => {
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const quotations = Array.isArray(response?.quotations)
|
|
5
|
+
? response.quotations.map(q => ({
|
|
6
6
|
code: q.code || null,
|
|
7
7
|
creationDate: q.creationDate || null,
|
|
8
8
|
email: q.email || null,
|
|
9
9
|
expirationDate: q.expirationDate || null,
|
|
10
10
|
number: q.number || null,
|
|
11
11
|
paymentFrequency: {
|
|
12
|
-
name: q.paymentFrequency
|
|
13
|
-
code: q.paymentFrequency
|
|
12
|
+
name: q.paymentFrequency?.name || null,
|
|
13
|
+
code: q.paymentFrequency?.code || null,
|
|
14
14
|
},
|
|
15
15
|
product: {
|
|
16
|
-
code: q.product?.code
|
|
17
|
-
name: q.product?.name,
|
|
16
|
+
code: q.product?.code?.toString() || null,
|
|
17
|
+
name: q.product?.name || null,
|
|
18
18
|
subsection: {
|
|
19
19
|
code: q.product?.subsection?.code || null,
|
|
20
20
|
name: q.product?.subsection?.name || null,
|
|
@@ -26,13 +26,18 @@ export const getQuotationsList = async (response) => {
|
|
|
26
26
|
version: q.product?.version || 0,
|
|
27
27
|
},
|
|
28
28
|
status: {
|
|
29
|
-
code: q.status
|
|
30
|
-
name: q.status
|
|
29
|
+
code: q.status?.code || null,
|
|
30
|
+
name: q.status?.name || null,
|
|
31
31
|
},
|
|
32
|
-
}))
|
|
33
|
-
|
|
32
|
+
}))
|
|
33
|
+
: [];
|
|
34
|
+
|
|
35
|
+
const total = response?.total ? response.total : 0;
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
quotations,
|
|
39
|
+
total,
|
|
34
40
|
};
|
|
35
|
-
return objectMapped;
|
|
36
41
|
};
|
|
37
42
|
|
|
38
43
|
export const getQuotationByCode = async (response) => {
|