@escapenavigator/utils 1.6.46 → 1.6.48
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.
|
@@ -37,7 +37,7 @@ function getOrderCancelationState({ cancelationReason, cancelationRule, transact
|
|
|
37
37
|
const orderPayment = returnCertificates
|
|
38
38
|
? payed - certificates.reduce((acc, c) => acc + c.nominal, 0)
|
|
39
39
|
: payed;
|
|
40
|
-
const fineAmount = (0, get_cancelation_fee_amount_1.getCancelationFeeAmount)({ cancelationRule, total, minimalPrice });
|
|
40
|
+
const fineAmount = +(0, get_cancelation_fee_amount_1.getCancelationFeeAmount)({ cancelationRule, total, minimalPrice }).toFixed(0);
|
|
41
41
|
const chargeAmount = fineAmount - orderPayment;
|
|
42
42
|
/**
|
|
43
43
|
* Кейсы, если игра отменяется в срок
|
|
@@ -48,7 +48,7 @@ function getOrderCancelationState({ cancelationReason, cancelationRule, transact
|
|
|
48
48
|
return {
|
|
49
49
|
fineAmount: 0,
|
|
50
50
|
chargeAmount: 0,
|
|
51
|
-
returnAmount:
|
|
51
|
+
returnAmount: receivedTransactionsAmount,
|
|
52
52
|
allowedCancelation,
|
|
53
53
|
type: fineAmount ? FineDescriptions.NO_FINE : FineDescriptions.FINE_TON_SETUP,
|
|
54
54
|
};
|
|
@@ -57,7 +57,7 @@ function getOrderCancelationState({ cancelationReason, cancelationRule, transact
|
|
|
57
57
|
return {
|
|
58
58
|
fineAmount: 0,
|
|
59
59
|
chargeAmount: 0,
|
|
60
|
-
returnAmount:
|
|
60
|
+
returnAmount: receivedTransactionsAmount,
|
|
61
61
|
allowedCancelation,
|
|
62
62
|
type: autoReturtAvailable ? FineDescriptions.AUTO_RETURN : FineDescriptions.HAND_RETURN,
|
|
63
63
|
};
|
|
@@ -70,26 +70,26 @@ function getOrderCancelationState({ cancelationReason, cancelationRule, transact
|
|
|
70
70
|
type: FineDescriptions.FINE_PAID,
|
|
71
71
|
returnAmount: 0,
|
|
72
72
|
chargeAmount: 0,
|
|
73
|
-
fineAmount
|
|
73
|
+
fineAmount,
|
|
74
74
|
allowedCancelation,
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
if (chargeAmount < 0) {
|
|
78
|
-
const returnAmount = chargeAmount * -1;
|
|
78
|
+
const returnAmount = +(chargeAmount * -1).toFixed(0);
|
|
79
79
|
const allowAutoReturn = autoReturtAvailable && receivedTransactionsAmount >= returnAmount;
|
|
80
80
|
return {
|
|
81
81
|
type: allowAutoReturn ? FineDescriptions.AUTO_RETURN : FineDescriptions.HAND_RETURN,
|
|
82
|
-
fineAmount
|
|
82
|
+
fineAmount,
|
|
83
83
|
chargeAmount: 0,
|
|
84
|
-
returnAmount
|
|
84
|
+
returnAmount,
|
|
85
85
|
allowedCancelation,
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
return {
|
|
89
89
|
type: FineDescriptions.WITH_CHARGE,
|
|
90
|
-
fineAmount
|
|
90
|
+
fineAmount,
|
|
91
91
|
returnAmount: 0,
|
|
92
|
-
chargeAmount
|
|
92
|
+
chargeAmount,
|
|
93
93
|
allowedCancelation,
|
|
94
94
|
};
|
|
95
95
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@escapenavigator/utils",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.48",
|
|
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.6.
|
|
17
|
+
"@escapenavigator/types": "^1.6.47",
|
|
18
18
|
"axios": "^0.21.4",
|
|
19
19
|
"class-transformer": "^0.5.1",
|
|
20
20
|
"class-validator": "^0.13.1",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"node_modules"
|
|
56
56
|
]
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "e012660512e3fe0c441bdb1d5c0c0dc2bf466c93"
|
|
59
59
|
}
|