@provis/provis-common-be-module 1.7.0 → 1.7.2

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.
@@ -13,6 +13,13 @@ declare const brokerage: {
13
13
  id: string;
14
14
  };
15
15
  };
16
+ TYPE_BROKERAGE_TOTAL: {
17
+ code: string;
18
+ desc: {
19
+ en: string;
20
+ id: string;
21
+ };
22
+ };
16
23
  LIST: any[];
17
24
  };
18
25
  export default brokerage;
@@ -15,8 +15,16 @@ const brokerage = {
15
15
  id: "Persentase"
16
16
  },
17
17
  },
18
+ TYPE_BROKERAGE_TOTAL: {
19
+ code: 't',
20
+ desc: {
21
+ en: "Total",
22
+ id: "Total"
23
+ },
24
+ },
18
25
  LIST: [],
19
26
  };
20
27
  brokerage.LIST.push(brokerage.TYPE_BROKERAGE_FIX_AMOUNT);
21
28
  brokerage.LIST.push(brokerage.TYPE_BROKERAGE_PERCENTAGE);
29
+ brokerage.LIST.push(brokerage.TYPE_BROKERAGE_TOTAL);
22
30
  exports.default = brokerage;
@@ -0,0 +1,5 @@
1
+ export default function (request: {
2
+ amount: number;
3
+ rate: number;
4
+ type: string;
5
+ }): number | null;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const brokerage_1 = require("../constants/brokerage");
4
+ function default_1(request) {
5
+ switch (request.type.toLowerCase()) {
6
+ case brokerage_1.default.TYPE_BROKERAGE_FIX_AMOUNT.code:
7
+ return request.rate;
8
+ case brokerage_1.default.TYPE_BROKERAGE_PERCENTAGE.code:
9
+ return request.rate * request.amount;
10
+ default: null;
11
+ }
12
+ }
13
+ exports.default = default_1;
@@ -20,4 +20,5 @@ import readExcel from "./readExcel";
20
20
  import generateHashString from "./generateHashString";
21
21
  import mergeObj from "./mergeObj";
22
22
  import combineObj from "./combineObj";
23
- export { addDateTime, amountDescription, axiosGet, axiosPost, axiosPut, compareDiffObj, convertCurrencySymbol, convertDateTimeFormat, convertObjToNumber, convertToCurrency, filterObj, generateRelationId, getCurrentDate, getDiffValue, getObjByKeys, loop, loopBackward, searchValue, readExcel, generateHashString, mergeObj, combineObj, };
23
+ import calculateByType from './calculateByType';
24
+ export { addDateTime, amountDescription, axiosGet, axiosPost, axiosPut, compareDiffObj, convertCurrencySymbol, convertDateTimeFormat, convertObjToNumber, convertToCurrency, filterObj, generateRelationId, getCurrentDate, getDiffValue, getObjByKeys, loop, loopBackward, searchValue, readExcel, generateHashString, mergeObj, combineObj, calculateByType, };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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.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");
@@ -45,3 +45,5 @@ const mergeObj_1 = require("./mergeObj");
45
45
  exports.mergeObj = mergeObj_1.default;
46
46
  const combineObj_1 = require("./combineObj");
47
47
  exports.combineObj = combineObj_1.default;
48
+ const calculateByType_1 = require("./calculateByType");
49
+ exports.calculateByType = calculateByType_1.default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@provis/provis-common-be-module",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "This common module for Provis internal backend use lib",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {