fix: change coupons to promo codes
This commit is contained in:
parent
840afa866d
commit
59cb33570b
8 changed files with 87 additions and 88 deletions
|
|
@ -13,7 +13,7 @@ const settingsLoader = require('../../new-settings-loader')
|
|||
// const tokenManager = require('../../token-manager')
|
||||
const blacklist = require('../../blacklist')
|
||||
const machineEventsByIdBatch = require("../../postgresql_interface").machineEventsByIdBatch
|
||||
const couponManager = require('../../coupons')
|
||||
const promoCodeManager = require('../../promo-codes')
|
||||
|
||||
const serverVersion = require('../../../package.json').version
|
||||
const transactions = require('../transactions')
|
||||
|
|
@ -177,7 +177,7 @@ const typeDefs = gql`
|
|||
ip_address: String
|
||||
}
|
||||
|
||||
type Coupon {
|
||||
type PromoCode {
|
||||
id: ID!
|
||||
code: String!
|
||||
discount: Int!
|
||||
|
|
@ -276,7 +276,7 @@ const typeDefs = gql`
|
|||
config: JSONObject
|
||||
blacklist: [Blacklist]
|
||||
# userTokens: [UserToken]
|
||||
coupons: [Coupon]
|
||||
promoCodes: [PromoCode]
|
||||
cryptoRates: JSONObject
|
||||
fiatRates: [Rate]
|
||||
}
|
||||
|
|
@ -310,8 +310,8 @@ const typeDefs = gql`
|
|||
# revokeToken(token: String!): UserToken
|
||||
deleteBlacklistRow(cryptoCode: String!, address: String!): Blacklist
|
||||
insertBlacklistRow(cryptoCode: String!, address: String!): Blacklist
|
||||
createCoupon(code: String!, discount: Int!): Coupon
|
||||
deleteCoupon(couponId: ID!): Coupon
|
||||
createPromoCode(code: String!, discount: Int!): PromoCode
|
||||
deletePromoCode(codeId: ID!): PromoCode
|
||||
}
|
||||
`
|
||||
|
||||
|
|
@ -362,7 +362,7 @@ const resolvers = {
|
|||
accounts: () => settingsLoader.loadAccounts(),
|
||||
blacklist: () => blacklist.getBlacklist(),
|
||||
// userTokens: () => tokenManager.getTokenList()
|
||||
coupons: () => couponManager.getAvailableCoupons(),
|
||||
promoCodes: () => promoCodeManager.getAvailablePromoCodes(),
|
||||
cryptoRates: () =>
|
||||
settingsLoader.loadLatest().then(settings => {
|
||||
const pi = plugins(settings)
|
||||
|
|
@ -372,7 +372,7 @@ const resolvers = {
|
|||
withoutCommissions: pi.buildRatesNoCommission(r)
|
||||
}
|
||||
})
|
||||
}),
|
||||
}),
|
||||
fiatRates: () => forex.getFiatRates()
|
||||
},
|
||||
Mutation: {
|
||||
|
|
@ -396,8 +396,8 @@ const resolvers = {
|
|||
insertBlacklistRow: (...[, { cryptoCode, address }]) =>
|
||||
blacklist.insertIntoBlacklist(cryptoCode, address),
|
||||
// revokeToken: (...[, { token }]) => tokenManager.revokeToken(token)
|
||||
createCoupon: (...[, { code, discount }]) => couponManager.createCoupon(code, discount),
|
||||
deleteCoupon: (...[, { couponId }]) => couponManager.deleteCoupon(couponId)
|
||||
createPromoCode: (...[, { code, discount }]) => promoCodeManager.createPromoCode(code, discount),
|
||||
deletePromoCode: (...[, { codeId }]) => promoCodeManager.deletePromoCode(codeId)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue