sysone-api-mapper 1.0.147 → 1.0.149

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.
Files changed (46) hide show
  1. package/{axiosInstance.js → dist/axiosInstance.js} +5 -7
  2. package/dist/index.d.ts +2 -2
  3. package/{index.ts → dist/index.js} +7 -20
  4. package/dist/services.js +92 -0
  5. package/dist/servicesData.js +996 -0
  6. package/dist/src/adapters/createApiAdapter.js +8 -0
  7. package/{src → dist/src}/adapters/financeAdapter.js +4 -5
  8. package/{src → dist/src}/adapters/locationAdapter.js +5 -6
  9. package/{src → dist/src}/adapters/partyAdapter.js +7 -8
  10. package/{src → dist/src}/components/notificationToast.js +35 -37
  11. package/dist/src/contexts/actionsContext.js +43 -0
  12. package/{src → dist/src}/contexts/apiContext.js +8 -9
  13. package/dist/src/contexts/translationContext.js +19 -0
  14. package/dist/src/mapper/Mapper.js +98 -0
  15. package/{src → dist/src}/mapper/endpointsConfig.js +821 -915
  16. package/{src → dist/src}/mapper/helpers/mappingHelpers.js +24 -26
  17. package/{src → dist/src}/mapper/modules/billing/index.js +128 -131
  18. package/{src → dist/src}/mapper/modules/claim/index.js +15 -17
  19. package/{src → dist/src}/mapper/modules/general/index.js +6 -7
  20. package/{src → dist/src}/mapper/modules/party/index.js +119 -128
  21. package/dist/src/mapper/modules/policy/index.js +573 -0
  22. package/dist/src/mapper/modules/quotation/index.js +477 -0
  23. package/{src → dist/src}/mapper/modules/request/index.js +60 -67
  24. package/dist/src/public/index.js +7 -0
  25. package/{src → dist/src}/server.js +18 -23
  26. package/package.json +4 -4
  27. package/.babelrc +0 -4
  28. package/.gitlab-ci.yml +0 -42
  29. package/config/dist/index.js +0 -307
  30. package/config/dist/index.js.LICENSE.txt +0 -1
  31. package/config/dist/index.ts +0 -319
  32. package/config/webpack.dev.js +0 -63
  33. package/config/webpack.prod.js +0 -63
  34. package/index.d.ts +0 -5
  35. package/services.js +0 -105
  36. package/servicesData.js +0 -1013
  37. package/src/adapters/createApiAdapter.ts +0 -29
  38. package/src/contexts/actionsContext.js +0 -54
  39. package/src/contexts/translationContext.js +0 -29
  40. package/src/mapper/Mapper.js +0 -141
  41. package/src/mapper/modules/policy/index.js +0 -613
  42. package/src/mapper/modules/quotation/index.js +0 -480
  43. package/src/public/index.html +0 -15
  44. package/src/public/index.js +0 -9
  45. package/test/script.js +0 -0
  46. package/tsconfig.json +0 -9
