@jetthai/cuora 1.1.305-dev-5 → 1.1.305-dev-6

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/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.1.305-dev-6](https://github.com/jetthai/cuora-module/compare/v1.1.305-dev-5...v1.1.305-dev-6) (2024-09-13)
6
+
5
7
  ### [1.1.305-dev-5](https://github.com/jetthai/cuora-module/compare/v1.1.305-dev-4...v1.1.305-dev-5) (2024-09-13)
6
8
 
7
9
  ### [1.1.305-dev-4](https://github.com/jetthai/cuora-module/compare/v1.1.305-dev-3...v1.1.305-dev-4) (2024-09-13)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.305-dev-5",
3
+ "version": "1.1.305-dev-6",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -159,34 +159,20 @@ export default function (request) {
159
159
  },
160
160
  isInsufficientAmount: (context, event) => {
161
161
  const { collectAvailable, singleMinimumAmountReceive, actualRebateAmount } = context
162
- let splitArray = actualRebateAmount?.split(',')
163
- let combindString = '0'
164
- if (splitArray?.length > 0) {
165
- splitArray.forEach((item) => {
166
- combindString += item
167
- })
168
- } else {
169
- combindString = actualRebateAmount
170
- }
171
- const deformatRebateAmount = parseFloat(`${combindString}`)
172
- return !collectAvailable && deformatRebateAmount < parseFloat(`${singleMinimumAmountReceive}`)
162
+ const formattedSingleMinimumAmountReceive = parseFloat(singleMinimumAmountReceive.replace(/,/g, ''))
163
+ const formattedActualRebateAmount = parseFloat(actualRebateAmount.replace(/,/g, ''))
164
+
165
+ return !collectAvailable && parseFloat(`${formattedActualRebateAmount}`) < parseFloat(`${formattedSingleMinimumAmountReceive}`)
173
166
  },
174
167
  isClaimEnable: (context, event) => {
175
168
  const { collectAvailable, remainingCount, dailyRedemptionLimit, actualRebateAmount, singleMinimumAmountReceive } = context
176
- let splitArray = actualRebateAmount?.split(',')
177
- let combindString = '0'
178
- if (splitArray?.length > 0) {
179
- splitArray.forEach((item) => {
180
- combindString += item
181
- })
182
- } else {
183
- combindString = actualRebateAmount
184
- }
185
- const deformatRebateAmount = parseFloat(combindString)
169
+ const formattedSingleMinimumAmountReceive = parseFloat(singleMinimumAmountReceive.replace(/,/g, ''))
170
+ const formattedActualRebateAmount = parseFloat(actualRebateAmount.replace(/,/g, ''))
171
+
186
172
  return (
187
173
  collectAvailable &&
188
174
  parseInt(`${remainingCount}`) < parseInt(`${dailyRedemptionLimit}`) &&
189
- deformatRebateAmount >= parseFloat(`${singleMinimumAmountReceive}`)
175
+ parseFloat(`${formattedActualRebateAmount}`) >= parseFloat(`${formattedSingleMinimumAmountReceive}`)
190
176
  )
191
177
  },
192
178
  isClaimSuccess: (context, event) => {