@provis/provis-common-be-module 2.2.18 → 2.2.20
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/kalog.js +1 -1
- package/dist/constants/claim/loket.js +27 -27
- package/dist/constants/claim/motorVehicle.js +1 -1
- package/dist/constants/claim/travel.js +1 -1
- package/dist/constants/product/cargo.d.ts +30 -0
- package/dist/constants/product/cargo.js +30 -0
- package/dist/constants/product.d.ts +1 -0
- package/dist/constants/product.js +18 -12
- 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 -4
- package/dist/helpers/getCargoType.d.ts +2 -0
- package/dist/helpers/getCargoType.js +9 -0
- package/dist/helpers/index.d.ts +2 -1
- package/dist/helpers/index.js +3 -1
- package/dist/helpers/loop.js +2 -2
- package/dist/helpers/loopBackward.js +2 -2
- package/dist/helpers/readExcel.d.ts +2 -0
- package/package.json +1 -1
|
@@ -116,8 +116,8 @@ class MainRepository extends typeorm_1.Repository {
|
|
|
116
116
|
return result;
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
-
summaryField(
|
|
120
|
-
return __awaiter(this,
|
|
119
|
+
summaryField({ fieldToSum, search, additionalSearchOr, relations, }) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
121
|
let query = this.createQueryBuilder()
|
|
122
122
|
.select([
|
|
123
123
|
'COUNT(1) AS totalRows',
|
|
@@ -132,8 +132,8 @@ class MainRepository extends typeorm_1.Repository {
|
|
|
132
132
|
return query.getRawOne();
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
-
findAllAndCount(
|
|
136
|
-
return __awaiter(this,
|
|
135
|
+
findAllAndCount({ search, additionalSearchOr, relations, sortBy, offset = 1, maxCount = 50, }) {
|
|
136
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
137
137
|
const skipItems = ((offset < 1 ? 1 : offset) - 1) * maxCount;
|
|
138
138
|
let query = this.createQueryBuilder().select(this.selectFieldOnFindAllAndCount());
|
|
139
139
|
query = this.applySearchConditions({
|
|
@@ -3,37 +3,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const status_1 = require("./status");
|
|
4
4
|
const loket = {
|
|
5
5
|
// LIST RESIKO
|
|
6
|
-
RISK_CLK001: 'CLK001',
|
|
7
|
-
RISK_CLK002: 'CLK002',
|
|
8
|
-
RISK_CLK003: 'CLK003',
|
|
9
|
-
RISK_CLK004: 'CLK004',
|
|
10
|
-
RISK_CLK005: 'CLK005',
|
|
11
|
-
RISK_CLK006: 'CLK006',
|
|
12
|
-
RISK_CLK007: 'CLK007',
|
|
6
|
+
RISK_CLK001: 'CLK001',
|
|
7
|
+
RISK_CLK002: 'CLK002',
|
|
8
|
+
RISK_CLK003: 'CLK003',
|
|
9
|
+
RISK_CLK004: 'CLK004',
|
|
10
|
+
RISK_CLK005: 'CLK005',
|
|
11
|
+
RISK_CLK006: 'CLK006',
|
|
12
|
+
RISK_CLK007: 'CLK007',
|
|
13
13
|
// LIST DOCUMENT
|
|
14
|
-
DOCUMENT_DLK001: 'DLK001',
|
|
15
|
-
DOCUMENT_DLK002: 'DLK002',
|
|
16
|
-
DOCUMENT_DLK003: 'DLK003',
|
|
17
|
-
DOCUMENT_DLK004: 'DLK004',
|
|
18
|
-
DOCUMENT_DLK005: 'DLK005',
|
|
19
|
-
DOCUMENT_DLK006: 'DLK006',
|
|
20
|
-
DOCUMENT_DLK007: 'DLK007',
|
|
21
|
-
DOCUMENT_DLK008: 'DLK008',
|
|
22
|
-
DOCUMENT_DLK009: 'DLK009',
|
|
23
|
-
DOCUMENT_DLK010: 'DLK010',
|
|
24
|
-
DOCUMENT_DLK011: 'DLK011',
|
|
25
|
-
DOCUMENT_DLK012: 'DLK012',
|
|
26
|
-
DOCUMENT_DLK013: 'DLK013',
|
|
27
|
-
DOCUMENT_DLK014: 'DLK014',
|
|
28
|
-
DOCUMENT_DLK015: 'DLK015',
|
|
29
|
-
DOCUMENT_DLK016: 'DLK016',
|
|
30
|
-
DOCUMENT_DLK017: 'DLK017',
|
|
31
|
-
DOCUMENT_DLK018: 'DLK018',
|
|
32
|
-
DOCUMENT_DLK019: 'DLK019',
|
|
14
|
+
DOCUMENT_DLK001: 'DLK001',
|
|
15
|
+
DOCUMENT_DLK002: 'DLK002',
|
|
16
|
+
DOCUMENT_DLK003: 'DLK003',
|
|
17
|
+
DOCUMENT_DLK004: 'DLK004',
|
|
18
|
+
DOCUMENT_DLK005: 'DLK005',
|
|
19
|
+
DOCUMENT_DLK006: 'DLK006',
|
|
20
|
+
DOCUMENT_DLK007: 'DLK007',
|
|
21
|
+
DOCUMENT_DLK008: 'DLK008',
|
|
22
|
+
DOCUMENT_DLK009: 'DLK009',
|
|
23
|
+
DOCUMENT_DLK010: 'DLK010',
|
|
24
|
+
DOCUMENT_DLK011: 'DLK011',
|
|
25
|
+
DOCUMENT_DLK012: 'DLK012',
|
|
26
|
+
DOCUMENT_DLK013: 'DLK013',
|
|
27
|
+
DOCUMENT_DLK014: 'DLK014',
|
|
28
|
+
DOCUMENT_DLK015: 'DLK015',
|
|
29
|
+
DOCUMENT_DLK016: 'DLK016',
|
|
30
|
+
DOCUMENT_DLK017: 'DLK017',
|
|
31
|
+
DOCUMENT_DLK018: 'DLK018',
|
|
32
|
+
DOCUMENT_DLK019: 'DLK019',
|
|
33
33
|
DOCUMENT_DT001: 'DT001',
|
|
34
34
|
DOCUMENT_DT002: 'DT002',
|
|
35
35
|
DOCUMENT_DT003: 'DT003',
|
|
36
|
-
LIST_RISK: [],
|
|
36
|
+
LIST_RISK: [],
|
|
37
37
|
RISK_CONFIG: {},
|
|
38
38
|
DOCUMENT_CONFIG: {},
|
|
39
39
|
STATUS_DEADLINE: {},
|
|
@@ -33,7 +33,7 @@ const motorVehicle = {
|
|
|
33
33
|
VCDOC022: { key: 'VCDOC022', descEn: '', desc: 'Kuitansi dari Rumah Sakit' },
|
|
34
34
|
VCDOC023: { key: 'VCDOC023', descEn: '', desc: 'Sertifikat Kematian - Untuk kematian Pihak Ketiga' },
|
|
35
35
|
VCDOC024: { key: 'VCDOC024', descEn: '', desc: 'Seluruh korespondensi dengan pihak ketiga yang mengalami luka/kematian' },
|
|
36
|
-
LIST_RISK: [],
|
|
36
|
+
LIST_RISK: [],
|
|
37
37
|
RISK_CONFIG: {},
|
|
38
38
|
DOCUMENT_CONFIG: {},
|
|
39
39
|
STATUS_DEADLINE: {},
|
|
@@ -73,7 +73,7 @@ const travel = {
|
|
|
73
73
|
TCDOC044: { key: 'TCDOC044', descEn: '', desc: 'Tanda terima bagasi (berisi jam & tanggal bagasi diterima)' },
|
|
74
74
|
TCDOC045: { key: 'TCDOC045', descEn: '', desc: 'Ticket & Boarding Pass' },
|
|
75
75
|
TCDOC046: { key: 'TCDOC046', descEn: '', desc: 'Visum et Repertum' },
|
|
76
|
-
LIST_RISK: [],
|
|
76
|
+
LIST_RISK: [],
|
|
77
77
|
RISK_CONFIG: {},
|
|
78
78
|
DOCUMENT_CONFIG: {},
|
|
79
79
|
STATUS_DEADLINE: {},
|
|
@@ -5,5 +5,35 @@ declare const cargo: {
|
|
|
5
5
|
PAID: string;
|
|
6
6
|
CANCEL: string;
|
|
7
7
|
};
|
|
8
|
+
TYPE: {
|
|
9
|
+
TYPE_ICCA_FLB: {
|
|
10
|
+
code: string;
|
|
11
|
+
desc: {
|
|
12
|
+
id: string;
|
|
13
|
+
en: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
TYPE_ICCC_FLB: {
|
|
17
|
+
code: string;
|
|
18
|
+
desc: {
|
|
19
|
+
id: string;
|
|
20
|
+
en: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
TYPE_ICCA_INV: {
|
|
24
|
+
code: string;
|
|
25
|
+
desc: {
|
|
26
|
+
id: string;
|
|
27
|
+
en: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
TYPE_ICCC_INV: {
|
|
31
|
+
code: string;
|
|
32
|
+
desc: {
|
|
33
|
+
id: string;
|
|
34
|
+
en: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
8
38
|
};
|
|
9
39
|
export default cargo;
|
|
@@ -7,5 +7,35 @@ const cargo = {
|
|
|
7
7
|
PAID: '200',
|
|
8
8
|
CANCEL: '300',
|
|
9
9
|
},
|
|
10
|
+
TYPE: {
|
|
11
|
+
TYPE_ICCA_FLB: {
|
|
12
|
+
code: 'ICCA-FLB',
|
|
13
|
+
desc: {
|
|
14
|
+
id: '',
|
|
15
|
+
en: 'Institute Cargo Clause (A) 01/01/09 - First Loss Basis',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
TYPE_ICCC_FLB: {
|
|
19
|
+
code: 'ICCC-FLB',
|
|
20
|
+
desc: {
|
|
21
|
+
id: '',
|
|
22
|
+
en: 'Institute Cargo Clause (C) 01/01/09 - First Loss Basis',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
TYPE_ICCA_INV: {
|
|
26
|
+
code: 'ICCA-INV',
|
|
27
|
+
desc: {
|
|
28
|
+
id: '',
|
|
29
|
+
en: 'Institute Cargo Clause (C) 01/01/09 - Invoice value +10%',
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
TYPE_ICCC_INV: {
|
|
33
|
+
code: 'ICCC-INV',
|
|
34
|
+
desc: {
|
|
35
|
+
id: '',
|
|
36
|
+
en: 'Institute Cargo Clause (A) 01/01/09 - Invoice value +10%',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
}
|
|
10
40
|
};
|
|
11
41
|
exports.default = cargo;
|
|
@@ -41,6 +41,7 @@ declare const product: {
|
|
|
41
41
|
PRODUCT_CODE_MOVEABLE_ALL_RISK: string;
|
|
42
42
|
PRODUCT_CODE_SURETY_BOND: string;
|
|
43
43
|
PRODUCT_CODE_ERECTION_ALL_RISK: string;
|
|
44
|
+
PRODUCT_CODE_PA_SOGO_ELI_DAYIN: string;
|
|
44
45
|
PRODUCT_POLISMALL_CARGO_MERATUS: string;
|
|
45
46
|
PRODUCT_POLISMALL_CARGO: string;
|
|
46
47
|
PRODUCT_CODE_EXIM: string;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const occupation_1 = require("./product/occupation");
|
|
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',
|
|
@@ -44,6 +44,7 @@ const product = {
|
|
|
44
44
|
PRODUCT_CODE_MOVEABLE_ALL_RISK: 'polismall-moveable-all-risk',
|
|
45
45
|
PRODUCT_CODE_SURETY_BOND: 'polismall-surety-bond',
|
|
46
46
|
PRODUCT_CODE_ERECTION_ALL_RISK: 'polismall-erection-all-risk',
|
|
47
|
+
PRODUCT_CODE_PA_SOGO_ELI_DAYIN: 'polismall-eli',
|
|
47
48
|
// CARGO
|
|
48
49
|
PRODUCT_POLISMALL_CARGO_MERATUS: 'polismall-cargo-meratus-paliside',
|
|
49
50
|
PRODUCT_POLISMALL_CARGO: 'polismall-cargo',
|
|
@@ -51,17 +52,17 @@ const product = {
|
|
|
51
52
|
PRODUCT_CODE_CARGO_BUNDLE: 'polismall-cargo-bundle',
|
|
52
53
|
PRODUCT_CODE_MERIMEN_CARGO: 'polismall-merimen-cargo',
|
|
53
54
|
PRODUCT_CODE_CARGO_TEMAS: 'polismall-cargo-temas',
|
|
54
|
-
PRODUCT_CODE_CARGO_SINGLE_SHIPMENT: 'polismall-cargo-single-shipment',
|
|
55
|
+
PRODUCT_CODE_CARGO_SINGLE_SHIPMENT: 'polismall-cargo-single-shipment',
|
|
55
56
|
// OTTO
|
|
56
|
-
PRODUCT_CODE_OTTO_CI: 'polismall-otto-critical-illness',
|
|
57
|
-
PRODUCT_CODE_OTTO_FLEXAS: 'polismall-otto-flexas',
|
|
58
|
-
PRODUCT_CODE_OTTO_CRACK_SCREEN: 'polismall-otto-crack',
|
|
59
|
-
PRODUCT_CODE_OTTO_AUM_GP: 'polismall-otto-aum-gp',
|
|
60
|
-
PRODUCT_CODE_OTTO_AUM_PLN: 'polismall-otto-aum-pln',
|
|
61
|
-
PRODUCT_CODE_OTTO_AUM_PDAM: 'polismall-otto-aum-pdam',
|
|
62
|
-
PRODUCT_CODE_OTTO_AUM_SB: 'polismall-otto-aum-sb',
|
|
63
|
-
PRODUCT_CODE_OTTO_AUM_FB: 'polismall-otto-aum-fb',
|
|
64
|
-
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',
|
|
65
66
|
// BDKI
|
|
66
67
|
PRODUCT_CODE_BDKI_MOTOR: 'polismall-bdki-motor',
|
|
67
68
|
PRODUCT_CODE_BDKI_RUMAH: 'polismall-bdki-rumah',
|
|
@@ -329,6 +330,10 @@ product.LIST = {
|
|
|
329
330
|
[product.PRODUCT_CODE_WRPL]: {
|
|
330
331
|
value: product.PRODUCT_CODE_WRPL,
|
|
331
332
|
name: "Wreck Removal & Pollution Liability",
|
|
333
|
+
},
|
|
334
|
+
[product.PRODUCT_CODE_PA_SOGO_ELI_DAYIN]: {
|
|
335
|
+
value: product.PRODUCT_CODE_PA_SOGO_ELI_DAYIN,
|
|
336
|
+
name: "PA SOGO - ELI DAIYIN",
|
|
332
337
|
}
|
|
333
338
|
};
|
|
334
339
|
product.MANUAL_LIST = [
|
|
@@ -371,6 +376,7 @@ product.MANUAL_LIST = [
|
|
|
371
376
|
product.LIST[product.PRODUCT_CODE_CARGO_SINGLE_SHIPMENT],
|
|
372
377
|
product.LIST[product.PRODUCT_CODE_MARINE_OPEN_POLICY],
|
|
373
378
|
product.LIST[product.PRODUCT_CODE_WRPL],
|
|
379
|
+
product.LIST[product.PRODUCT_CODE_PA_SOGO_ELI_DAYIN],
|
|
374
380
|
];
|
|
375
381
|
product.CARGO_BY_SYSTEM_LIST = [
|
|
376
382
|
product.LIST[product.PRODUCT_POLISMALL_CARGO_MERATUS],
|
|
@@ -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,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sum =
|
|
4
|
-
exports.minus = minus;
|
|
5
|
-
exports.multiple = multiple;
|
|
6
|
-
exports.divide = divide;
|
|
3
|
+
exports.divide = exports.multiple = exports.minus = exports.sum = void 0;
|
|
7
4
|
function sum(a, b) {
|
|
8
5
|
try {
|
|
9
6
|
if (a == null && b == null)
|
|
@@ -14,6 +11,7 @@ function sum(a, b) {
|
|
|
14
11
|
return null;
|
|
15
12
|
}
|
|
16
13
|
}
|
|
14
|
+
exports.sum = sum;
|
|
17
15
|
function minus(a, b) {
|
|
18
16
|
try {
|
|
19
17
|
if (a == null && b == null)
|
|
@@ -24,6 +22,7 @@ function minus(a, b) {
|
|
|
24
22
|
return null;
|
|
25
23
|
}
|
|
26
24
|
}
|
|
25
|
+
exports.minus = minus;
|
|
27
26
|
function multiple(a, b) {
|
|
28
27
|
try {
|
|
29
28
|
if (a == null && b == null)
|
|
@@ -34,6 +33,7 @@ function multiple(a, b) {
|
|
|
34
33
|
return null;
|
|
35
34
|
}
|
|
36
35
|
}
|
|
36
|
+
exports.multiple = multiple;
|
|
37
37
|
function divide(a, b) {
|
|
38
38
|
try {
|
|
39
39
|
if (a == null && b == null)
|
|
@@ -44,3 +44,4 @@ function divide(a, b) {
|
|
|
44
44
|
return null;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
+
exports.divide = divide;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cargo_1 = require("../constants/product/cargo");
|
|
4
|
+
function getCargoType(code, lang = 'en') {
|
|
5
|
+
var _a;
|
|
6
|
+
const match = Object.values(cargo_1.default.TYPE).find((item) => item.code === code);
|
|
7
|
+
return ((_a = match === null || match === void 0 ? void 0 : match.desc) === null || _a === void 0 ? void 0 : _a[lang]) || null;
|
|
8
|
+
}
|
|
9
|
+
exports.default = getCargoType;
|
package/dist/helpers/index.d.ts
CHANGED
|
@@ -21,4 +21,5 @@ import generateHashString from "./generateHashString";
|
|
|
21
21
|
import mergeObj from "./mergeObj";
|
|
22
22
|
import combineObj from "./combineObj";
|
|
23
23
|
import calculateByType from './calculateByType';
|
|
24
|
-
|
|
24
|
+
import getCargoType from "./getCargoType";
|
|
25
|
+
export { addDateTime, amountDescription, axiosGet, axiosPost, axiosPut, compareDiffObj, convertCurrencySymbol, convertDateTimeFormat, convertObjToNumber, convertToCurrency, filterObj, generateRelationId, getCurrentDate, getDiffValue, getObjByKeys, loop, loopBackward, searchValue, readExcel, generateHashString, mergeObj, combineObj, calculateByType, getCargoType, };
|
package/dist/helpers/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.calculateByType = exports.combineObj = exports.mergeObj = exports.generateHashString = exports.readExcel = exports.searchValue = exports.loopBackward = exports.loop = exports.getObjByKeys = exports.getDiffValue = exports.getCurrentDate = exports.generateRelationId = exports.filterObj = exports.convertToCurrency = exports.convertObjToNumber = exports.convertDateTimeFormat = exports.convertCurrencySymbol = exports.compareDiffObj = exports.axiosPut = exports.axiosPost = exports.axiosGet = exports.amountDescription = exports.addDateTime = void 0;
|
|
3
|
+
exports.getCargoType = exports.calculateByType = exports.combineObj = exports.mergeObj = exports.generateHashString = exports.readExcel = exports.searchValue = exports.loopBackward = exports.loop = exports.getObjByKeys = exports.getDiffValue = exports.getCurrentDate = exports.generateRelationId = exports.filterObj = exports.convertToCurrency = exports.convertObjToNumber = exports.convertDateTimeFormat = exports.convertCurrencySymbol = exports.compareDiffObj = exports.axiosPut = exports.axiosPost = exports.axiosGet = exports.amountDescription = exports.addDateTime = void 0;
|
|
4
4
|
const addDateTime_1 = require("./addDateTime");
|
|
5
5
|
exports.addDateTime = addDateTime_1.default;
|
|
6
6
|
const amountDescription_1 = require("./amountDescription");
|
|
@@ -47,3 +47,5 @@ const combineObj_1 = require("./combineObj");
|
|
|
47
47
|
exports.combineObj = combineObj_1.default;
|
|
48
48
|
const calculateByType_1 = require("./calculateByType");
|
|
49
49
|
exports.calculateByType = calculateByType_1.default;
|
|
50
|
+
const getCargoType_1 = require("./getCargoType");
|
|
51
|
+
exports.getCargoType = getCargoType_1.default;
|
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)]);
|