@jetthai/cuora 1.1.96 → 1.1.98

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.98](https://github.com/jetthai/cuora-module/compare/v1.1.97...v1.1.98) (2023-05-18)
6
+
7
+ ### [1.1.97](https://github.com/jetthai/cuora-module/compare/v1.1.96...v1.1.97) (2023-05-16)
8
+
5
9
  ### [1.1.96](https://github.com/jetthai/cuora-module/compare/v1.1.95...v1.1.96) (2023-05-15)
6
10
 
7
11
  ### [1.1.95](https://github.com/jetthai/cuora-module/compare/v1.1.94-cash-5...v1.1.95) (2023-05-12)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetthai/cuora",
3
- "version": "1.1.96",
3
+ "version": "1.1.98",
4
4
  "description": "",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -43,8 +43,9 @@ export default function (request, context) {
43
43
  },
44
44
  },
45
45
  loaded: {
46
- always: [{ target: 'awardable', cond: 'isAwardable' }, { target: 'awarded' }],
46
+ always: [{ target: 'limitDepositedUser', cond: 'isDepositedUser' }, { target: 'awardable', cond: 'isAwardable' }, { target: 'awarded' }],
47
47
  },
48
+ limitDepositedUser: {},
48
49
  awardable: {
49
50
  entry: 'setDuration',
50
51
  on: {
@@ -138,8 +139,9 @@ export default function (request, context) {
138
139
  }),
139
140
  },
140
141
  guards: {
141
- hasActivityNo: (context, event) => {
142
- return context.activityNo
142
+ isDepositedUser: (context, event) => {
143
+ const { userType = 0, receiveStatus = 0 } = context.activityDetail
144
+ return userType === 1 && receiveStatus === 0
143
145
  },
144
146
  isAwardable: (context, event) => {
145
147
  return context.activityDetail?.receiveStatus === 2
@@ -216,12 +216,13 @@ export default function (request, context) {
216
216
  },
217
217
  services: {
218
218
  fetchCalculation: async (context, event) => {
219
- const { selectedCrypto, selectedAmount } = context
219
+ const { selectedCrypto, selectedAmount, promotion } = context
220
220
  return await request.send(
221
221
  payment.getDepositExpectedResult({
222
222
  method: selectedCrypto.method,
223
223
  amount: selectedAmount,
224
224
  cryptoCurrency: selectedCrypto.channel,
225
+ promotionsNo: promotion?.promotionsNo,
225
226
  })
226
227
  )
227
228
  },