@escapenavigator/utils 1.6.46 → 1.6.47

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: +(receivedTransactionsAmount / 100).toFixed(2),
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: +(receivedTransactionsAmount / 100).toFixed(2),
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: +(fineAmount / 100).toFixed(2),
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: +(fineAmount / 100).toFixed(2),
82
+ fineAmount,
83
83
  chargeAmount: 0,
84
- returnAmount: +(returnAmount / 100).toFixed(2),
84
+ returnAmount,
85
85
  allowedCancelation,
86
86
  };
87
87
  }
88
88
  return {
89
89
  type: FineDescriptions.WITH_CHARGE,
90
- fineAmount: +(fineAmount / 100).toFixed(2),
90
+ fineAmount,
91
91
  returnAmount: 0,
92
- chargeAmount: +(chargeAmount / 100).toFixed(2),
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.46",
3
+ "version": "1.6.47",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -55,5 +55,5 @@
55
55
  "node_modules"
56
56
  ]
57
57
  },
58
- "gitHead": "37278dbb4bf653455cebec4826e5ad01f609c66e"
58
+ "gitHead": "decfa66b6f936aa8deef11fefea57e52e273b24d"
59
59
  }