sysone-api-mapper 1.0.148 → 1.0.150

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