@jetthai/cuora 1.1.204 → 1.1.206

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,10 @@
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.206](https://github.com/jetthai/cuora-module/compare/v1.1.205...v1.1.206) (2023-11-21)
6
+
7
+ ### [1.1.205](https://github.com/jetthai/cuora-module/compare/v1.1.204...v1.1.205) (2023-11-21)
8
+
5
9
  ### [1.1.204](https://github.com/jetthai/cuora-module/compare/v1.1.203...v1.1.204) (2023-11-15)
6
10
 
7
11
  ### [1.1.203](https://github.com/jetthai/cuora-module/compare/v1.1.202...v1.1.203) (2023-11-14)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.204",
3
+ "version": "1.1.206",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -10,6 +10,7 @@ export default function (request) {
10
10
  activityNo: null,
11
11
  activityDetail: null,
12
12
  conditions: null,
13
+ rebateType: null,
13
14
  currentReachLevel: null,
14
15
  nextReachLevel: null,
15
16
  lastPeriod: null,
@@ -76,6 +77,7 @@ export default function (request) {
76
77
  }),
77
78
  setInitData: assign((context, event) => {
78
79
  const {
80
+ rebateType,
79
81
  conditions = [],
80
82
  currentReachLevel = {},
81
83
  nextReachLevel = {},
@@ -100,21 +102,39 @@ export default function (request) {
100
102
  },
101
103
  ],
102
104
  rebatePercentageSetting: '-',
103
- rewardType: '',
105
+ rewardType: conditions?.[0]?.rewardType,
104
106
  title: 'PLASTIC',
105
107
  turnoverLimit: '-',
106
- withdrawRule: '',
108
+ withdrawRule: conditions?.[0]?.withdrawRule,
107
109
  })
108
110
 
111
+ let nextDepositLimit = '0'
112
+ let nextTurnoverLimit = '0'
113
+ let currentTurnover = '0'
114
+ let currentDeposit = '0'
115
+ // 若已達到最高等級,所有數值皆以最高等級顯示
116
+ if (currentReachLevel?.title === conditions?.[conditions?.length - 1]?.title) {
117
+ currentDeposit = conditions[conditions.length - 1].depositLimit
118
+ currentTurnover = conditions[conditions.length - 1].turnoverLimit
119
+ nextDepositLimit = conditions[conditions.length - 1].depositLimit
120
+ nextTurnoverLimit = conditions[conditions.length - 1].turnoverLimit
121
+ } else {
122
+ currentDeposit = currentTotalDeposit
123
+ currentTurnover = currentTotalTurnover
124
+ nextDepositLimit = nextReachLevel?.depositLimit
125
+ nextTurnoverLimit = nextReachLevel?.turnoverLimit
126
+ }
127
+
109
128
  return {
129
+ rebateType,
110
130
  conditions: copiedData,
111
131
  currentReachLevel,
112
132
  nextReachLevel,
113
133
  lastPeriod,
114
- nextDepositLimit: nextReachLevel?.depositLimit || '0',
115
- nextTurnoverLimit: nextReachLevel?.turnoverLimit || '0',
116
- currentTotalDeposit,
117
- currentTotalTurnover,
134
+ nextDepositLimit,
135
+ nextTurnoverLimit,
136
+ currentTotalDeposit: currentDeposit,
137
+ currentTotalTurnover: currentTurnover,
118
138
  retainAmount,
119
139
  yesterdayReward,
120
140
  calculateWalletMode,