ecotransac-shared-js 1.2.25 → 1.2.28
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/.github/workflows/release-package.yml +4 -2
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
|
@@ -10,9 +10,9 @@ jobs:
|
|
|
10
10
|
runs-on: ubuntu-latest
|
|
11
11
|
steps:
|
|
12
12
|
- uses: actions/checkout@v4
|
|
13
|
-
- uses: pnpm/action-setup@
|
|
13
|
+
- uses: pnpm/action-setup@v4
|
|
14
14
|
with:
|
|
15
|
-
version:
|
|
15
|
+
version: 10.28.0
|
|
16
16
|
- name: Build
|
|
17
17
|
uses: actions/setup-node@v3
|
|
18
18
|
with:
|
|
@@ -20,6 +20,8 @@ jobs:
|
|
|
20
20
|
cache: "pnpm"
|
|
21
21
|
- name: Install dependencies
|
|
22
22
|
run: pnpm install --frozen-lockfile
|
|
23
|
+
env:
|
|
24
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
23
25
|
- name: Build
|
|
24
26
|
run: npm run lint && npm run build
|
|
25
27
|
- name: Publish
|
package/dist/index.js
CHANGED
|
@@ -28,8 +28,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// src/index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
33
|
COMPANY_INFO: () => COMPANY_INFO,
|
|
34
34
|
CONDITIONS: () => CONDITIONS,
|
|
35
35
|
COUNTRIES: () => COUNTRIES,
|
|
@@ -89,12 +89,12 @@ __export(src_exports, {
|
|
|
89
89
|
surfacesFormFields: () => surfacesFormFields,
|
|
90
90
|
technicalFormFields: () => technicalFormFields
|
|
91
91
|
});
|
|
92
|
-
module.exports = __toCommonJS(
|
|
92
|
+
module.exports = __toCommonJS(index_exports);
|
|
93
93
|
|
|
94
94
|
// src/functions/agency-fees.ts
|
|
95
95
|
var import_currency = __toESM(require("currency.js"));
|
|
96
96
|
var import_lodash = require("lodash");
|
|
97
|
-
var getLowThreshold = (isForPro) => isForPro ? { limit: 5e4, fees: 4950 } : { limit: 6e4, fees:
|
|
97
|
+
var getLowThreshold = (isForPro) => isForPro ? { limit: 5e4, fees: 4950 } : { limit: 6e4, fees: 5400 };
|
|
98
98
|
var getFeesPercentage = (price, isForProfessionalUse) => {
|
|
99
99
|
if (isForProfessionalUse) {
|
|
100
100
|
if (price < 5e4) return 0;
|
|
@@ -127,9 +127,9 @@ var getNetPrice = (mandate) => {
|
|
|
127
127
|
return netOwnerPrice;
|
|
128
128
|
};
|
|
129
129
|
var getAgencyFeesPercentage = (mandate) => {
|
|
130
|
-
const
|
|
130
|
+
const displayedPrice = getDisplayedPrice(mandate) || 0;
|
|
131
131
|
const agencyFees = mandate.agencyFees || 0;
|
|
132
|
-
return Number((agencyFees /
|
|
132
|
+
return Number((agencyFees / displayedPrice * 100).toFixed(2));
|
|
133
133
|
};
|
|
134
134
|
var getDisplayedPrice = (mandate) => {
|
|
135
135
|
const netPrice = getNetPrice(mandate);
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/functions/agency-fees.ts
|
|
2
2
|
import currency from "currency.js";
|
|
3
3
|
import { inRange } from "lodash";
|
|
4
|
-
var getLowThreshold = (isForPro) => isForPro ? { limit: 5e4, fees: 4950 } : { limit: 6e4, fees:
|
|
4
|
+
var getLowThreshold = (isForPro) => isForPro ? { limit: 5e4, fees: 4950 } : { limit: 6e4, fees: 5400 };
|
|
5
5
|
var getFeesPercentage = (price, isForProfessionalUse) => {
|
|
6
6
|
if (isForProfessionalUse) {
|
|
7
7
|
if (price < 5e4) return 0;
|
|
@@ -34,9 +34,9 @@ var getNetPrice = (mandate) => {
|
|
|
34
34
|
return netOwnerPrice;
|
|
35
35
|
};
|
|
36
36
|
var getAgencyFeesPercentage = (mandate) => {
|
|
37
|
-
const
|
|
37
|
+
const displayedPrice = getDisplayedPrice(mandate) || 0;
|
|
38
38
|
const agencyFees = mandate.agencyFees || 0;
|
|
39
|
-
return Number((agencyFees /
|
|
39
|
+
return Number((agencyFees / displayedPrice * 100).toFixed(2));
|
|
40
40
|
};
|
|
41
41
|
var getDisplayedPrice = (mandate) => {
|
|
42
42
|
const netPrice = getNetPrice(mandate);
|