@provis/provis-common-be-module 2.6.44 → 2.6.46
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/bankAccount.d.ts +8 -0
- package/dist/constants/bankAccount.js +54 -0
- package/dist/constants/claim/cargo.d.ts +3 -119
- 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/deductible.json +0 -7
- package/dist/constants/product/coretax.d.ts +12 -0
- package/dist/constants/product/coretax.js +14 -0
- package/dist/constants/product/mv.d.ts +30 -0
- package/dist/constants/product/mv.js +158 -0
- package/dist/constants/product/property/occupation.d.ts +5 -0
- package/dist/constants/product/property/occupation.js +1725 -0
- package/dist/constants/product.js +12 -12
- package/dist/constants/source.d.ts +1 -8
- package/dist/constants/source.js +1 -5
- package/dist/constants/user.d.ts +0 -16
- package/dist/constants/user.js +0 -16
- package/dist/helpers/alphaNumericCleansing.js +1 -1
- 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 +6 -6
- 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 +2 -0
- package/dist/interface/search.query.interface.d.ts +1 -1
- package/package.json +1 -1
- package/dist/helpers/excelDateToJs.d.ts +0 -2
- package/dist/helpers/excelDateToJs.js +0 -18
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const occupation_simple_1 = require("./product/property/occupation-simple");
|
|
4
4
|
const product = {
|
|
5
|
-
LIST: {},
|
|
6
|
-
MANUAL_LIST: [],
|
|
5
|
+
LIST: {},
|
|
6
|
+
MANUAL_LIST: [],
|
|
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',
|
|
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',
|
|
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',
|
|
66
66
|
// BDKI
|
|
67
67
|
PRODUCT_CODE_BDKI_MOTOR: 'polismall-bdki-motor',
|
|
68
68
|
PRODUCT_CODE_BDKI_RUMAH: 'polismall-bdki-rumah',
|
|
@@ -9,13 +9,6 @@ declare const source: {
|
|
|
9
9
|
SOURCE_UPLOAD_BUNDLE: string;
|
|
10
10
|
SOURCE_UPLOAD: string;
|
|
11
11
|
SOURCE_POLISMALL_CARGO: string;
|
|
12
|
-
|
|
13
|
-
LIST: {
|
|
14
|
-
code: string;
|
|
15
|
-
desc: {
|
|
16
|
-
en: string;
|
|
17
|
-
id: string;
|
|
18
|
-
};
|
|
19
|
-
}[];
|
|
12
|
+
LIST: any[];
|
|
20
13
|
};
|
|
21
14
|
export default source;
|
package/dist/constants/source.js
CHANGED
|
@@ -6,13 +6,12 @@ const source = {
|
|
|
6
6
|
SOURCE_TANTO: 'TANTO',
|
|
7
7
|
SOURCE_MERATUS_PALISIDE: 'MERATUS-PALISIDE',
|
|
8
8
|
SOURCE_TEMAS: 'TEMAS',
|
|
9
|
-
SOURCE_DOMESTIK: 'DOMESTIK',
|
|
9
|
+
SOURCE_DOMESTIK: 'DOMESTIK',
|
|
10
10
|
SOURCE_YUDHA_EXCEL: 'YUDHA',
|
|
11
11
|
SOURCE_EXIM: 'EXIM',
|
|
12
12
|
SOURCE_UPLOAD_BUNDLE: 'UPLOAD-BUNDLE',
|
|
13
13
|
SOURCE_UPLOAD: 'UPLOAD',
|
|
14
14
|
SOURCE_POLISMALL_CARGO: 'polismall-cargo',
|
|
15
|
-
SOURCE_PPNP: 'PPNP',
|
|
16
15
|
LIST: [],
|
|
17
16
|
};
|
|
18
17
|
source.LIST.push({
|
|
@@ -45,8 +44,5 @@ source.LIST.push({
|
|
|
45
44
|
}, {
|
|
46
45
|
code: source.SOURCE_POLISMALL_CARGO,
|
|
47
46
|
desc: { en: 'Polismall Cargo', id: 'Polismall Cargo' }
|
|
48
|
-
}, {
|
|
49
|
-
code: source.SOURCE_PPNP,
|
|
50
|
-
desc: { en: 'PPNP', id: 'PPNP' }
|
|
51
47
|
});
|
|
52
48
|
exports.default = source;
|
package/dist/constants/user.d.ts
CHANGED
|
@@ -15,21 +15,5 @@ declare const user: {
|
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
|
-
USER_STATUS: {
|
|
19
|
-
ACTIVE: {
|
|
20
|
-
value: boolean;
|
|
21
|
-
desc: {
|
|
22
|
-
en: string;
|
|
23
|
-
id: string;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
NON_ACTIVE: {
|
|
27
|
-
value: boolean;
|
|
28
|
-
desc: {
|
|
29
|
-
en: string;
|
|
30
|
-
id: string;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
18
|
};
|
|
35
19
|
export default user;
|
package/dist/constants/user.js
CHANGED
|
@@ -17,21 +17,5 @@ const user = {
|
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
|
-
USER_STATUS: {
|
|
21
|
-
ACTIVE: {
|
|
22
|
-
value: true,
|
|
23
|
-
desc: {
|
|
24
|
-
en: 'Active',
|
|
25
|
-
id: 'Aktif',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
NON_ACTIVE: {
|
|
29
|
-
value: false,
|
|
30
|
-
desc: {
|
|
31
|
-
en: 'Non-Active',
|
|
32
|
-
id: 'Non-Aktif',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
20
|
};
|
|
37
21
|
exports.default = user;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = alphaNumericCleansing;
|
|
4
3
|
function alphaNumericCleansing(text) {
|
|
5
4
|
if (typeof text !== 'string')
|
|
6
5
|
return '';
|
|
@@ -8,3 +7,4 @@ function alphaNumericCleansing(text) {
|
|
|
8
7
|
.toLowerCase()
|
|
9
8
|
.replace(/[^a-z0-9]/g, '');
|
|
10
9
|
}
|
|
10
|
+
exports.default = alphaNumericCleansing;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = terbilang;
|
|
4
3
|
function terbilang(value) {
|
|
5
4
|
const satuan = ['', 'satu', 'dua', 'tiga', 'empat', 'lima', 'enam', 'tujuh', 'delapan', 'sembilan'];
|
|
6
5
|
const belasan = ['sepuluh', 'sebelas', 'dua belas', 'tiga belas', 'empat belas', 'lima belas', 'enam belas', 'tujuh belas', 'delapan belas', 'sembilan belas'];
|
|
@@ -42,3 +41,4 @@ function terbilang(value) {
|
|
|
42
41
|
// Menghilangkan spasi yang double
|
|
43
42
|
return result.replace(/\s+/g, ' ').trim();
|
|
44
43
|
}
|
|
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 = ({ url, headers, params, callback, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
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 = ({ url, headers, body, callback, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
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 = ({ url, headers, body, callback, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
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,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = default_1;
|
|
4
3
|
const brokerage_1 = require("../constants/brokerage");
|
|
5
4
|
function default_1(request) {
|
|
6
5
|
try {
|
|
@@ -17,3 +16,4 @@ function default_1(request) {
|
|
|
17
16
|
return null;
|
|
18
17
|
}
|
|
19
18
|
}
|
|
19
|
+
exports.default = default_1;
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.minusN = exports.sumN = void 0;
|
|
4
|
-
exports.sum = sum;
|
|
5
|
-
exports.minus = minus;
|
|
6
|
-
exports.multiple = multiple;
|
|
7
|
-
exports.divide = divide;
|
|
8
|
-
exports.roundTo = roundTo;
|
|
3
|
+
exports.roundTo = exports.minusN = exports.sumN = exports.divide = exports.multiple = exports.minus = exports.sum = void 0;
|
|
9
4
|
function sum(a, b) {
|
|
10
5
|
try {
|
|
11
6
|
if (a == null && b == null)
|
|
@@ -16,6 +11,7 @@ function sum(a, b) {
|
|
|
16
11
|
return null;
|
|
17
12
|
}
|
|
18
13
|
}
|
|
14
|
+
exports.sum = sum;
|
|
19
15
|
function minus(a, b) {
|
|
20
16
|
try {
|
|
21
17
|
if (a == null && b == null)
|
|
@@ -26,6 +22,7 @@ function minus(a, b) {
|
|
|
26
22
|
return null;
|
|
27
23
|
}
|
|
28
24
|
}
|
|
25
|
+
exports.minus = minus;
|
|
29
26
|
function multiple(a, b) {
|
|
30
27
|
try {
|
|
31
28
|
if (a == null && b == null)
|
|
@@ -36,6 +33,7 @@ function multiple(a, b) {
|
|
|
36
33
|
return null;
|
|
37
34
|
}
|
|
38
35
|
}
|
|
36
|
+
exports.multiple = multiple;
|
|
39
37
|
function roundTo(num, precision = 2) {
|
|
40
38
|
try {
|
|
41
39
|
if (num == null && precision == null)
|
|
@@ -47,6 +45,7 @@ function roundTo(num, precision = 2) {
|
|
|
47
45
|
return null;
|
|
48
46
|
}
|
|
49
47
|
}
|
|
48
|
+
exports.roundTo = roundTo;
|
|
50
49
|
function divide(a, b) {
|
|
51
50
|
try {
|
|
52
51
|
if (a == null && b == null)
|
|
@@ -59,6 +58,7 @@ function divide(a, b) {
|
|
|
59
58
|
return null;
|
|
60
59
|
}
|
|
61
60
|
}
|
|
61
|
+
exports.divide = divide;
|
|
62
62
|
const sumN = (...numbers) => {
|
|
63
63
|
let result = null;
|
|
64
64
|
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'],
|
|
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'],
|
|
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, callback, result = []) {
|
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
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, callback, result = []) {
|
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
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,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const ISO_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/;
|
|
4
|
-
const EXCEL_EPOCH_MS = Date.UTC(1899, 11, 30);
|
|
5
|
-
const MS_PER_DAY = 86400000;
|
|
6
|
-
exports.default = (value) => {
|
|
7
|
-
if (value === null || value === undefined || value === '') {
|
|
8
|
-
return new Date(NaN);
|
|
9
|
-
}
|
|
10
|
-
if (typeof value === 'string' && ISO_DATE_PATTERN.test(value)) {
|
|
11
|
-
return new Date(`${value}T00:00:00Z`);
|
|
12
|
-
}
|
|
13
|
-
const serial = Number(value);
|
|
14
|
-
if (!Number.isFinite(serial)) {
|
|
15
|
-
return new Date(NaN);
|
|
16
|
-
}
|
|
17
|
-
return new Date(EXCEL_EPOCH_MS + Math.round(serial * MS_PER_DAY));
|
|
18
|
-
};
|