@escapenavigator/types 2.1.8 → 2.1.9
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/constants/navigator-certificate-redeem.d.ts +9 -0
- package/dist/constants/navigator-certificate-redeem.js +15 -0
- package/dist/constants/navigator-site.d.ts +4 -0
- package/dist/constants/navigator-site.js +12 -0
- package/dist/navigator-certificate/request-navigator-certificate-redeem.dto.d.ts +2 -1
- package/dist/navigator-certificate/request-navigator-certificate-redeem.dto.js +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** International (Stripe) platform fee when a questroom redeems a Navigator certificate. */
|
|
2
|
+
export declare const NAVIGATOR_CERTIFICATE_REDEEM_FEE_RATE_INTL = 0.08;
|
|
3
|
+
/** RU payout goes to CRM balance; platform fee is 20%. */
|
|
4
|
+
export declare const NAVIGATOR_CERTIFICATE_REDEEM_FEE_RATE_RU = 0.2;
|
|
5
|
+
export declare const navigatorCertificateRedeemFeeRate: (ru: boolean) => number;
|
|
6
|
+
export declare const navigatorCertificateRedeemPayout: (usedAmount: number, feeRate: number) => {
|
|
7
|
+
amountToPay: number;
|
|
8
|
+
commission: number;
|
|
9
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.navigatorCertificateRedeemPayout = exports.navigatorCertificateRedeemFeeRate = exports.NAVIGATOR_CERTIFICATE_REDEEM_FEE_RATE_RU = exports.NAVIGATOR_CERTIFICATE_REDEEM_FEE_RATE_INTL = void 0;
|
|
4
|
+
/** International (Stripe) platform fee when a questroom redeems a Navigator certificate. */
|
|
5
|
+
exports.NAVIGATOR_CERTIFICATE_REDEEM_FEE_RATE_INTL = 0.08;
|
|
6
|
+
/** RU payout goes to CRM balance; platform fee is 20%. */
|
|
7
|
+
exports.NAVIGATOR_CERTIFICATE_REDEEM_FEE_RATE_RU = 0.2;
|
|
8
|
+
const navigatorCertificateRedeemFeeRate = (ru) => ru ? exports.NAVIGATOR_CERTIFICATE_REDEEM_FEE_RATE_RU : exports.NAVIGATOR_CERTIFICATE_REDEEM_FEE_RATE_INTL;
|
|
9
|
+
exports.navigatorCertificateRedeemFeeRate = navigatorCertificateRedeemFeeRate;
|
|
10
|
+
const navigatorCertificateRedeemPayout = (usedAmount, feeRate) => {
|
|
11
|
+
const amountToPay = Math.round(usedAmount * (1 - feeRate));
|
|
12
|
+
const commission = usedAmount - amountToPay;
|
|
13
|
+
return { amountToPay, commission };
|
|
14
|
+
};
|
|
15
|
+
exports.navigatorCertificateRedeemPayout = navigatorCertificateRedeemPayout;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CountriesEnum } from '../shared/enum/countries.enum';
|
|
2
|
+
export declare const navigatorSiteHost: (country?: CountriesEnum | null) => string;
|
|
3
|
+
export declare const navigatorSiteUrl: (country?: CountriesEnum | null) => string;
|
|
4
|
+
export declare const navigatorInfoEmail: (country?: CountriesEnum | null) => string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.navigatorInfoEmail = exports.navigatorSiteUrl = exports.navigatorSiteHost = void 0;
|
|
4
|
+
const countries_enum_1 = require("../shared/enum/countries.enum");
|
|
5
|
+
const namespaces_enum_1 = require("../shared/enum/namespaces.enum");
|
|
6
|
+
const namespace_by_country_1 = require("./namespace-by-country");
|
|
7
|
+
const navigatorSiteHost = (country) => `escapenavigator.${namespace_by_country_1.namespaceByCountry[country || countries_enum_1.CountriesEnum.USA] || namespaces_enum_1.NamespacesEnum.USA}`;
|
|
8
|
+
exports.navigatorSiteHost = navigatorSiteHost;
|
|
9
|
+
const navigatorSiteUrl = (country) => `https://${(0, exports.navigatorSiteHost)(country)}`;
|
|
10
|
+
exports.navigatorSiteUrl = navigatorSiteUrl;
|
|
11
|
+
const navigatorInfoEmail = (country) => country === countries_enum_1.CountriesEnum.RUSSIA ? 'info@escapenavigator.ru' : 'info@escapenavigator.com';
|
|
12
|
+
exports.navigatorInfoEmail = navigatorInfoEmail;
|
|
@@ -32,6 +32,7 @@ __decorate([
|
|
|
32
32
|
__metadata("design:type", Number)
|
|
33
33
|
], RequestNavigatorCertificateRedeemDto.prototype, "usedAmount", void 0);
|
|
34
34
|
__decorate([
|
|
35
|
+
(0, class_validator_1.IsOptional)(),
|
|
35
36
|
(0, class_transformer_1.Type)(() => Number),
|
|
36
37
|
(0, class_validator_1.IsInt)(),
|
|
37
38
|
(0, class_validator_1.Min)(1),
|