@provis/provis-common-be-module 2.5.41 → 2.6.1
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/dist/class/main.repository.js +4 -4
- package/dist/constants/claim/cargo.d.ts +117 -1
- package/dist/constants/claim/general.js +1 -1
- package/dist/constants/claim/kalog.js +1 -1
- package/dist/constants/claim/loket.js +40 -40
- package/dist/constants/claim/motorVehicle.js +1 -1
- package/dist/constants/claim/travel.js +1 -1
- package/dist/constants/config.js +2 -2
- package/dist/constants/product/cargo/status.d.ts +45 -0
- package/dist/constants/product/cargo/status.js +47 -0
- package/dist/constants/product/occupation.d.ts +3 -3
- package/dist/constants/product/occupation.js +1712 -12
- package/dist/constants/product/property/area.json +720 -0
- package/dist/constants/product/property/clause.d.ts +17 -0
- package/dist/constants/product/property/clause.js +30 -0
- package/dist/constants/product/property/compulsory.d.ts +17 -0
- package/dist/constants/product/property/compulsory.js +30 -0
- package/dist/constants/product/property/occupation-simple.d.ts +9 -0
- package/dist/constants/product/property/occupation-simple.js +354 -0
- package/dist/constants/product/property/property.d.ts +72 -0
- package/dist/constants/product/property/property.js +239 -0
- package/dist/constants/product.js +15 -15
- package/dist/helpers/amountDescription.js +1 -1
- package/dist/helpers/axiosGet.js +1 -1
- package/dist/helpers/axiosPost.js +1 -1
- package/dist/helpers/axiosPut.js +1 -1
- package/dist/helpers/calculateByType.js +1 -1
- package/dist/helpers/calculateForNullable.js +5 -5
- package/dist/helpers/getHeaderUser.js +4 -4
- package/dist/helpers/loop.js +2 -2
- package/dist/helpers/loopBackward.js +2 -2
- package/dist/helpers/readExcel.d.ts +0 -2
- package/package.json +3 -2
- package/dist/constants/bankAccount.d.ts +0 -8
- package/dist/constants/bankAccount.js +0 -54
- package/dist/constants/product/mv.d.ts +0 -30
- package/dist/constants/product/mv.js +0 -158
- package/dist/constants/product/property/occupation.d.ts +0 -5
- package/dist/constants/product/property/occupation.js +0 -1725
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.classOfInsurance = exports.deductible = exports.floodZone = exports.additionalCoverage = exports.classConstruction = void 0;
|
|
4
|
+
const classConstruction = [
|
|
5
|
+
{
|
|
6
|
+
code: 'construction-1',
|
|
7
|
+
desc: {
|
|
8
|
+
en: 'Construction Class 1 (Max 9 Floor)',
|
|
9
|
+
id: 'Kelas Kontruksi 1',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
code: 'construction-1-9',
|
|
14
|
+
desc: {
|
|
15
|
+
en: 'Construction Class 1 (More then 9 Floor)',
|
|
16
|
+
id: 'Kelas Kontruksi 1',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
code: 'construction-2',
|
|
21
|
+
desc: {
|
|
22
|
+
en: 'Construction Class 2',
|
|
23
|
+
id: 'Kelas Kontruksi 2',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
code: 'construction-3',
|
|
28
|
+
desc: {
|
|
29
|
+
en: 'Construction Class 3',
|
|
30
|
+
id: 'Kelas Kontruksi 3',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
exports.classConstruction = classConstruction;
|
|
35
|
+
const additionalCoverage = [
|
|
36
|
+
{
|
|
37
|
+
code: 'FLEXAS',
|
|
38
|
+
desc: {
|
|
39
|
+
en: 'Fire, Lightning, Explosion, Aircraft Impact, and Smoke',
|
|
40
|
+
id: 'Kebakaran, Petir, Ledakan, Kejatuhan Pesawat Terbang, dan Asap',
|
|
41
|
+
},
|
|
42
|
+
insuredPerils: {
|
|
43
|
+
true: {
|
|
44
|
+
desc: {
|
|
45
|
+
en: 'All risk of physical accidental loss or damage to interest insured',
|
|
46
|
+
id: '',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
deductible: [
|
|
51
|
+
'PROPERTY_DEDUCT01',
|
|
52
|
+
'PROPERTY_DEDUCT05',
|
|
53
|
+
'PROPERTY_DEDUCT06',
|
|
54
|
+
'PROPERTY_DEDUCT07',
|
|
55
|
+
],
|
|
56
|
+
isDefault: true,
|
|
57
|
+
classOfInsurance: [
|
|
58
|
+
'coi-1',
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
code: 'RSMDCC',
|
|
63
|
+
desc: {
|
|
64
|
+
en: 'Riots, Strikes Malicious Damage and Civil Commotions Endorsement (Endorsemen Huru-hara)',
|
|
65
|
+
id: 'Endorsemen Kerusuhan, Pemogokan, Perbuatan Jahat, Perusakan, dan Keonaran Sipil',
|
|
66
|
+
},
|
|
67
|
+
insuredPerils: {
|
|
68
|
+
true: {
|
|
69
|
+
desc: {
|
|
70
|
+
en: 'Including Riots, Strikes Malicious Damage and Civil Commotions Endorsement (Endorsemen Huru-hara) (Code: 4.1B/2007) 4.1B - PAR/IAR (AAUI SK NO. 03\'07 - AMENDED)/2008',
|
|
71
|
+
id: '',
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
false: {
|
|
75
|
+
desc: {
|
|
76
|
+
en: 'Excluding Riots, Strikes Malicious Damage and Civil Commotions Endorsement (Endorsemen Huru-hara) (Code: 4.1B/2007) 4.1B - PAR/IAR (AAUI SK NO. 03\'07 - AMENDED)/2008',
|
|
77
|
+
id: '',
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
deductible: [
|
|
82
|
+
'PROPERTY_DEDUCT02',
|
|
83
|
+
],
|
|
84
|
+
isDefault: false,
|
|
85
|
+
classOfInsurance: [
|
|
86
|
+
'coi-1',
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
code: 'TSFWD',
|
|
91
|
+
desc: {
|
|
92
|
+
en: 'Tsunami, Including Flood, Windstorm, Tempest and Water Damage',
|
|
93
|
+
id: 'Tsunami, termasuk Banjir, Badai Angin, Angin Ribut, dan Kerusakan akibat Air',
|
|
94
|
+
},
|
|
95
|
+
insuredPerils: {
|
|
96
|
+
true: {
|
|
97
|
+
desc: {
|
|
98
|
+
en: 'Including Flood, Windstorm, Tempest and Water Damage',
|
|
99
|
+
id: '',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
false: {
|
|
103
|
+
desc: {
|
|
104
|
+
en: 'Excluding Flood, Windstorm, Tempest and Water Damage',
|
|
105
|
+
id: '',
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
deductible: [
|
|
110
|
+
'PROPERTY_DEDUCT03',
|
|
111
|
+
],
|
|
112
|
+
isDefault: false,
|
|
113
|
+
classOfInsurance: [
|
|
114
|
+
'coi-1',
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
code: 'EQ',
|
|
119
|
+
desc: {
|
|
120
|
+
en: 'Earthquake, Volcanic Eruption, Fire and Explosion',
|
|
121
|
+
id: 'Gempa Bumi, Letusan Gunung Berapi, Kebakaran, dan Ledakan',
|
|
122
|
+
},
|
|
123
|
+
insuredPerils: {
|
|
124
|
+
true: {
|
|
125
|
+
desc: {
|
|
126
|
+
en: 'Including Earthquake, Volcanic Eruption, Fire and Explosion following Earthquake and/or Volcanic Eruption and Tsunami',
|
|
127
|
+
id: '',
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
false: {
|
|
131
|
+
desc: {
|
|
132
|
+
en: 'Excluding Earthquake, Volcanic Eruption, Fire and Explosion following Earthquake and/or Volcanic Eruption and Tsunami',
|
|
133
|
+
id: '',
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
deductible: [
|
|
138
|
+
'PROPERTY_DEDUCT04',
|
|
139
|
+
],
|
|
140
|
+
isDefault: false,
|
|
141
|
+
classOfInsurance: [
|
|
142
|
+
'coi-2',
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
];
|
|
146
|
+
exports.additionalCoverage = additionalCoverage;
|
|
147
|
+
const floodZone = [
|
|
148
|
+
{
|
|
149
|
+
code: 'flood-1',
|
|
150
|
+
desc: {
|
|
151
|
+
en: 'Jakarta, Banten & West Java',
|
|
152
|
+
id: 'Jakarta, Banten & Jawa Barat',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
code: 'flood-2',
|
|
157
|
+
desc: {
|
|
158
|
+
en: 'Outside Jakarta, Banten & West Java',
|
|
159
|
+
id: 'Diluar Jakarta, Banten & West Java',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
];
|
|
163
|
+
exports.floodZone = floodZone;
|
|
164
|
+
const deductible = [
|
|
165
|
+
{
|
|
166
|
+
code: 'PROPERTY_DEDUCT01',
|
|
167
|
+
order: 1,
|
|
168
|
+
desc: {
|
|
169
|
+
'id': '',
|
|
170
|
+
'en': 'Fire, Lightning, Explosion, Impact of falling aircraft and Smoke Damage: NIL',
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
code: 'PROPERTY_DEDUCT02',
|
|
175
|
+
order: 2,
|
|
176
|
+
desc: {
|
|
177
|
+
'id': '',
|
|
178
|
+
'en': 'Riots, Strikes, Malicious Damage and Civil Commotions Endorsement (Endorsemen Huru-Hara) (Code: 4.1B/2007) 4.1BPAR/IAR (AAUI SK No. 03\'07-Amended)/2008: 5% of recoverable claim amount subject to minimum IDR 5.000.000 for any one occurrence.',
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
code: 'PROPERTY_DEDUCT03',
|
|
183
|
+
order: 3,
|
|
184
|
+
desc: {
|
|
185
|
+
'id': '',
|
|
186
|
+
'en': 'Flood, Windstorm, Tempest and Water Damage, Landslide, Landslip, Subsidance: 10% of recoverable claim amount',
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
code: 'PROPERTY_DEDUCT04',
|
|
191
|
+
order: 4,
|
|
192
|
+
desc: {
|
|
193
|
+
'id': '',
|
|
194
|
+
'en': 'Earthquake, Volcanic Eruption and Tsunami: 2.5% of Total Sum Insured',
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
code: 'PROPERTY_DEDUCT05',
|
|
199
|
+
order: 5,
|
|
200
|
+
desc: {
|
|
201
|
+
'id': '',
|
|
202
|
+
'en': 'Third Party Property Damage: IDR 500.000 for any one occurrence',
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
code: 'PROPERTY_DEDUCT06',
|
|
207
|
+
order: 6,
|
|
208
|
+
desc: {
|
|
209
|
+
'id': '',
|
|
210
|
+
'en': 'Others include theft burglary: IDR 500.000 for any one occurrence',
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
code: 'PROPERTY_DEDUCT07',
|
|
215
|
+
order: 7,
|
|
216
|
+
desc: {
|
|
217
|
+
'id': '',
|
|
218
|
+
'en': 'Vehicle Impact: NIL',
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
];
|
|
222
|
+
exports.deductible = deductible;
|
|
223
|
+
const classOfInsurance = [
|
|
224
|
+
{
|
|
225
|
+
code: 'coi-1',
|
|
226
|
+
desc: {
|
|
227
|
+
en: 'Property All Risk',
|
|
228
|
+
id: '',
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
code: 'coi-2',
|
|
233
|
+
desc: {
|
|
234
|
+
en: 'Earthquake, Volcanic Eruption and Tsunami',
|
|
235
|
+
id: '',
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
];
|
|
239
|
+
exports.classOfInsurance = classOfInsurance;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const occupation_simple_1 = require("./product/property/occupation-simple");
|
|
4
4
|
const product = {
|
|
5
|
-
LIST: {},
|
|
6
|
-
MANUAL_LIST: [],
|
|
5
|
+
LIST: {}, // ini buat semua product
|
|
6
|
+
MANUAL_LIST: [], // ini buat product yang bisa diadd manual -> di form quotation / policy
|
|
7
7
|
CARGO_BY_SYSTEM_LIST: [],
|
|
8
8
|
PRODUCT_CODE_PROPERTY_ALL_RISK: 'polismall-property-allrisk',
|
|
9
9
|
PRODUCT_CODE_EARTHQUAKE: 'polismall-earthquake',
|
|
@@ -52,17 +52,17 @@ const product = {
|
|
|
52
52
|
PRODUCT_CODE_CARGO_BUNDLE: 'polismall-cargo-bundle',
|
|
53
53
|
PRODUCT_CODE_MERIMEN_CARGO: 'polismall-merimen-cargo',
|
|
54
54
|
PRODUCT_CODE_CARGO_TEMAS: 'polismall-cargo-temas',
|
|
55
|
-
PRODUCT_CODE_CARGO_SINGLE_SHIPMENT: 'polismall-cargo-single-shipment',
|
|
55
|
+
PRODUCT_CODE_CARGO_SINGLE_SHIPMENT: 'polismall-cargo-single-shipment', // Marine Cargo Single Shipment, buat add manual di policy
|
|
56
56
|
// OTTO
|
|
57
|
-
PRODUCT_CODE_OTTO_CI: 'polismall-otto-critical-illness',
|
|
58
|
-
PRODUCT_CODE_OTTO_FLEXAS: 'polismall-otto-flexas',
|
|
59
|
-
PRODUCT_CODE_OTTO_CRACK_SCREEN: 'polismall-otto-crack',
|
|
60
|
-
PRODUCT_CODE_OTTO_AUM_GP: 'polismall-otto-aum-gp',
|
|
61
|
-
PRODUCT_CODE_OTTO_AUM_PLN: 'polismall-otto-aum-pln',
|
|
62
|
-
PRODUCT_CODE_OTTO_AUM_PDAM: 'polismall-otto-aum-pdam',
|
|
63
|
-
PRODUCT_CODE_OTTO_AUM_SB: 'polismall-otto-aum-sb',
|
|
64
|
-
PRODUCT_CODE_OTTO_AUM_FB: 'polismall-otto-aum-fb',
|
|
65
|
-
PRODUCT_CODE_OTTO_AUM_FBK: 'polismall-otto-aum-fbk',
|
|
57
|
+
PRODUCT_CODE_OTTO_CI: 'polismall-otto-critical-illness', // ELI
|
|
58
|
+
PRODUCT_CODE_OTTO_FLEXAS: 'polismall-otto-flexas', // MNC
|
|
59
|
+
PRODUCT_CODE_OTTO_CRACK_SCREEN: 'polismall-otto-crack', // MNC
|
|
60
|
+
PRODUCT_CODE_OTTO_AUM_GP: 'polismall-otto-aum-gp', // AUM Gamers Protection
|
|
61
|
+
PRODUCT_CODE_OTTO_AUM_PLN: 'polismall-otto-aum-pln', // AUM Biller Protection PLN
|
|
62
|
+
PRODUCT_CODE_OTTO_AUM_PDAM: 'polismall-otto-aum-pdam', // AUM Biller Protection PDAM
|
|
63
|
+
PRODUCT_CODE_OTTO_AUM_SB: 'polismall-otto-aum-sb', // AUM Merchant Protection Stock Barang
|
|
64
|
+
PRODUCT_CODE_OTTO_AUM_FB: 'polismall-otto-aum-fb', // AUM Merchant Protection FLEXAS+BANJIR
|
|
65
|
+
PRODUCT_CODE_OTTO_AUM_FBK: 'polismall-otto-aum-fbk', // AUM Merchant Protection FLEXAS+BANJIR+KEBONGKARAN
|
|
66
66
|
// BDKI
|
|
67
67
|
PRODUCT_CODE_BDKI_MOTOR: 'polismall-bdki-motor',
|
|
68
68
|
PRODUCT_CODE_BDKI_RUMAH: 'polismall-bdki-rumah',
|
|
@@ -114,12 +114,12 @@ product.LIST = {
|
|
|
114
114
|
[product.PRODUCT_CODE_PROPERTY_ALL_RISK]: {
|
|
115
115
|
value: product.PRODUCT_CODE_PROPERTY_ALL_RISK,
|
|
116
116
|
name: "Property All Risk",
|
|
117
|
-
ocupation:
|
|
117
|
+
ocupation: occupation_simple_1.default,
|
|
118
118
|
},
|
|
119
119
|
[product.PRODUCT_CODE_EARTHQUAKE]: {
|
|
120
120
|
value: product.PRODUCT_CODE_EARTHQUAKE,
|
|
121
121
|
name: "Earthquake",
|
|
122
|
-
ocupation:
|
|
122
|
+
ocupation: occupation_simple_1.default,
|
|
123
123
|
},
|
|
124
124
|
[product.PRODUCT_CODE_VEHICLE]: {
|
|
125
125
|
value: product.PRODUCT_CODE_VEHICLE,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = terbilang;
|
|
3
4
|
function terbilang(value) {
|
|
4
5
|
const satuan = ['', 'satu', 'dua', 'tiga', 'empat', 'lima', 'enam', 'tujuh', 'delapan', 'sembilan'];
|
|
5
6
|
const belasan = ['sepuluh', 'sebelas', 'dua belas', 'tiga belas', 'empat belas', 'lima belas', 'enam belas', 'tujuh belas', 'delapan belas', 'sembilan belas'];
|
|
@@ -41,4 +42,3 @@ function terbilang(value) {
|
|
|
41
42
|
// Menghilangkan spasi yang double
|
|
42
43
|
return result.replace(/\s+/g, ' ').trim();
|
|
43
44
|
}
|
|
44
|
-
exports.default = terbilang;
|
package/dist/helpers/axiosGet.js
CHANGED
|
@@ -13,7 +13,7 @@ const axios_1 = require("axios");
|
|
|
13
13
|
const generateRelationId_1 = require("./generateRelationId");
|
|
14
14
|
const getCurrentDate_1 = require("./getCurrentDate");
|
|
15
15
|
const constants_1 = require("../constants");
|
|
16
|
-
exports.default = (
|
|
16
|
+
exports.default = (_a) => __awaiter(void 0, [_a], void 0, function* ({ url, headers, params, callback, }) {
|
|
17
17
|
return yield axios_1.default.get(url, {
|
|
18
18
|
params,
|
|
19
19
|
headers: Object.assign({ 'Content-Type': 'application/json', 'X-Correlation-Id': (0, generateRelationId_1.default)(24), 'X-Transmission-Date-Time': (0, getCurrentDate_1.default)() }, headers),
|
|
@@ -13,7 +13,7 @@ const axios_1 = require("axios");
|
|
|
13
13
|
const generateRelationId_1 = require("./generateRelationId");
|
|
14
14
|
const getCurrentDate_1 = require("./getCurrentDate");
|
|
15
15
|
const constants_1 = require("../constants");
|
|
16
|
-
exports.default = (
|
|
16
|
+
exports.default = (_a) => __awaiter(void 0, [_a], void 0, function* ({ url, headers, body, callback, }) {
|
|
17
17
|
return yield axios_1.default.post(url, body, {
|
|
18
18
|
headers: Object.assign({ 'Content-Type': 'application/json', 'X-Correlation-Id': (0, generateRelationId_1.default)(24), 'X-Transmission-Date-Time': (0, getCurrentDate_1.default)() }, headers),
|
|
19
19
|
}).then((result) => __awaiter(void 0, void 0, void 0, function* () {
|
package/dist/helpers/axiosPut.js
CHANGED
|
@@ -13,7 +13,7 @@ const axios_1 = require("axios");
|
|
|
13
13
|
const constants_1 = require("../constants");
|
|
14
14
|
const generateRelationId_1 = require("./generateRelationId");
|
|
15
15
|
const getCurrentDate_1 = require("./getCurrentDate");
|
|
16
|
-
exports.default = (
|
|
16
|
+
exports.default = (_a) => __awaiter(void 0, [_a], void 0, function* ({ url, headers, body, callback, }) {
|
|
17
17
|
return yield axios_1.default.put(url, body, {
|
|
18
18
|
headers: Object.assign({ 'Content-Type': 'application/json', 'X-Correlation-Id': (0, generateRelationId_1.default)(24), 'X-Transmission-Date-Time': (0, getCurrentDate_1.default)() }, headers),
|
|
19
19
|
}).then((result) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = default_1;
|
|
3
4
|
const brokerage_1 = require("../constants/brokerage");
|
|
4
5
|
function default_1(request) {
|
|
5
6
|
try {
|
|
@@ -16,4 +17,3 @@ function default_1(request) {
|
|
|
16
17
|
return null;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
|
-
exports.default = default_1;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sumN =
|
|
3
|
+
exports.sumN = void 0;
|
|
4
|
+
exports.sum = sum;
|
|
5
|
+
exports.minus = minus;
|
|
6
|
+
exports.multiple = multiple;
|
|
7
|
+
exports.divide = divide;
|
|
4
8
|
function sum(a, b) {
|
|
5
9
|
try {
|
|
6
10
|
if (a == null && b == null)
|
|
@@ -11,7 +15,6 @@ function sum(a, b) {
|
|
|
11
15
|
return null;
|
|
12
16
|
}
|
|
13
17
|
}
|
|
14
|
-
exports.sum = sum;
|
|
15
18
|
function minus(a, b) {
|
|
16
19
|
try {
|
|
17
20
|
if (a == null && b == null)
|
|
@@ -22,7 +25,6 @@ function minus(a, b) {
|
|
|
22
25
|
return null;
|
|
23
26
|
}
|
|
24
27
|
}
|
|
25
|
-
exports.minus = minus;
|
|
26
28
|
function multiple(a, b) {
|
|
27
29
|
try {
|
|
28
30
|
if (a == null && b == null)
|
|
@@ -33,7 +35,6 @@ function multiple(a, b) {
|
|
|
33
35
|
return null;
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
|
-
exports.multiple = multiple;
|
|
37
38
|
function divide(a, b) {
|
|
38
39
|
try {
|
|
39
40
|
if (a == null && b == null)
|
|
@@ -44,7 +45,6 @@ function divide(a, b) {
|
|
|
44
45
|
return null;
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
|
-
exports.divide = divide;
|
|
48
48
|
const sumN = (...numbers) => {
|
|
49
49
|
let result = null;
|
|
50
50
|
numbers.forEach(each => {
|
|
@@ -5,10 +5,10 @@ exports.default = (req, { isUserCodeMandatory = true } = {}) => {
|
|
|
5
5
|
if (!userCode && isUserCodeMandatory)
|
|
6
6
|
throw new Error('Usercode is not found');
|
|
7
7
|
return {
|
|
8
|
-
userCode: req.headers['x-user'] || req.headers['userCode'],
|
|
9
|
-
username: req.headers['x-username'] || req.headers['username'],
|
|
10
|
-
userEmail: req.headers['x-useremail'] || req.headers['x-user-email'] || req.headers['userEmail'],
|
|
11
|
-
isAdmin: req.headers['x-admin'] || req.headers['isAdmin'],
|
|
8
|
+
userCode: req.headers['x-user'] || req.headers['userCode'], //x-user -> isinya userCode
|
|
9
|
+
username: req.headers['x-username'] || req.headers['username'], //x-username -> isinya auth.username
|
|
10
|
+
userEmail: req.headers['x-useremail'] || req.headers['x-user-email'] || req.headers['userEmail'], //x-useremail -> isinya auth.username
|
|
11
|
+
isAdmin: req.headers['x-admin'] || req.headers['isAdmin'], //x-admin // isi 1/undefined -> jika 1 berarti admin
|
|
12
12
|
isPublic: req.headers['x-public'], //x-public isi 1/undefined -> jika 1 berarti akses public
|
|
13
13
|
};
|
|
14
14
|
};
|
package/dist/helpers/loop.js
CHANGED
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
function loop(
|
|
13
|
-
return __awaiter(this,
|
|
12
|
+
function loop(list_1, callback_1) {
|
|
13
|
+
return __awaiter(this, arguments, void 0, function* (list, callback, result = []) {
|
|
14
14
|
if (list && list.length > 0) {
|
|
15
15
|
const [head, ...tail] = list;
|
|
16
16
|
return loop(tail, callback, [yield callback(head), ...result]);
|
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
function loop(
|
|
13
|
-
return __awaiter(this,
|
|
12
|
+
function loop(list_1, callback_1) {
|
|
13
|
+
return __awaiter(this, arguments, void 0, function* (list, callback, result = []) {
|
|
14
14
|
if (list && list.length > 0) {
|
|
15
15
|
const [head, ...tail] = list;
|
|
16
16
|
return loop(tail, callback, [...result, yield callback(head)]);
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@provis/provis-common-be-module",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "This common module for Provis internal backend use lib",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "tsc",
|
|
7
|
+
"build": "tsc && npm run copy-json",
|
|
8
|
+
"copy-json": "find src -name '*.json' -exec sh -c 'mkdir -p dist/$(dirname {} | sed s/^src//) && cp {} dist/$(echo {} | sed s/^src//)' \\;",
|
|
8
9
|
"pub": "npm run build && npm publish --access=public"
|
|
9
10
|
},
|
|
10
11
|
"keywords": [],
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const bankAccount = [
|
|
4
|
-
{
|
|
5
|
-
code: 'BCA2000',
|
|
6
|
-
desc: {
|
|
7
|
-
id: 'BCA 5455682000',
|
|
8
|
-
en: 'BCA 5455682000',
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
code: 'BCA2999',
|
|
13
|
-
desc: {
|
|
14
|
-
id: 'BCA 5455682999',
|
|
15
|
-
en: 'BCA 5455682999',
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
code: 'OCBC371-IDR',
|
|
20
|
-
desc: {
|
|
21
|
-
id: 'OCBC IDR 111800004371',
|
|
22
|
-
en: 'OCBC IDR 111800004371',
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
code: 'OCBC371-USD',
|
|
27
|
-
desc: {
|
|
28
|
-
id: 'OCBC USD 111800004371',
|
|
29
|
-
en: 'OCBC USD 111800004371',
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
code: 'PERMATA4371',
|
|
34
|
-
desc: {
|
|
35
|
-
id: 'Permata 0980-9340-683',
|
|
36
|
-
en: 'Permata 0980-9340-683',
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
code: 'PERMATA4371',
|
|
41
|
-
desc: {
|
|
42
|
-
id: 'QNB 1220-004544-001',
|
|
43
|
-
en: 'QNB 1220-004544-001',
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
code: 'BTPN3068',
|
|
48
|
-
desc: {
|
|
49
|
-
id: 'BTPN Syariah 1035883068',
|
|
50
|
-
en: 'BTPN Syariah 1035883068',
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
];
|
|
54
|
-
exports.default = bankAccount;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
declare const insuranceType: {
|
|
2
|
-
code: string;
|
|
3
|
-
desc: {
|
|
4
|
-
id: string;
|
|
5
|
-
en: string;
|
|
6
|
-
};
|
|
7
|
-
}[];
|
|
8
|
-
declare const regionCode: {
|
|
9
|
-
code: string;
|
|
10
|
-
desc: {
|
|
11
|
-
id: string;
|
|
12
|
-
en: string;
|
|
13
|
-
};
|
|
14
|
-
}[];
|
|
15
|
-
declare const vehicleTypeCode: {
|
|
16
|
-
code: string;
|
|
17
|
-
desc: {
|
|
18
|
-
id: string;
|
|
19
|
-
en: string;
|
|
20
|
-
};
|
|
21
|
-
}[];
|
|
22
|
-
declare const additionalCoverage: {
|
|
23
|
-
code: string;
|
|
24
|
-
desc: {
|
|
25
|
-
id: string;
|
|
26
|
-
en: string;
|
|
27
|
-
};
|
|
28
|
-
isVisible: boolean;
|
|
29
|
-
}[];
|
|
30
|
-
export { insuranceType, regionCode, vehicleTypeCode, additionalCoverage, };
|