@provis/provis-common-be-module 2.3.24 → 2.3.25

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 (135) hide show
  1. package/package.json +1 -1
  2. package/dist/class/main.repository.d.ts +0 -27
  3. package/dist/class/main.repository.js +0 -303
  4. package/dist/constants/brokerage.d.ts +0 -25
  5. package/dist/constants/brokerage.js +0 -30
  6. package/dist/constants/claim/document-container.d.ts +0 -14
  7. package/dist/constants/claim/document-container.js +0 -65
  8. package/dist/constants/claim/generalInsurance.d.ts +0 -535
  9. package/dist/constants/claim/generalInsurance.js +0 -18
  10. package/dist/constants/claim/kalog.d.ts +0 -28
  11. package/dist/constants/claim/kalog.js +0 -186
  12. package/dist/constants/claim/loket.d.ts +0 -36
  13. package/dist/constants/claim/loket.js +0 -290
  14. package/dist/constants/claim/motorVehicle.d.ts +0 -158
  15. package/dist/constants/claim/motorVehicle.js +0 -139
  16. package/dist/constants/claim/status.d.ts +0 -137
  17. package/dist/constants/claim/status.js +0 -160
  18. package/dist/constants/claim/travel.d.ts +0 -358
  19. package/dist/constants/claim/travel.js +0 -268
  20. package/dist/constants/config.d.ts +0 -2
  21. package/dist/constants/config.js +0 -23
  22. package/dist/constants/currency.d.ts +0 -2
  23. package/dist/constants/currency.js +0 -7
  24. package/dist/constants/index.d.ts +0 -5
  25. package/dist/constants/index.js +0 -11
  26. package/dist/constants/join.d.ts +0 -5
  27. package/dist/constants/join.js +0 -2
  28. package/dist/constants/loket.d.ts +0 -17
  29. package/dist/constants/loket.js +0 -19
  30. package/dist/constants/martialStatus.d.ts +0 -2
  31. package/dist/constants/martialStatus.js +0 -32
  32. package/dist/constants/operator.d.ts +0 -2
  33. package/dist/constants/operator.js +0 -12
  34. package/dist/constants/product/cargo.d.ts +0 -39
  35. package/dist/constants/product/cargo.js +0 -41
  36. package/dist/constants/product/mv/clause.d.ts +0 -52
  37. package/dist/constants/product/mv/clause.js +0 -214
  38. package/dist/constants/product/mv/merk.d.ts +0 -7
  39. package/dist/constants/product/mv/merk.js +0 -111
  40. package/dist/constants/product/mv/mv.d.ts +0 -48
  41. package/dist/constants/product/mv/mv.js +0 -215
  42. package/dist/constants/product/mv/plat.d.ts +0 -7
  43. package/dist/constants/product/mv/plat.js +0 -334
  44. package/dist/constants/product/mv.d.ts +0 -30
  45. package/dist/constants/product/mv.js +0 -158
  46. package/dist/constants/product/occupation.d.ts +0 -5
  47. package/dist/constants/product/occupation.js +0 -25
  48. package/dist/constants/product/policy.d.ts +0 -31
  49. package/dist/constants/product/policy.js +0 -33
  50. package/dist/constants/product.d.ts +0 -72
  51. package/dist/constants/product.js +0 -394
  52. package/dist/constants/quotation.d.ts +0 -32
  53. package/dist/constants/quotation.js +0 -38
  54. package/dist/constants/report.d.ts +0 -46
  55. package/dist/constants/report.js +0 -60
  56. package/dist/constants/vesselList.d.ts +0 -5
  57. package/dist/constants/vesselList.js +0 -116
  58. package/dist/helpers/addDateTime.d.ts +0 -6
  59. package/dist/helpers/addDateTime.js +0 -30
  60. package/dist/helpers/amountDescription.d.ts +0 -1
  61. package/dist/helpers/amountDescription.js +0 -44
  62. package/dist/helpers/axiosGet.d.ts +0 -8
  63. package/dist/helpers/axiosGet.js +0 -47
  64. package/dist/helpers/axiosPost.d.ts +0 -8
  65. package/dist/helpers/axiosPost.js +0 -46
  66. package/dist/helpers/axiosPut.d.ts +0 -8
  67. package/dist/helpers/axiosPut.js +0 -46
  68. package/dist/helpers/calculateByType.d.ts +0 -5
  69. package/dist/helpers/calculateByType.js +0 -19
  70. package/dist/helpers/calculateForNullable.d.ts +0 -5
  71. package/dist/helpers/calculateForNullable.js +0 -47
  72. package/dist/helpers/combineObj.d.ts +0 -2
  73. package/dist/helpers/combineObj.js +0 -17
  74. package/dist/helpers/compareDiffObj.d.ts +0 -2
  75. package/dist/helpers/compareDiffObj.js +0 -14
  76. package/dist/helpers/convertCurrencySymbol.d.ts +0 -2
  77. package/dist/helpers/convertCurrencySymbol.js +0 -20
  78. package/dist/helpers/convertDateTimeFormat.d.ts +0 -6
  79. package/dist/helpers/convertDateTimeFormat.js +0 -113
  80. package/dist/helpers/convertObjToNumber.d.ts +0 -2
  81. package/dist/helpers/convertObjToNumber.js +0 -14
  82. package/dist/helpers/convertToCurrency.d.ts +0 -2
  83. package/dist/helpers/convertToCurrency.js +0 -21
  84. package/dist/helpers/excelDateToJsDate.d.ts +0 -4
  85. package/dist/helpers/excelDateToJsDate.js +0 -30
  86. package/dist/helpers/filterObj.d.ts +0 -2
  87. package/dist/helpers/filterObj.js +0 -9
  88. package/dist/helpers/generateHashString.d.ts +0 -2
  89. package/dist/helpers/generateHashString.js +0 -15
  90. package/dist/helpers/generateRelationId.d.ts +0 -2
  91. package/dist/helpers/generateRelationId.js +0 -15
  92. package/dist/helpers/getCargoType.d.ts +0 -2
  93. package/dist/helpers/getCargoType.js +0 -9
  94. package/dist/helpers/getCurrentDate.d.ts +0 -2
  95. package/dist/helpers/getCurrentDate.js +0 -11
  96. package/dist/helpers/getDiffValue.d.ts +0 -2
  97. package/dist/helpers/getDiffValue.js +0 -24
  98. package/dist/helpers/getObjByKeys.d.ts +0 -2
  99. package/dist/helpers/getObjByKeys.js +0 -19
  100. package/dist/helpers/index.d.ts +0 -25
  101. package/dist/helpers/index.js +0 -51
  102. package/dist/helpers/loop.d.ts +0 -2
  103. package/dist/helpers/loop.js +0 -21
  104. package/dist/helpers/loopBackward.d.ts +0 -2
  105. package/dist/helpers/loopBackward.js +0 -21
  106. package/dist/helpers/mergeObj.d.ts +0 -2
  107. package/dist/helpers/mergeObj.js +0 -16
  108. package/dist/helpers/readExcel.d.ts +0 -5
  109. package/dist/helpers/readExcel.js +0 -115
  110. package/dist/helpers/searchValue.d.ts +0 -4
  111. package/dist/helpers/searchValue.js +0 -63
  112. package/dist/index.d.ts +0 -3
  113. package/dist/index.js +0 -7
  114. package/dist/interface/axios.interface.d.ts +0 -5
  115. package/dist/interface/axios.interface.js +0 -2
  116. package/dist/interface/find.all.count.interface.d.ts +0 -10
  117. package/dist/interface/find.all.count.interface.js +0 -2
  118. package/dist/interface/multi.join.interface.d.ts +0 -9
  119. package/dist/interface/multi.join.interface.js +0 -2
  120. package/dist/interface/read.excel.interface.d.ts +0 -12
  121. package/dist/interface/read.excel.interface.js +0 -2
  122. package/dist/interface/search.conditions.interface.d.ts +0 -8
  123. package/dist/interface/search.conditions.interface.js +0 -2
  124. package/dist/interface/search.initial.interface.d.ts +0 -8
  125. package/dist/interface/search.initial.interface.js +0 -2
  126. package/dist/interface/search.query.interface.d.ts +0 -5
  127. package/dist/interface/search.query.interface.js +0 -3
  128. package/dist/interface/search.summary.interface.d.ts +0 -9
  129. package/dist/interface/search.summary.interface.js +0 -2
  130. package/dist/interface/search.value.interface.d.ts +0 -6
  131. package/dist/interface/search.value.interface.js +0 -3
  132. package/dist/interface/summary.field.interface.d.ts +0 -4
  133. package/dist/interface/summary.field.interface.js +0 -3
  134. package/dist/interface/user.interface.d.ts +0 -4
  135. package/dist/interface/user.interface.js +0 -2
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const uniqId = require("uniqid");
4
- exports.default = (totalLength = 24) => {
5
- const variable = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-_'.split('');
6
- let code = uniqId();
7
- while (true) {
8
- if (code.length < totalLength) {
9
- code = `${code}${variable[Math.ceil(Math.random() * (variable.length - 1))]}`;
10
- }
11
- else {
12
- return code;
13
- }
14
- }
15
- };
@@ -1,2 +0,0 @@
1
- declare function getCargoType(code: string, lang?: string): string | null;
2
- export default getCargoType;
@@ -1,9 +0,0 @@
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;
@@ -1,2 +0,0 @@
1
- declare const _default: () => string;
2
- export default _default;
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const convertDateTimeFormat_1 = require("./convertDateTimeFormat");
4
- const config_1 = require("../constants/config");
5
- exports.default = () => {
6
- return (0, convertDateTimeFormat_1.default)({
7
- initialValue: Date.now(),
8
- dateTimeFormatFrom: config_1.default.date_format_timestamp,
9
- dateTimeFormatTo: config_1.default.date_format_full_datetime_with_separator,
10
- }).toString();
11
- };
@@ -1,2 +0,0 @@
1
- declare const _default: (obj1: any, obj2: any) => Promise<any>;
2
- export default _default;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
13
- exports.default = (obj1, obj2) => __awaiter(void 0, void 0, void 0, function* () {
14
- const keys = Object.keys(obj2);
15
- return new Promise((res) => {
16
- res(keys.filter((key) => {
17
- if (obj1[key] != obj2[key]) {
18
- return true;
19
- }
20
- }).map((key) => ({
21
- [key]: `${obj1[key]} - ${obj2[key]}`,
22
- })));
23
- });
24
- });
@@ -1,2 +0,0 @@
1
- declare const _default: (obj: any, keys: string[]) => Promise<any>;
2
- export default _default;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
13
- exports.default = (obj, keys) => __awaiter(void 0, void 0, void 0, function* () {
14
- return new Promise((res) => {
15
- res(keys.map((key) => ({
16
- [key]: obj[key]
17
- })));
18
- });
19
- });
@@ -1,25 +0,0 @@
1
- import addDateTime from "./addDateTime";
2
- import amountDescription from './amountDescription';
3
- import axiosGet from "./axiosGet";
4
- import axiosPost from "./axiosPost";
5
- import axiosPut from "./axiosPut";
6
- import compareDiffObj from "./compareDiffObj";
7
- import convertCurrencySymbol from "./convertCurrencySymbol";
8
- import convertDateTimeFormat from "./convertDateTimeFormat";
9
- import convertObjToNumber from "./convertObjToNumber";
10
- import convertToCurrency from "./convertToCurrency";
11
- import filterObj from "./filterObj";
12
- import generateRelationId from "./generateRelationId";
13
- import getCurrentDate from "./getCurrentDate";
14
- import getDiffValue from "./getDiffValue";
15
- import getObjByKeys from "./getObjByKeys";
16
- import loop from "./loop";
17
- import loopBackward from "./loopBackward";
18
- import searchValue from "./searchValue";
19
- import readExcel from "./readExcel";
20
- import generateHashString from "./generateHashString";
21
- import mergeObj from "./mergeObj";
22
- import combineObj from "./combineObj";
23
- import calculateByType from './calculateByType';
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, };
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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
- const addDateTime_1 = require("./addDateTime");
5
- exports.addDateTime = addDateTime_1.default;
6
- const amountDescription_1 = require("./amountDescription");
7
- exports.amountDescription = amountDescription_1.default;
8
- const axiosGet_1 = require("./axiosGet");
9
- exports.axiosGet = axiosGet_1.default;
10
- const axiosPost_1 = require("./axiosPost");
11
- exports.axiosPost = axiosPost_1.default;
12
- const axiosPut_1 = require("./axiosPut");
13
- exports.axiosPut = axiosPut_1.default;
14
- const compareDiffObj_1 = require("./compareDiffObj");
15
- exports.compareDiffObj = compareDiffObj_1.default;
16
- const convertCurrencySymbol_1 = require("./convertCurrencySymbol");
17
- exports.convertCurrencySymbol = convertCurrencySymbol_1.default;
18
- const convertDateTimeFormat_1 = require("./convertDateTimeFormat");
19
- exports.convertDateTimeFormat = convertDateTimeFormat_1.default;
20
- const convertObjToNumber_1 = require("./convertObjToNumber");
21
- exports.convertObjToNumber = convertObjToNumber_1.default;
22
- const convertToCurrency_1 = require("./convertToCurrency");
23
- exports.convertToCurrency = convertToCurrency_1.default;
24
- const filterObj_1 = require("./filterObj");
25
- exports.filterObj = filterObj_1.default;
26
- const generateRelationId_1 = require("./generateRelationId");
27
- exports.generateRelationId = generateRelationId_1.default;
28
- const getCurrentDate_1 = require("./getCurrentDate");
29
- exports.getCurrentDate = getCurrentDate_1.default;
30
- const getDiffValue_1 = require("./getDiffValue");
31
- exports.getDiffValue = getDiffValue_1.default;
32
- const getObjByKeys_1 = require("./getObjByKeys");
33
- exports.getObjByKeys = getObjByKeys_1.default;
34
- const loop_1 = require("./loop");
35
- exports.loop = loop_1.default;
36
- const loopBackward_1 = require("./loopBackward");
37
- exports.loopBackward = loopBackward_1.default;
38
- const searchValue_1 = require("./searchValue");
39
- exports.searchValue = searchValue_1.default;
40
- const readExcel_1 = require("./readExcel");
41
- exports.readExcel = readExcel_1.default;
42
- const generateHashString_1 = require("./generateHashString");
43
- exports.generateHashString = generateHashString_1.default;
44
- const mergeObj_1 = require("./mergeObj");
45
- exports.mergeObj = mergeObj_1.default;
46
- const combineObj_1 = require("./combineObj");
47
- exports.combineObj = combineObj_1.default;
48
- const calculateByType_1 = require("./calculateByType");
49
- exports.calculateByType = calculateByType_1.default;
50
- const getCargoType_1 = require("./getCargoType");
51
- exports.getCargoType = getCargoType_1.default;
@@ -1,2 +0,0 @@
1
- declare function loop(list: any[], callback: (data: any) => Promise<any>, result?: any[]): Promise<any>;
2
- export default loop;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- function loop(list, callback, result = []) {
13
- return __awaiter(this, void 0, void 0, function* () {
14
- if (list && list.length > 0) {
15
- const [head, ...tail] = list;
16
- return loop(tail, callback, [yield callback(head), ...result]);
17
- }
18
- return result;
19
- });
20
- }
21
- exports.default = loop;
@@ -1,2 +0,0 @@
1
- declare function loop(list: any[], callback: (data: any) => Promise<any>, result?: any[]): Promise<any>;
2
- export default loop;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- function loop(list, callback, result = []) {
13
- return __awaiter(this, void 0, void 0, function* () {
14
- if (list && list.length > 0) {
15
- const [head, ...tail] = list;
16
- return loop(tail, callback, [...result, yield callback(head)]);
17
- }
18
- return result;
19
- });
20
- }
21
- exports.default = loop;
@@ -1,2 +0,0 @@
1
- declare const _default: (obj1: any, obj2: any) => any;
2
- export default _default;
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = (obj1, obj2) => {
4
- const merged = Object.assign({}, obj1);
5
- for (const key in obj2) {
6
- if (merged[key]) {
7
- // Combine arrays if the key exists in both objects
8
- merged[key] = merged[key].concat(obj2[key]);
9
- }
10
- else {
11
- // Add the new key and its value
12
- merged[key] = obj2[key];
13
- }
14
- }
15
- return merged;
16
- };
@@ -1,5 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import IReadExcel from '../interface/read.excel.interface';
4
- declare function readExcel(file: Buffer, data: IReadExcel): Promise<any>;
5
- export default readExcel;
@@ -1,115 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const helpers_1 = require("../helpers");
13
- const XLSX = require("xlsx");
14
- const excelDateToJsDate_1 = require("./excelDateToJsDate");
15
- const constants_1 = require("../constants");
16
- function readExcel(file, data) {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- const dataPost = [];
19
- let validationPassed = true;
20
- let errorMessage = '';
21
- try {
22
- const { listKey, headerExcel, startRow, startColumn } = data;
23
- const workbook = XLSX.read(file, { type: 'buffer' });
24
- const sheet = workbook.Sheets[workbook.SheetNames[0]];
25
- const merges = sheet['!merges'] || [];
26
- const endRange = XLSX.utils.decode_range(sheet['!ref']);
27
- const endRow = endRange.e.r;
28
- const endColumn = endRange.e.c;
29
- let tempData = {};
30
- const rows = XLSX.utils.sheet_to_json(sheet, {
31
- range: {
32
- s: { c: startColumn || 0, r: startRow || 0 },
33
- e: { c: endColumn, r: endRow },
34
- },
35
- });
36
- const remadeRows = rows.map((item) => {
37
- const remadeItem = {};
38
- for (const key in item) {
39
- const trimmedKey = key.trim();
40
- const value = item[key];
41
- remadeItem[trimmedKey] =
42
- typeof value === 'string' ? value.trim() : value;
43
- }
44
- return remadeItem;
45
- });
46
- for (let i = 0; i < remadeRows.length; i++) {
47
- const rowData = remadeRows[i];
48
- const obj = {};
49
- let isReset = false;
50
- for (let j = 0; j < listKey.length; j++) {
51
- const { name: key, isMandatory, type } = listKey[j];
52
- const header = headerExcel[j];
53
- obj[key] = rowData[header];
54
- if (obj[key] != undefined) {
55
- tempData[key] = obj[key];
56
- }
57
- for (const merge of merges) {
58
- if (i >= merge.s.r &&
59
- i <= merge.e.r &&
60
- j >= merge.s.c &&
61
- j <= merge.e.c) {
62
- console.log(`Merged Cell => ${key} | ${header}`, rowData[header]);
63
- obj[key] = tempData[key];
64
- const nextRow = remadeRows[i + 1];
65
- if (nextRow) {
66
- if (nextRow[header] != undefined &&
67
- nextRow[header] != obj[key]) {
68
- isReset = true;
69
- }
70
- }
71
- }
72
- }
73
- if (isMandatory && obj[key] == undefined) {
74
- validationPassed = false;
75
- errorMessage += `Error in column: ${headerExcel[j]} at row ${i + 1}\n`;
76
- }
77
- obj[key] = convertValue(type, obj[key]);
78
- }
79
- if (isReset) {
80
- tempData = {};
81
- }
82
- dataPost.push(obj);
83
- }
84
- if (!validationPassed) {
85
- throw new Error(errorMessage);
86
- }
87
- return dataPost;
88
- }
89
- catch (err) {
90
- console.error(`[error][${(0, helpers_1.getCurrentDate)()}] ${err.message}`);
91
- throw err;
92
- }
93
- });
94
- }
95
- function convertValue(type, value) {
96
- try {
97
- if (value == undefined)
98
- return undefined;
99
- switch (type) {
100
- case 'date':
101
- return (0, helpers_1.convertDateTimeFormat)({
102
- initialValue: (0, excelDateToJsDate_1.default)({ initialValue: value }).toString(),
103
- dateTimeFormatFrom: constants_1.config.date_format_timestamp,
104
- dateTimeFormatTo: constants_1.config.date_simple_format,
105
- }).toString();
106
- default:
107
- return value;
108
- }
109
- }
110
- catch (error) {
111
- console.error(`[error][provis-read-excel] Failed to convert type: ${type}, value: ${value}, error: ${error.message}`);
112
- return undefined;
113
- }
114
- }
115
- exports.default = readExcel;
@@ -1,4 +0,0 @@
1
- import ISearchQuery from "../interface/search.query.interface";
2
- import ISearchValue from "../interface/search.value.interface";
3
- declare const _default: ({ searchValue, searchKey, operatorValue, keyName, }: ISearchValue) => ISearchQuery | undefined;
4
- export default _default;
@@ -1,63 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const operator_1 = require("../constants/operator");
4
- exports.default = ({ searchValue, searchKey, operatorValue, keyName = searchKey, }) => {
5
- /**
6
- * EXAMPLE: insured=&companyName=&invoiceNumber=123&placingSlipNo=123&productCode=1234&minSumInsured=1000&maxSumInsured=100000&minPremium=100&maxPremium=10000&minPolicyIssueDate=&maxPolicyIssueDate=&minInvoiceIssueDate=&maxInvoiceIssueDate=&minSchedulePaymentDate=&maxSchedulePaymentDate=&minPaymentDate=&maxPaymentDate=&status=&maxCount=
7
- */
8
- const value = searchValue[searchKey];
9
- if (value) {
10
- switch (operatorValue) {
11
- case operator_1.default.OPERATOR_LIKE:
12
- return {
13
- query: `${keyName} iLike :${keyName}`,
14
- key: keyName,
15
- value: `%${value}%`,
16
- };
17
- case operator_1.default.OPERATOR_EXACTLY:
18
- return {
19
- query: `${keyName} = :${keyName}`,
20
- key: keyName,
21
- value,
22
- };
23
- case operator_1.default.OPERATOR_NUMBER_MIN:
24
- return {
25
- query: `${keyName} >= :${searchKey}`,
26
- key: searchKey,
27
- value,
28
- };
29
- case operator_1.default.OPERATOR_NUMBER_MAX:
30
- return {
31
- query: `${keyName} <= :${searchKey}`,
32
- key: searchKey,
33
- value,
34
- };
35
- case operator_1.default.OPERATOR_DATE_MIN:
36
- return {
37
- query: `${keyName} ::date >= :${searchKey}`,
38
- key: searchKey,
39
- value,
40
- };
41
- case operator_1.default.OPERATOR_DATE_MAX:
42
- return {
43
- query: `${keyName} ::date <= :${searchKey}`,
44
- key: searchKey,
45
- value,
46
- };
47
- case operator_1.default.OPERATOR_IN:
48
- return {
49
- query: `${keyName} IN (:...${searchKey})`,
50
- key: searchKey,
51
- value: value.split(','),
52
- };
53
- case operator_1.default.OPERATOR_NOT_IN:
54
- return {
55
- query: `${keyName} NOT IN (:...${searchKey})`,
56
- key: searchKey,
57
- value: value.split(','),
58
- };
59
- default:
60
- return undefined;
61
- }
62
- }
63
- };
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import * as constants from './constants';
2
- import * as helpers from './helpers';
3
- export { constants, helpers, };
package/dist/index.js DELETED
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.helpers = exports.constants = void 0;
4
- const constants = require("./constants");
5
- exports.constants = constants;
6
- const helpers = require("./helpers");
7
- exports.helpers = helpers;
@@ -1,5 +0,0 @@
1
- export default interface IAxios<T> {
2
- statusCode: number;
3
- data?: T;
4
- message?: string;
5
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,10 +0,0 @@
1
- import IMultiJoin from "./multi.join.interface";
2
- import ISearchQuery from "./search.query.interface";
3
- export default interface IFindAllCount {
4
- search: ISearchQuery[];
5
- additionalSearchOr?: ISearchQuery[][];
6
- sortBy?: string;
7
- relations?: IMultiJoin[];
8
- maxCount?: number;
9
- offset?: number;
10
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +0,0 @@
1
- import Join from "../constants/join";
2
- import ISearchQuery from "./search.query.interface";
3
- export default interface IMultiJoin {
4
- model: string;
5
- aliasTable?: string;
6
- join?: Join;
7
- searchs?: ISearchQuery[];
8
- additionalSearchOr?: ISearchQuery[][];
9
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,12 +0,0 @@
1
- interface IListKey {
2
- isMandatory: boolean;
3
- type: string;
4
- name: string;
5
- }
6
- interface IReadExcel {
7
- listKey: IListKey[];
8
- headerExcel: string[];
9
- startRow?: number;
10
- startColumn?: number;
11
- }
12
- export default IReadExcel;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,8 +0,0 @@
1
- import IMultiJoin from "./multi.join.interface";
2
- import ISearchQuery from "./search.query.interface";
3
- export default interface ISearchConditions {
4
- query: any;
5
- search?: ISearchQuery[];
6
- additionalSearchOr?: ISearchQuery[][];
7
- relations?: IMultiJoin[];
8
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,8 +0,0 @@
1
- import IUser from "./user.interface";
2
- export default interface ISearchInitial {
3
- search: any;
4
- maxCount?: number;
5
- offset?: number;
6
- sortBy?: string;
7
- user?: IUser | undefined;
8
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +0,0 @@
1
- export default interface ISearchQuery {
2
- query: string;
3
- key: string;
4
- value: string;
5
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- ;
@@ -1,9 +0,0 @@
1
- import IMultiJoin from "./multi.join.interface";
2
- import ISearchQuery from "./search.query.interface";
3
- import ISummaryField from "./summary.field.interface";
4
- export default interface ISearchSummary {
5
- fieldToSum: ISummaryField[];
6
- search: ISearchQuery[];
7
- additionalSearchOr?: ISearchQuery[][];
8
- relations?: IMultiJoin[];
9
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +0,0 @@
1
- export default interface ISearchValue {
2
- searchValue: any;
3
- searchKey: string;
4
- operatorValue: string;
5
- keyName?: string;
6
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- ;
@@ -1,4 +0,0 @@
1
- export default interface ISummaryField {
2
- columnName: string;
3
- aliasColumnName?: string;
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- ;
@@ -1,4 +0,0 @@
1
- export default interface IUser {
2
- isAdmin: string;
3
- userCode: string;
4
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });