feat: individual discounts migration
feat: loyalty panel routing chore: rename promo-codes module to loyalty
This commit is contained in:
parent
576979f14f
commit
07f15db851
14 changed files with 183 additions and 55 deletions
16
lib/new-admin/graphql/resolvers/loyalty.resolver.js
Normal file
16
lib/new-admin/graphql/resolvers/loyalty.resolver.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
const loyalty = require('../../../loyalty')
|
||||
|
||||
const resolvers = {
|
||||
Query: {
|
||||
promoCodes: () => loyalty.getAvailablePromoCodes(),
|
||||
individualDiscounts: () => loyalty.getAvailableIndividualDiscounts()
|
||||
},
|
||||
Mutation: {
|
||||
createPromoCode: (...[, { code, discount }]) => loyalty.createPromoCode(code, discount),
|
||||
deletePromoCode: (...[, { codeId }]) => loyalty.deletePromoCode(codeId),
|
||||
createIndividualDiscount: (...[, { identificationType, value, discount }]) => loyalty.createIndividualDiscount(identificationType, value, discount),
|
||||
deleteIndividualDiscount: (...[, { discountId }]) => loyalty.deleteIndividualDiscount(discountId)
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = resolvers
|
||||
Loading…
Add table
Add a link
Reference in a new issue