@escapenavigator/utils 1.10.1 → 1.10.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.
|
@@ -15,7 +15,7 @@ declare type Props = {
|
|
|
15
15
|
certificates: Array<{
|
|
16
16
|
nominal: number;
|
|
17
17
|
}>;
|
|
18
|
-
|
|
18
|
+
playersPrice: number;
|
|
19
19
|
payed: number;
|
|
20
20
|
minimalPrice: number;
|
|
21
21
|
slotDiscount: number;
|
|
@@ -32,7 +32,7 @@ export declare const isCancelationAllowed: ({ date, minHoursForFreeCanceling, }:
|
|
|
32
32
|
date: string;
|
|
33
33
|
minHoursForFreeCanceling: number;
|
|
34
34
|
}) => boolean;
|
|
35
|
-
export declare function getOrderCancelationState({ cancelationReason, cancelationRule, cancelationAmount, transactions, date, returnCertificates, certificates, minHoursForFreeCanceling,
|
|
35
|
+
export declare function getOrderCancelationState({ cancelationReason, cancelationRule, cancelationAmount, transactions, date, returnCertificates, certificates, minHoursForFreeCanceling, playersPrice, slotDiscount, payed, minimalPrice, }: Props): {
|
|
36
36
|
fineAmount: number;
|
|
37
37
|
returnAmount: number;
|
|
38
38
|
allowedCancelation: boolean;
|
|
@@ -23,7 +23,7 @@ var FineDescriptions;
|
|
|
23
23
|
})(FineDescriptions = exports.FineDescriptions || (exports.FineDescriptions = {}));
|
|
24
24
|
const isCancelationAllowed = ({ date, minHoursForFreeCanceling = 0, }) => (0, differenceInHours_1.default)(new Date(date), new Date()) >= minHoursForFreeCanceling;
|
|
25
25
|
exports.isCancelationAllowed = isCancelationAllowed;
|
|
26
|
-
function getOrderCancelationState({ cancelationReason, cancelationRule, cancelationAmount, transactions, date, returnCertificates, certificates, minHoursForFreeCanceling,
|
|
26
|
+
function getOrderCancelationState({ cancelationReason, cancelationRule, cancelationAmount, transactions, date, returnCertificates, certificates, minHoursForFreeCanceling, playersPrice, slotDiscount = 0, payed, minimalPrice, }) {
|
|
27
27
|
const minHours = cancelationRule === questroom_cancelation_type_enum_1.QuestroomCancelationTypeEnum.NO ? 0 : minHoursForFreeCanceling;
|
|
28
28
|
const allowedCancelation = cancelationReason === order_cancel_reson_enum_1.OrderCancelReasonEnum.QUESTROOM ||
|
|
29
29
|
(0, exports.isCancelationAllowed)({
|
|
@@ -39,7 +39,7 @@ function getOrderCancelationState({ cancelationReason, cancelationRule, cancelat
|
|
|
39
39
|
: payed;
|
|
40
40
|
const fineAmount = +(0, get_cancelation_fee_amount_1.getCancelationFeeAmount)({
|
|
41
41
|
cancelationRule,
|
|
42
|
-
total,
|
|
42
|
+
total: playersPrice,
|
|
43
43
|
slotDiscount,
|
|
44
44
|
minimalPrice,
|
|
45
45
|
cancelationAmount,
|
|
@@ -18,7 +18,7 @@ describe('getOrderCancelationState function', () => {
|
|
|
18
18
|
certificates: [],
|
|
19
19
|
minHoursForFreeCanceling: 48,
|
|
20
20
|
slotDiscount: 0,
|
|
21
|
-
|
|
21
|
+
playersPrice: 100,
|
|
22
22
|
payed: 20,
|
|
23
23
|
minimalPrice: 50,
|
|
24
24
|
});
|
|
@@ -41,7 +41,7 @@ describe('getOrderCancelationState function', () => {
|
|
|
41
41
|
slotDiscount: 0,
|
|
42
42
|
certificates: [],
|
|
43
43
|
minHoursForFreeCanceling: 48,
|
|
44
|
-
|
|
44
|
+
playersPrice: 100,
|
|
45
45
|
payed: 30,
|
|
46
46
|
minimalPrice: 50,
|
|
47
47
|
});
|
|
@@ -64,7 +64,7 @@ describe('getOrderCancelationState function', () => {
|
|
|
64
64
|
returnCertificates: true,
|
|
65
65
|
certificates: [],
|
|
66
66
|
minHoursForFreeCanceling: 48,
|
|
67
|
-
|
|
67
|
+
playersPrice: 100,
|
|
68
68
|
payed: 0,
|
|
69
69
|
minimalPrice: 50,
|
|
70
70
|
});
|
|
@@ -92,7 +92,7 @@ describe('getOrderCancelationState function', () => {
|
|
|
92
92
|
returnCertificates: true,
|
|
93
93
|
certificates: [],
|
|
94
94
|
minHoursForFreeCanceling: 48,
|
|
95
|
-
|
|
95
|
+
playersPrice: 100,
|
|
96
96
|
payed: 20,
|
|
97
97
|
minimalPrice: 50,
|
|
98
98
|
});
|
|
@@ -120,7 +120,7 @@ describe('getOrderCancelationState function', () => {
|
|
|
120
120
|
returnCertificates: true,
|
|
121
121
|
certificates: [],
|
|
122
122
|
minHoursForFreeCanceling: 48,
|
|
123
|
-
|
|
123
|
+
playersPrice: 100,
|
|
124
124
|
payed: 100,
|
|
125
125
|
minimalPrice: 50,
|
|
126
126
|
});
|
|
@@ -148,7 +148,7 @@ describe('getOrderCancelationState function', () => {
|
|
|
148
148
|
returnCertificates: true,
|
|
149
149
|
certificates: [],
|
|
150
150
|
minHoursForFreeCanceling: 48,
|
|
151
|
-
|
|
151
|
+
playersPrice: 100,
|
|
152
152
|
payed: 100,
|
|
153
153
|
minimalPrice: 50,
|
|
154
154
|
});
|
|
@@ -176,7 +176,7 @@ describe('getOrderCancelationState function', () => {
|
|
|
176
176
|
returnCertificates: true,
|
|
177
177
|
certificates: [],
|
|
178
178
|
minHoursForFreeCanceling: 48,
|
|
179
|
-
|
|
179
|
+
playersPrice: 100,
|
|
180
180
|
payed: 100,
|
|
181
181
|
minimalPrice: 50,
|
|
182
182
|
});
|
|
@@ -204,7 +204,7 @@ describe('getOrderCancelationState function', () => {
|
|
|
204
204
|
returnCertificates: true,
|
|
205
205
|
certificates: [],
|
|
206
206
|
minHoursForFreeCanceling: 48,
|
|
207
|
-
|
|
207
|
+
playersPrice: 100,
|
|
208
208
|
payed: 100,
|
|
209
209
|
minimalPrice: 50,
|
|
210
210
|
});
|
|
@@ -232,7 +232,7 @@ describe('getOrderCancelationState function', () => {
|
|
|
232
232
|
returnCertificates: true,
|
|
233
233
|
certificates: [],
|
|
234
234
|
minHoursForFreeCanceling: 48,
|
|
235
|
-
|
|
235
|
+
playersPrice: 100,
|
|
236
236
|
payed: 50,
|
|
237
237
|
minimalPrice: 50,
|
|
238
238
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@escapenavigator/utils",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"test": "jest"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@escapenavigator/types": "^1.10.
|
|
17
|
+
"@escapenavigator/types": "^1.10.2",
|
|
18
18
|
"axios": "^0.21.4",
|
|
19
19
|
"class-transformer": "^0.5.1",
|
|
20
20
|
"class-validator": "^0.13.2",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"node_modules"
|
|
56
56
|
]
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "ae85440284de3c5cde10221861a888fd3669fce7"
|
|
59
59
|
}
|