@@ -1,26 +1,24 @@
1
- export const mapPaymentFrequency = (frequencyCode) => {
2
- const mapping = {
3
- 'ANNUAL': 6,
4
- 'MONTHLY': 1,
5
- 'QUARTERLY': 3,
6
- 'SEMI_ANNUAL': 5
7
- };
8
- return mapping[frequencyCode] || 6;
9
- };
10
-
11
- export const mapProductCode = (productCode) => {
12
- const mapping = {
13
- 'SC_SC': 534,
14
- 'VI_VI_VIDA_IND_1': 120,
15
- 'OTRO_CODIGO': 0,
16
- };
17
- return mapping[productCode] || 404;
18
- };
19
-
20
- export const mapProvinceCode = (provinceCode) => {
21
- const mapping = {
22
- 'BS_AS': 1,
23
- 'CABA': 2,
24
- }
25
- return mapping[provinceCode] || 0
26
- }
1
+ export const mapPaymentFrequency = (frequencyCode) => {
2
+ const mapping = {
3
+ 'ANNUAL': 6,
4
+ 'MONTHLY': 1,
5
+ 'QUARTERLY': 3,
6
+ 'SEMI_ANNUAL': 5
7
+ };
8
+ return mapping[frequencyCode] || 6;
9
+ };
10
+ export const mapProductCode = (productCode) => {
11
+ const mapping = {
12
+ 'SC_SC': 534,
13
+ 'VI_VI_VIDA_IND_1': 120,
14
+ 'OTRO_CODIGO': 0,
15
+ };
16
+ return mapping[productCode] || 404;
17
+ };
18
+ export const mapProvinceCode = (provinceCode) => {
19
+ const mapping = {
20
+ 'BS_AS': 1,
21
+ 'CABA': 2,
22
+ };
23
+ return mapping[provinceCode] || 0;
24
+ };
@@ -1,131 +1,128 @@
1
- export const getBillingsParams = (i) => {
2
- return {}
3
- }
4
-
5
- export const getBillingsResponse = (data) => {
6
- const values = data.paymentsEndorsement.flatMap((endorsement, index) => {
7
-
8
- return endorsement.payments.map((payment, pIndex) => ({
9
- id: `${index + 1}-${pIndex + 1}`, // No tiene ID propio, uso el index + 1
10
- code: `${index + 1}-${pIndex + 1}`, // No tiene código propio, uso el index + 1
11
- billingNumber: payment.installmentNumber,
12
- billingDate: payment.paymentDate,
13
- billingExpirationDate: payment.expiration ?? payment.expirationDate,
14
- totalAmount: payment.amount,
15
- remainingAmount: payment.debt,
16
- paymentStatus: {
17
- code: payment.amount < 0 ? "UNPAID" : "PAID", // ---- Si el monto es negativo esta pago???
18
- name: payment.amount < 0 ? "Sin Pagar" : "Pagado" // ---- Si el monto es negativo esta pago???
19
- },
20
- status: {}, // ----- NO HAY STATUS
21
- name: "Sin nombre del pagador", // ----- NO HAY NOMBRE DEL PAGADOR
22
- policy: {}, // ----- NO HAY DATOS DE POLIZA
23
- billingValuesGrouping: [
24
- {
25
- type: { name: "Prima", code: "PRIME" },
26
- value: payment.amount // ----- SOLO LLEGA LA PRIMA
27
- }
28
- ],
29
- type: {
30
- name: "Factura",
31
- code: "INVOICE",
32
- },
33
- subtype: {},
34
- exchangeRate: null,
35
- billingDateFrom: "N/A",
36
- billingDateTo: "N/A",
37
- invoiceBarcode: payment.invoiceBarcode || null
38
- }));
39
- });
40
-
41
- return {
42
- values,
43
- total: values.length
44
- };
45
- };
46
- export const getDebtorsResponse = (data) => {
47
- const values = data.paymentsEndorsement
48
- .flatMap((endorsement, index) => {
49
- return endorsement.payments.map((payment, pIndex) => ({
50
- id: `${index + 1}-${pIndex + 1}`,
51
- code: `${index + 1}-${pIndex + 1}`,
52
- billingNumber: payment.installmentNumber,
53
- billingDate: payment.paymentDate,
54
- billingExpirationDate: payment.expiration ?? payment.expirationDate,
55
- totalAmount: payment.amount,
56
- remainingAmount: payment.debt,
57
- paymentStatus: {
58
- code: payment.debt < 0 ? "UNPAID" : "PAID",
59
- name: payment.debt < 0 ? "Sin Pagar" : "Pagado"
60
- },
61
- status: {},
62
- name: "Sin nombre del pagador",
63
- policy: {},
64
- billingValuesGrouping: [
65
- {
66
- type: { name: "Prima", code: "PRIME" },
67
- value: payment.amount
68
- }
69
- ],
70
- type: {
71
- name: "Factura",
72
- code: "INVOICE",
73
- },
74
- subtype: {},
75
- exchangeRate: null,
76
- billingDateFrom: "N/A",
77
- billingDateTo: "N/A",
78
- invoiceBarcode: payment.invoiceBarcode || null
79
- }));
80
- })
81
- .filter(payment => payment?.debt > 0 || payment?.remainingAmount > 0);
82
-
83
- return {
84
- values,
85
- total: values.length
86
- };
87
- };
88
-
89
- export const getCollecionsResponse = (data) => {
90
- const values = data.paymentsEndorsement.flatMap((endorsement, index) => {
91
-
92
- return endorsement.payments.map((payment, pIndex) => ({
93
- code: `${index + 1}-${pIndex + 1}`,
94
- amount: payment.amount,
95
- applyAmount: payment.debt,
96
- collectionDate: payment.paymentDate,
97
- collectionNumber: payment.installmentNumber,
98
- currency: {
99
- name: "Peso Argentino",
100
- code: "PESO_ARG",
101
- mnemonic: "ARS",
102
- symbol: "$"
103
- },
104
- name: "Sin nombre del pagador",
105
- paymentType: null,
106
- policy: {},
107
- status: {},
108
- invoiceBarcode: payment.invoiceBarcode || null,
109
- rejectionReason: payment.rejectionReason || null,
110
- expirationDate: payment.expirationDate || null,
111
- }));
112
- });
113
-
114
- return {
115
- values,
116
- total: values.length
117
- };
118
- };
119
-
120
-
121
- export const getBillingTypeResponse = () => {
122
- return {
123
- types: [
124
- {
125
- name: "Factura",
126
- code: "INVOICE",
127
- operator: null
128
- },
129
- ]
130
- }
131
- }
1
+ export const getBillingsParams = (i) => {
2
+ return {};
3
+ };
4
+ export const getBillingsResponse = (data) => {
5
+ const values = data.paymentsEndorsement.flatMap((endorsement, index) => {
6
+ return endorsement.payments.map((payment, pIndex) => {
7
+ var _a;
8
+ return ({
9
+ id: `${index + 1}-${pIndex + 1}`, // No tiene ID propio, uso el index + 1
10
+ code: `${index + 1}-${pIndex + 1}`, // No tiene código propio, uso el index + 1
11
+ billingNumber: payment.installmentNumber,
12
+ billingDate: payment.paymentDate,
13
+ billingExpirationDate: (_a = payment.expiration) !== null && _a !== void 0 ? _a : payment.expirationDate,
14
+ totalAmount: payment.amount,
15
+ remainingAmount: payment.debt,
16
+ paymentStatus: {
17
+ code: payment.amount < 0 ? "UNPAID" : "PAID", // ---- Si el monto es negativo esta pago???
18
+ name: payment.amount < 0 ? "Sin Pagar" : "Pagado" // ---- Si el monto es negativo esta pago???
19
+ },
20
+ status: {}, // ----- NO HAY STATUS
21
+ name: "Sin nombre del pagador", // ----- NO HAY NOMBRE DEL PAGADOR
22
+ policy: {}, // ----- NO HAY DATOS DE POLIZA
23
+ billingValuesGrouping: [
24
+ {
25
+ type: { name: "Prima", code: "PRIME" },
26
+ value: payment.amount // ----- SOLO LLEGA LA PRIMA
27
+ }
28
+ ],
29
+ type: {
30
+ name: "Factura",
31
+ code: "INVOICE",
32
+ },
33
+ subtype: {},
34
+ exchangeRate: null,
35
+ billingDateFrom: "N/A",
36
+ billingDateTo: "N/A",
37
+ invoiceBarcode: payment.invoiceBarcode || null
38
+ });
39
+ });
40
+ });
41
+ return {
42
+ values,
43
+ total: values.length
44
+ };
45
+ };
46
+ export const getDebtorsResponse = (data) => {
47
+ const values = data.paymentsEndorsement
48
+ .flatMap((endorsement, index) => {
49
+ return endorsement.payments.map((payment, pIndex) => {
50
+ var _a;
51
+ return ({
52
+ id: `${index + 1}-${pIndex + 1}`,
53
+ code: `${index + 1}-${pIndex + 1}`,
54
+ billingNumber: payment.installmentNumber,
55
+ billingDate: payment.paymentDate,
56
+ billingExpirationDate: (_a = payment.expiration) !== null && _a !== void 0 ? _a : payment.expirationDate,
57
+ totalAmount: payment.amount,
58
+ remainingAmount: payment.debt,
59
+ paymentStatus: {
60
+ code: payment.debt < 0 ? "UNPAID" : "PAID",
61
+ name: payment.debt < 0 ? "Sin Pagar" : "Pagado"
62
+ },
63
+ status: {},
64
+ name: "Sin nombre del pagador",
65
+ policy: {},
66
+ billingValuesGrouping: [
67
+ {
68
+ type: { name: "Prima", code: "PRIME" },
69
+ value: payment.amount
70
+ }
71
+ ],
72
+ type: {
73
+ name: "Factura",
74
+ code: "INVOICE",
75
+ },
76
+ subtype: {},
77
+ exchangeRate: null,
78
+ billingDateFrom: "N/A",
79
+ billingDateTo: "N/A",
80
+ invoiceBarcode: payment.invoiceBarcode || null
81
+ });
82
+ });
83
+ })
84
+ .filter(payment => (payment === null || payment === void 0 ? void 0 : payment.debt) > 0 || (payment === null || payment === void 0 ? void 0 : payment.remainingAmount) > 0);
85
+ return {
86
+ values,
87
+ total: values.length
88
+ };
89
+ };
90
+ export const getCollecionsResponse = (data) => {
91
+ const values = data.paymentsEndorsement.flatMap((endorsement, index) => {
92
+ return endorsement.payments.map((payment, pIndex) => ({
93
+ code: `${index + 1}-${pIndex + 1}`,
94
+ amount: payment.amount,
95
+ applyAmount: payment.debt,
96
+ collectionDate: payment.paymentDate,
97
+ collectionNumber: payment.installmentNumber,
98
+ currency: {
99
+ name: "Peso Argentino",
100
+ code: "PESO_ARG",
101
+ mnemonic: "ARS",
102
+ symbol: "$"
103
+ },
104
+ name: "Sin nombre del pagador",
105
+ paymentType: null,
106
+ policy: {},
107
+ status: {},
108
+ invoiceBarcode: payment.invoiceBarcode || null,
109
+ rejectionReason: payment.rejectionReason || null,
110
+ expirationDate: payment.expirationDate || null,
111
+ }));
112
+ });
113
+ return {
114
+ values,
115
+ total: values.length
116
+ };
117
+ };
118
+ export const getBillingTypeResponse = () => {
119
+ return {
120
+ types: [
121
+ {
122
+ name: "Factura",
123
+ code: "INVOICE",
124
+ operator: null
125
+ },
126
+ ]
127
+ };
128
+ };
@@ -1,17 +1,15 @@
1
-
2
- export const getClaims_CNP = async (response) => {
3
- const objectMapped = {
4
- values: response?.claims?.map((claim) => ({
5
- claimNumber: claim.claimNumber.toString(),
6
- policyNumber: claim.policyNumber,
7
- creationDate: claim.claimDate,
8
- status: {
9
- name: claim.status,
10
- code: "N/A"
11
- }
12
- })
13
- ),
14
- };
15
-
16
- return objectMapped;
17
- }
1
+ export const getClaims_CNP = async (response) => {
2
+ var _a;
3
+ const objectMapped = {
4
+ values: (_a = response === null || response === void 0 ? void 0 : response.claims) === null || _a === void 0 ? void 0 : _a.map((claim) => ({
5
+ claimNumber: claim.claimNumber.toString(),
6
+ policyNumber: claim.policyNumber,
7
+ creationDate: claim.claimDate,
8
+ status: {
9
+ name: claim.status,
10
+ code: "N/A"
11
+ }
12
+ })),
13
+ };
14
+ return objectMapped;
15
+ };
@@ -1,7 +1,6 @@
1
- export const getModules = () => { }
2
-
3
- export const getModules_Request = (params) => {
4
- return {
5
- roles: params.roles,
6
- }
7
- }
1
+ export const getModules = () => { };
2
+ export const getModules_Request = (params) => {
3
+ return {
4
+ roles: params.roles,
5
+ };
6
+ };
@@ -1,128 +1,119 @@
1
-
2
-
3
- export const getIdentificationTypes = async (response) => {
4
- const objectMapped = {
5
- values: response.types.map(a => ({
6
- code: a.code,
7
- name: a.name,
8
- })),
9
- }
10
- return objectMapped;
11
- }
12
-
13
- export const getCountries = async (response) => {
14
- const objectMapped = {
15
- countries: response.countries.map(a => ({
16
- code: a.code,
17
- name: a.name,
18
- areaCode: 'N/A'
19
- })),
20
- }
21
- return objectMapped;
22
- }
23
-
24
- export const getProvinces = async (response) => {
25
- const objectMapped = {
26
- provinces: response.provinces.map(a => ({
27
- name: a.name,
28
- code: a.code,
29
- country: {
30
- code: a.country.code,
31
- name: a.country.name,
32
- areaCode: "N/A"
33
- }
34
- })),
35
- }
36
- return objectMapped;
37
- }
38
-
39
- export const getMaritalStatuses = async (response) => {
40
- const objectMapped = {
41
- values: response.statuses.map(a => ({
42
- name: a.name,
43
- code: a.code,
44
- })),
45
- }
46
- return objectMapped;
47
- }
48
-
49
- export const getGenders = async (response) => {
50
- const objectMapped = {
51
- values: response.genders.map(a => ({
52
- name: a.name,
53
- code: a.code,
54
- })),
55
- }
56
- return objectMapped;
57
- }
58
-
59
- export const getProductsBySubsections_Request = (params) => {
60
- return {
61
- subsectionCode: null
62
- }
63
- }
64
-
65
- export const partySearchParams = (params) => {
66
- return {
67
- firstName: params.firstName || params.name || null,
68
- lastName: params.lastName || null,
69
- identification: params.identificationValue || null,
70
- }
71
- }
72
-
73
- export const partySearch = (res) => {
74
- const objectMapped = {
75
- values: res?.parties?.map(party => {
76
-
77
- // Separación por doble espacio
78
- const [lastNamePart, firstNamePart] = party?.fullName?.split(" ") || [];
79
-
80
- return {
81
- activeDate: party?.activeDate || null,
82
- partyCode: party?.code || null,
83
- code: party?.identification?.value || null,
84
- firstName: firstNamePart || null,
85
- lastName: lastNamePart || null,
86
- identifications: {
87
- values: [
88
- {
89
- default: true,
90
- type: {
91
- code: "",
92
- name: "",
93
- },
94
- value: party?.identification?.value || null,
95
- }
96
- ]
97
- },
98
- birthDate: party?.birthDate,
99
- insuredCode: party?.insuredCode
100
- };
101
- })
102
- };
103
-
104
- return objectMapped;
105
- };
106
-
107
-
108
- export const getCoverages = (p) => {
109
- const objectMapped = {
110
- coverages: p.coverages?.map(c => ({
111
- calculatorTypes: [],
112
- active: c.active,
113
- coverage: {
114
- code: c.coverage?.code,
115
- name: c.coverage?.description,
116
- description: c.coverage?.name,
117
- },
118
- coverageValues: c.coverageValues,
119
- type: c.type,
120
- deductibles: null,
121
- requiredDeductible: null,
122
- taxPlan: null,
123
- wordings: []
124
- }))
125
- }
126
-
127
- return objectMapped;
128
- }
1
+ export const getIdentificationTypes = async (response) => {
2
+ const objectMapped = {
3
+ values: response.types.map(a => ({
4
+ code: a.code,
5
+ name: a.name,
6
+ })),
7
+ };
8
+ return objectMapped;
9
+ };
10
+ export const getCountries = async (response) => {
11
+ const objectMapped = {
12
+ countries: response.countries.map(a => ({
13
+ code: a.code,
14
+ name: a.name,
15
+ areaCode: 'N/A'
16
+ })),
17
+ };
18
+ return objectMapped;
19
+ };
20
+ export const getProvinces = async (response) => {
21
+ const objectMapped = {
22
+ provinces: response.provinces.map(a => ({
23
+ name: a.name,
24
+ code: a.code,
25
+ country: {
26
+ code: a.country.code,
27
+ name: a.country.name,
28
+ areaCode: "N/A"
29
+ }
30
+ })),
31
+ };
32
+ return objectMapped;
33
+ };
34
+ export const getMaritalStatuses = async (response) => {
35
+ const objectMapped = {
36
+ values: response.statuses.map(a => ({
37
+ name: a.name,
38
+ code: a.code,
39
+ })),
40
+ };
41
+ return objectMapped;
42
+ };
43
+ export const getGenders = async (response) => {
44
+ const objectMapped = {
45
+ values: response.genders.map(a => ({
46
+ name: a.name,
47
+ code: a.code,
48
+ })),
49
+ };
50
+ return objectMapped;
51
+ };
52
+ export const getProductsBySubsections_Request = (params) => {
53
+ return {
54
+ subsectionCode: null
55
+ };
56
+ };
57
+ export const partySearchParams = (params) => {
58
+ return {
59
+ firstName: params.firstName || params.name || null,
60
+ lastName: params.lastName || null,
61
+ identification: params.identificationValue || null,
62
+ };
63
+ };
64
+ export const partySearch = (res) => {
65
+ var _a;
66
+ const objectMapped = {
67
+ values: (_a = res === null || res === void 0 ? void 0 : res.parties) === null || _a === void 0 ? void 0 : _a.map(party => {
68
+ var _a, _b, _c;
69
+ // Separación por doble espacio
70
+ const [lastNamePart, firstNamePart] = ((_a = party === null || party === void 0 ? void 0 : party.fullName) === null || _a === void 0 ? void 0 : _a.split(" ")) || [];
71
+ return {
72
+ activeDate: (party === null || party === void 0 ? void 0 : party.activeDate) || null,
73
+ partyCode: (party === null || party === void 0 ? void 0 : party.code) || null,
74
+ code: ((_b = party === null || party === void 0 ? void 0 : party.identification) === null || _b === void 0 ? void 0 : _b.value) || null,
75
+ firstName: firstNamePart || null,
76
+ lastName: lastNamePart || null,
77
+ identifications: {
78
+ values: [
79
+ {
80
+ default: true,
81
+ type: {
82
+ code: "",
83
+ name: "",
84
+ },
85
+ value: ((_c = party === null || party === void 0 ? void 0 : party.identification) === null || _c === void 0 ? void 0 : _c.value) || null,
86
+ }
87
+ ]
88
+ },
89
+ birthDate: party === null || party === void 0 ? void 0 : party.birthDate,
90
+ insuredCode: party === null || party === void 0 ? void 0 : party.insuredCode
91
+ };
92
+ })
93
+ };
94
+ return objectMapped;
95
+ };
96
+ export const getCoverages = (p) => {
97
+ var _a;
98
+ const objectMapped = {
99
+ coverages: (_a = p.coverages) === null || _a === void 0 ? void 0 : _a.map(c => {
100
+ var _a, _b, _c;
101
+ return ({
102
+ calculatorTypes: [],
103
+ active: c.active,
104
+ coverage: {
105
+ code: (_a = c.coverage) === null || _a === void 0 ? void 0 : _a.code,
106
+ name: (_b = c.coverage) === null || _b === void 0 ? void 0 : _b.description,
107
+ description: (_c = c.coverage) === null || _c === void 0 ? void 0 : _c.name,
108
+ },
109
+ coverageValues: c.coverageValues,
110
+ type: c.type,
111
+ deductibles: null,
112
+ requiredDeductible: null,
113
+ taxPlan: null,
114
+ wordings: []
115
+ });
116
+ })
117
+ };
118
+ return objectMapped;
119
+ };