feat: use customer Autocomplete on discount creation
This commit is contained in:
parent
43ff04b2af
commit
847b87ecb0
8 changed files with 94 additions and 189 deletions
|
|
@ -8,7 +8,7 @@ const resolvers = {
|
|||
Mutation: {
|
||||
createPromoCode: (...[, { code, discount }]) => loyalty.createPromoCode(code, discount),
|
||||
deletePromoCode: (...[, { codeId }]) => loyalty.deletePromoCode(codeId),
|
||||
createIndividualDiscount: (...[, { idType, value, discount }]) => loyalty.createIndividualDiscount(idType, value, discount),
|
||||
createIndividualDiscount: (...[, { customerId, discount }]) => loyalty.createIndividualDiscount(customerId, discount),
|
||||
deleteIndividualDiscount: (...[, { discountId }]) => loyalty.deleteIndividualDiscount(discountId)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,23 +3,10 @@ const { gql } = require('apollo-server-express')
|
|||
const typeDef = gql`
|
||||
type IndividualDiscount {
|
||||
id: ID!
|
||||
idType: DiscountIdentificationType
|
||||
value: String!
|
||||
customerId: ID!
|
||||
discount: Int
|
||||
}
|
||||
|
||||
input IndividualDiscountInput {
|
||||
id: ID
|
||||
idType: DiscountIdentificationType
|
||||
value: String
|
||||
discount: Int
|
||||
}
|
||||
|
||||
enum DiscountIdentificationType {
|
||||
phone
|
||||
idNumber
|
||||
}
|
||||
|
||||
type PromoCode {
|
||||
id: ID!
|
||||
code: String!
|
||||
|
|
@ -34,7 +21,7 @@ const typeDef = gql`
|
|||
type Mutation {
|
||||
createPromoCode(code: String!, discount: Int!): PromoCode @auth
|
||||
deletePromoCode(codeId: ID!): PromoCode @auth
|
||||
createIndividualDiscount(idType: DiscountIdentificationType!, value: String!, discount: Int!): IndividualDiscount @auth
|
||||
createIndividualDiscount(customerId: ID!, discount: Int!): IndividualDiscount @auth
|
||||
deleteIndividualDiscount(discountId: ID!): IndividualDiscount @auth
|
||||
}
|
||||
`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue