feat: customer matching on individual discounts panel
This commit is contained in:
parent
eda6decae0
commit
03fd19e0cf
5 changed files with 101 additions and 8 deletions
|
|
@ -1,6 +1,7 @@
|
|||
const anonymous = require('../../../constants').anonymousCustomer
|
||||
const customers = require('../../../customers')
|
||||
const filters = require('../../filters')
|
||||
const loyalty = require('../../../loyalty')
|
||||
|
||||
const resolvers = {
|
||||
Customer: {
|
||||
|
|
@ -9,7 +10,8 @@ const resolvers = {
|
|||
Query: {
|
||||
customers: (...[, { phone, name, address, id }]) => customers.getCustomersList(phone, name, address, id),
|
||||
customer: (...[, { customerId }]) => customers.getCustomerById(customerId),
|
||||
customerFilters: () => filters.customer()
|
||||
customerFilters: () => filters.customer(),
|
||||
getCustomersWithDiscounts: (...[, { discounts }]) => loyalty.getCustomersWithDiscounts(discounts)
|
||||
},
|
||||
Mutation: {
|
||||
setCustomer: (root, { customerId, customerInput }, context, info) => {
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ const typeDef = gql`
|
|||
customers(phone: String, name: String, address: String, id: String): [Customer] @auth
|
||||
customer(customerId: ID!): Customer @auth
|
||||
customerFilters: [Filter] @auth
|
||||
getCustomersWithDiscounts(discounts: [IndividualDiscountInput]): [Customer] @auth
|
||||
}
|
||||
|
||||
type Mutation {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,13 @@ const typeDef = gql`
|
|||
discount: Int
|
||||
}
|
||||
|
||||
input IndividualDiscountInput {
|
||||
id: ID
|
||||
idType: DiscountIdentificationType
|
||||
value: String
|
||||
discount: Int
|
||||
}
|
||||
|
||||
enum DiscountIdentificationType {
|
||||
phone
|
||||
idNumber
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue