sysone-api-mapper 1.0.116 → 1.0.118

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,6 +1,6 @@
1
1
  {
2
2
  "name": "sysone-api-mapper",
3
- "version": "1.0.116",
3
+ "version": "1.0.118",
4
4
  "description": "Paquete mapper para portal de productores",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -96,6 +96,20 @@ const billingModule = {
96
96
  responseMapper: (response) => getBillingsResponse(response.data),
97
97
  },
98
98
  },
99
+ GET_POLICY_COLLECTIONS: {
100
+ default: {
101
+ url: '/collection/v1/collections',
102
+ method: methods.GET,
103
+ requestMapper: (request) => ({ mappedParams: request }),
104
+ responseMapper: (response) => response.data,
105
+ },
106
+ cnp: {
107
+ url: 'policy/v1/policy/{0}/{1}/payments',
108
+ method: methods.GET,
109
+ requestMapper: request => ({ mappedParams: getBillingsParams(request) }),
110
+ responseMapper: (response) => getBillingsResponse(response.data),
111
+ },
112
+ },
99
113
 
100
114
  GET_BILLING_TYPE: {
101
115
  default: {
@@ -105,7 +119,7 @@ const billingModule = {
105
119
  responseMapper: (response) => response.data,
106
120
  },
107
121
  cnp: {
108
- url: 'billing/v1/billing-types',
122
+ url: 'party/v1/genders',
109
123
  method: methods.GET,
110
124
  requestMapper: request => ({ mappedParams: request }),
111
125
  responseMapper: (response) => getBillingTypeResponse(response.data),
@@ -10,7 +10,7 @@ export const getBillingsResponse = (data) => {
10
10
  code: `${index + 1}-${pIndex + 1}`, // No tiene código propio, uso el index + 1
11
11
  billingNumber: payment.installmentNumber,
12
12
  billingDate: payment.paymentDate,
13
- billingExpirationDate: payment.expirationDate ?? payment.expiration,
13
+ billingExpirationDate: payment.expiration ?? payment.expirationDate,
14
14
  totalAmount: payment.amount,
15
15
  remainingAmount: payment.debt,
16
16
  paymentStatus: {
@@ -23,10 +23,13 @@ export const getBillingsResponse = (data) => {
23
23
  billingValuesGrouping: [
24
24
  {
25
25
  type: { name: "Prima", code: "PRIME" },
26
- value: payment.amount // ----- SOLO LLEGA LA PRIMA ??? NO HAY PREMIO, GASTOS, IMPUESTOS, OTROS ?
26
+ value: payment.amount // ----- SOLO LLEGA LA PRIMA
27
27
  }
28
28
  ],
29
- type: {}, // ----- NO HAY TIPO DE FACTURACION
29
+ type: {
30
+ name: "Factura",
31
+ code: "INVOICE",
32
+ },
30
33
  subtype: {},
31
34
  exchangeRate: null,
32
35
  billingDateFrom: "N/A",
@@ -42,7 +45,7 @@ export const getBillingsResponse = (data) => {
42
45
  };
43
46
 
44
47
 
45
- export const getBillingTypeResponse = (data) => {
48
+ export const getBillingTypeResponse = () => {
46
49
  return {
47
50
  types: [
48
51
  {