Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.17 KB | None | 0 0
  1. import {
  2. GraphQLObjectType,
  3. GraphQLString,
  4. GraphQLInt,
  5. GraphQLList,
  6. GraphQLBoolean,
  7. } from 'graphql';
  8.  
  9. const promoAdjustmentListPaymentType = new GraphQLObjectType({
  10. name: 'promoAdjustmentListPaymentType',
  11. fields: {
  12. paymentId: {type: GraphQLString},
  13. binNumbers: {type: new GraphQLList(GraphQLString)}
  14. }
  15. });
  16.  
  17. const promoAdjustmentCodeCompanyCost = new GraphQLObjectType({
  18. name: 'promoAdjustmentCodeCompanyCost',
  19. fields: {
  20. value: {type: GraphQLInt},
  21. percent: {type: GraphQLInt},
  22. maxValue: {type: GraphQLInt},
  23. name: {type: GraphQLInt},
  24. }
  25. });
  26.  
  27. const promoAdjustmentCodePatnerCost = new GraphQLObjectType({
  28. name: 'promoAdjustmentCodePatnerCost',
  29. fields: {
  30. value: {type: GraphQLInt},
  31. percent: {type: GraphQLInt},
  32. maxValue: {type: GraphQLInt},
  33. name: {type: GraphQLInt},
  34. }
  35. });
  36.  
  37. const promoAdjustmentListCodeCostType = new GraphQLObjectType({
  38. name: 'promoAdjustmentListCodeCostType',
  39. fields: {
  40. patnerCost: {type: new GraphQLList(promoAdjustmentCodePatnerCost)},
  41. companyCost: {type: new GraphQLList(promoAdjustmentCodeCompanyCost)}
  42. }
  43. });
  44.  
  45. const promoAdjustmentCodeDiscount = new GraphQLObjectType({
  46. name: 'promoAdjustmentCodeDiscount',
  47. fields: {
  48. value: {type: GraphQLInt},
  49. percent: {type: GraphQLInt},
  50. maxPrice: {type: GraphQLInt},
  51. minPrice: {type: GraphQLInt},
  52. }
  53. });
  54.  
  55. const promoAdjustmentListPriceRangesType = new GraphQLObjectType({
  56. name: 'promoAdjustmentListPriceRangesType',
  57. fields: {
  58. minPrice: {type: GraphQLInt},
  59. maxPrice: {type: GraphQLInt},
  60. promoCodeDiscount: {type: GraphQLList(promoAdjustmentCodeDiscount)}
  61. }
  62. });
  63.  
  64. const promoAdjustmentCodeRuleValue = new GraphQLObjectType({
  65. name: 'promoAdjustmentCodeRuleValue',
  66. fields: {
  67. operator: {type: GraphQLString},
  68. value: {type: GraphQLString}
  69. }
  70. });
  71.  
  72. const promoAdjustmentCompanyCost = new GraphQLObjectType({
  73. name: 'promoAdjustmentCompanyCost',
  74. fields: {
  75. value: {type: GraphQLString},
  76. percent: {type: GraphQLInt},
  77. maxValue: {type: GraphQLInt},
  78. name: {type: GraphQLString}
  79. }
  80. });
  81.  
  82. const promoAdjustmentCodeRules = new GraphQLObjectType({
  83. name: 'promoAdjustmentCodeRules',
  84. fields: {
  85. param: {type: GraphQLString},
  86. promoCodeRuleValue: {type: new GraphQLList(promoAdjustmentCodeRuleValue)},
  87. usedForCalculate: {type: GraphQLBoolean},
  88. productType: {type: GraphQLString}
  89. }
  90. });
  91.  
  92. const promoAdjustmentPatnerCost = new GraphQLObjectType({
  93. name: 'promoAdjustmentPatnerCost',
  94. fields: {
  95. value: {type: GraphQLString},
  96. percent: {type: GraphQLInt},
  97. maxValue: {type: GraphQLInt},
  98. name: {type: GraphQLString}
  99. }
  100. });
  101.  
  102. const promoAdjustmentGroupCost = new GraphQLObjectType({
  103. name: 'promoAdjustmentListGroupCost',
  104. fields: {
  105. patnerCost: {type: new GraphQLList(promoAdjustmentPatnerCost)},
  106. companyCost: {type: new GraphQLList(promoAdjustmentCompanyCost)}
  107. }
  108. });
  109.  
  110. const promoAdjustmentListGroupRulesType = new GraphQLObjectType({
  111. name: 'promoAdjustmentListGroupRulesType',
  112. fields: {
  113. name: {type: GraphQLString},
  114. promoGroupRulesCost: {type: new GraphQLList(promoAdjustmentGroupCost)},
  115. promoCodePriceRanges: {type: new GraphQLList(GraphQLString)},
  116. promoCodeRules: {type: new GraphQLList(promoAdjustmentCodeRules)}
  117. }
  118. });
  119.  
  120. const promoAdjustmentListDistributionsType = new GraphQLObjectType({
  121. name: 'promoAdjustmentListDistributionsType',
  122. fields: {
  123. storeId: {type: GraphQLString},
  124. channelId: {type: new GraphQLList(GraphQLString)}
  125. }
  126. });
  127.  
  128. const promoAdjustmentListUsageType = new GraphQLObjectType({
  129. name: 'promoAdjustmentListUsageType',
  130. fields: {
  131. usageCount: {type: GraphQLInt},
  132. usagePeriod: {type: GraphQLString},
  133. usageAmount: {type: GraphQLInt},
  134. amountPeriod: {type: GraphQLString},
  135. validatedBy: {type: GraphQLString}
  136. }
  137. });
  138.  
  139. const promoAdjustmentListContentType = new GraphQLObjectType({
  140. name: 'promoAdjustmentListContentType',
  141. fields: {
  142. id: {type: GraphQLString},
  143. promoCodeType: {type: GraphQLString},
  144. code: {type: GraphQLString},
  145. name: {type: GraphQLString},
  146. description: {type: GraphQLString},
  147. usageRules: {type: new GraphQLList(promoAdjustmentListUsageType)},
  148. promoCodeDistributions: {type: new GraphQLList(promoAdjustmentListDistributionsType)},
  149. maxDiscount: {type: GraphQLInt},
  150. promoCodeGroupRules: {type: new GraphQLList(promoAdjustmentListGroupRulesType)},
  151. promoCodeAdjustmentStatus: {type: GraphQLString},
  152. calculateType: {type: GraphQLString},
  153. promoCodePriceRanges: {type: new GraphQLList(promoAdjustmentListPriceRangesType)},
  154. promoCodeCost: {type: new GraphQLList(promoAdjustmentListCodeCostType)},
  155. paymentMethods: {type: new GraphQLList(promoAdjustmentListPaymentType)},
  156. promoCodeCombine: {type: GraphQLBoolean},
  157. validAllOrderDetails: {type: GraphQLBoolean}
  158. }
  159. });
  160.  
  161. const promoAdjustmentListDataType = new GraphQLObjectType({
  162. name: 'promoAdjustmentListDataType',
  163. fields: {
  164. content: {type: new GraphQLList(promoAdjustmentListContentType)}
  165. }
  166. });
  167.  
  168. const promoAdjustmentListType = new GraphQLObjectType({
  169. name: 'promoAdjustmentListType',
  170. fields: {
  171. code: {type: GraphQLString},
  172. message: {type: GraphQLString},
  173. data: {type: promoAdjustmentListDataType}
  174. }
  175. });
  176.  
  177. export default promoAdjustmentListType;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement