sysone-api-mapper 1.0.133 → 1.0.134
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
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
2
|
+
"name": "sysone-api-mapper",
|
|
3
|
+
"version": "1.0.134",
|
|
4
|
+
"description": "Paquete mapper para portal de productores",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "node src/server.js",
|
|
8
|
+
"dev": "nodemon src/server.js",
|
|
9
|
+
"build": "webpack --config config/webpack.dev.js",
|
|
10
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [],
|
|
13
|
+
"author": "",
|
|
14
|
+
"license": "ISC",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@babel/core": "^7.21.0",
|
|
17
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
18
|
+
"@babel/preset-env": "^7.20.2",
|
|
19
|
+
"@babel/preset-react": "^7.18.6",
|
|
20
|
+
"antd": "^4.21.4",
|
|
21
|
+
"axios": "^1.6.0",
|
|
22
|
+
"babel-loader": "^9.1.2",
|
|
23
|
+
"cors": "^2.8.5",
|
|
24
|
+
"dayjs": "^1.11.19",
|
|
25
|
+
"dotenv": "^16.0.3",
|
|
26
|
+
"express": "^4.21.2",
|
|
27
|
+
"os-browserify": "^0.3.0",
|
|
28
|
+
"path-browserify": "^1.0.1",
|
|
29
|
+
"process": "^0.11.10",
|
|
30
|
+
"react": "^17.0.2",
|
|
31
|
+
"react-dom": "^17.0.2",
|
|
32
|
+
"webpack": "^5.57.1",
|
|
33
|
+
"webpack-cli": "^5.0.1",
|
|
34
|
+
"webpack-node-externals": "^3.0.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"dotenv-webpack": "^8.1.0",
|
|
38
|
+
"jest": "^29.7.0",
|
|
39
|
+
"nodemon": "^2.0.22",
|
|
40
|
+
"os-browserify": "^0.3.0",
|
|
41
|
+
"path-browserify": "^1.0.1"
|
|
42
|
+
},
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "git+https://gitlab.sysone.com/sysone-cloud-ready/sales-platform/api-mapper/-/tree/develop?ref_type=heads"
|
|
46
|
+
},
|
|
47
|
+
"private": false
|
|
48
48
|
}
|
|
@@ -342,7 +342,7 @@ const partyModule = {
|
|
|
342
342
|
|
|
343
343
|
GET_PARTIES: {
|
|
344
344
|
default: {
|
|
345
|
-
url: 'party/v1/
|
|
345
|
+
url: 'party/v1/{0}',
|
|
346
346
|
method: methods.GET,
|
|
347
347
|
source: "https://apidoc.sysone.com/party/v1/open-api.html#/paths/~1v1~1individuals/get",
|
|
348
348
|
requestMapper: (request) => ({ mappedParams: request }),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
2
|
|
|
3
3
|
const getInsureds_CNP = async (response) => {
|
|
4
4
|
const objectMapped = {
|
|
@@ -53,15 +53,15 @@ const getEndorsements_CNP = async (response) => {
|
|
|
53
53
|
const objectMapped = {
|
|
54
54
|
values:
|
|
55
55
|
response.endorsements.map((e) => ({
|
|
56
|
-
activeDate: e.dateFrom ?
|
|
56
|
+
activeDate: e.dateFrom ? dayjs(e.dateFrom, 'DD/MM/YYYY').toISOString() : null,
|
|
57
57
|
number: e.number,
|
|
58
58
|
type: {
|
|
59
59
|
code: e.detail,
|
|
60
60
|
name: e.detail,
|
|
61
61
|
group: {}
|
|
62
62
|
},
|
|
63
|
-
validityFrom: e.dateFrom ?
|
|
64
|
-
validityTo: e.dateTo ?
|
|
63
|
+
validityFrom: e.dateFrom ? dayjs(e.dateFrom, 'DD/MM/YYYY').toISOString() : null,
|
|
64
|
+
validityTo: e.dateTo ? dayjs(e.dateTo, 'DD/MM/YYYY').toISOString() : null,
|
|
65
65
|
}))
|
|
66
66
|
,
|
|
67
67
|
total: response.endorsements.length,
|
|
@@ -85,9 +85,9 @@ const getPolicies_CNP = async (response) => {
|
|
|
85
85
|
const objectMapped = {
|
|
86
86
|
values: response.policies.map((p) => ({
|
|
87
87
|
number: p.number,
|
|
88
|
-
validityFrom: p.issueDate ?
|
|
88
|
+
validityFrom: p.issueDate ? dayjs(p.issueDate, 'DD/MM/YYYY').toISOString() : null,
|
|
89
89
|
validityTo: "N/A",
|
|
90
|
-
ingress: p.issueDate ?
|
|
90
|
+
ingress: p.issueDate ? dayjs(p.issueDate, 'DD/MM/YYYY').toISOString() : null,
|
|
91
91
|
holder: {
|
|
92
92
|
name: p.holder?.name || p.holder?.firstName,
|
|
93
93
|
identifications: {
|
|
@@ -314,10 +314,10 @@ const getPolicyCollectiveDetail_CNP = async (response) => {
|
|
|
314
314
|
code: response?.currency?.code || null,
|
|
315
315
|
months: "N/A"
|
|
316
316
|
},
|
|
317
|
-
dateFrom: response?.vigencyDateFrom ?
|
|
318
|
-
dateTo: response?.vigencyDateTo ?
|
|
317
|
+
dateFrom: response?.vigencyDateFrom ? dayjs(response.vigencyDateFrom, 'YYYY/MM/DD').toISOString() : null,
|
|
318
|
+
dateTo: response?.vigencyDateTo ? dayjs(response.vigencyDateTo, 'YYYY/MM/DD').toISOString() : null,
|
|
319
319
|
},
|
|
320
|
-
creationDate: response?.issueDate ?
|
|
320
|
+
creationDate: response?.issueDate ? dayjs(response.issueDate, 'YYYY/MM/DD').toISOString() : null,
|
|
321
321
|
renewable: true,
|
|
322
322
|
process: {
|
|
323
323
|
name: response?.status?.name || null,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { mapPaymentFrequency, mapProductCode } from "../../helpers/mappingHelpers";
|
|
2
|
-
import
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
3
|
|
|
4
4
|
const normalizeDateToYYYYMMDD = (date) => {
|
|
5
5
|
if (!date) return null;
|
|
6
6
|
|
|
7
7
|
const formats = ['DD/MM/YYYY', 'YYYY/MM/DD'];
|
|
8
|
-
const parsed =
|
|
8
|
+
const parsed = dayjs(date, formats, true);
|
|
9
9
|
|
|
10
10
|
return parsed.isValid()
|
|
11
11
|
? parsed.format('YYYY/MM/DD')
|