@medusajs/medusa 1.1.65-tax-api.48 → 1.2.2-dev.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/dist/api/index.d.ts +1 -0
  3. package/dist/api/index.js +1 -0
  4. package/dist/api/index.js.map +1 -1
  5. package/dist/api/middlewares/error-handler.js +6 -0
  6. package/dist/api/middlewares/error-handler.js.map +1 -1
  7. package/dist/api/routes/admin/customer-groups/add-customers-batch.d.ts +27 -0
  8. package/dist/api/routes/admin/customer-groups/add-customers-batch.js +106 -0
  9. package/dist/api/routes/admin/customer-groups/add-customers-batch.js.map +1 -0
  10. package/dist/api/routes/admin/customer-groups/create-customer-group.d.ts +2 -2
  11. package/dist/api/routes/admin/customer-groups/create-customer-group.js +3 -3
  12. package/dist/api/routes/admin/customer-groups/create-customer-group.js.map +1 -1
  13. package/dist/api/routes/admin/customer-groups/delete-customer-group.d.ts +28 -0
  14. package/dist/api/routes/admin/customer-groups/delete-customer-group.js +84 -0
  15. package/dist/api/routes/admin/customer-groups/delete-customer-group.js.map +1 -0
  16. package/dist/api/routes/admin/customer-groups/delete-customers-batch.d.ts +27 -0
  17. package/dist/api/routes/admin/customer-groups/delete-customers-batch.js +106 -0
  18. package/dist/api/routes/admin/customer-groups/delete-customers-batch.js.map +1 -0
  19. package/dist/api/routes/admin/customer-groups/get-customer-group.d.ts +25 -0
  20. package/dist/api/routes/admin/customer-groups/get-customer-group.js +113 -0
  21. package/dist/api/routes/admin/customer-groups/get-customer-group.js.map +1 -0
  22. package/dist/api/routes/admin/customer-groups/index.d.ts +6 -0
  23. package/dist/api/routes/admin/customer-groups/index.js +13 -0
  24. package/dist/api/routes/admin/customer-groups/index.js.map +1 -1
  25. package/dist/api/routes/admin/customer-groups/list-customer-groups.d.ts +38 -0
  26. package/dist/api/routes/admin/customer-groups/list-customer-groups.js +200 -0
  27. package/dist/api/routes/admin/customer-groups/list-customer-groups.js.map +1 -0
  28. package/dist/api/routes/admin/customer-groups/update-customer-group.d.ts +28 -0
  29. package/dist/api/routes/admin/customer-groups/update-customer-group.js +124 -0
  30. package/dist/api/routes/admin/customer-groups/update-customer-group.js.map +1 -0
  31. package/dist/api/routes/admin/customers/list-customers.js +11 -46
  32. package/dist/api/routes/admin/customers/list-customers.js.map +1 -1
  33. package/dist/api/routes/admin/customers/update-customer.d.ts +14 -0
  34. package/dist/api/routes/admin/customers/update-customer.js +49 -10
  35. package/dist/api/routes/admin/customers/update-customer.js.map +1 -1
  36. package/dist/api/routes/admin/discounts/update-discount.d.ts +2 -2
  37. package/dist/api/routes/admin/discounts/update-discount.js +3 -3
  38. package/dist/api/routes/admin/discounts/update-discount.js.map +1 -1
  39. package/dist/api/routes/admin/orders/receive-swap.d.ts +46 -0
  40. package/dist/api/routes/admin/orders/receive-swap.js +159 -0
  41. package/dist/api/routes/admin/orders/receive-swap.js.map +1 -0
  42. package/dist/api/routes/admin/tax-rates/add-to-product-types.js +3 -58
  43. package/dist/api/routes/admin/tax-rates/add-to-product-types.js.map +1 -1
  44. package/dist/api/routes/admin/tax-rates/add-to-products.js +3 -54
  45. package/dist/api/routes/admin/tax-rates/add-to-products.js.map +1 -1
  46. package/dist/api/routes/admin/tax-rates/add-to-shipping-options.js +3 -58
  47. package/dist/api/routes/admin/tax-rates/add-to-shipping-options.js.map +1 -1
  48. package/dist/api/routes/admin/tax-rates/create-tax-rate.js +14 -113
  49. package/dist/api/routes/admin/tax-rates/create-tax-rate.js.map +1 -1
  50. package/dist/api/routes/store/auth/exists.js +4 -2
  51. package/dist/api/routes/store/auth/exists.js.map +1 -1
  52. package/dist/controllers/customers/index.d.ts +4 -0
  53. package/dist/controllers/customers/index.js +8 -0
  54. package/dist/controllers/customers/index.js.map +1 -0
  55. package/dist/controllers/customers/list-customers.d.ts +3 -0
  56. package/dist/controllers/customers/list-customers.js +96 -0
  57. package/dist/controllers/customers/list-customers.js.map +1 -0
  58. package/dist/controllers/list-customers.d.ts +0 -0
  59. package/dist/controllers/list-customers.js +1 -0
  60. package/dist/controllers/list-customers.js.map +1 -0
  61. package/dist/migrations/1644943746861-customer_groups.js +2 -2
  62. package/dist/migrations/1644943746861-customer_groups.js.map +1 -1
  63. package/dist/models/customer-group.js +3 -1
  64. package/dist/models/customer-group.js.map +1 -1
  65. package/dist/models/customer.js +14 -1
  66. package/dist/models/customer.js.map +1 -1
  67. package/dist/repositories/customer-group.d.ts +3 -1
  68. package/dist/repositories/customer-group.js +77 -0
  69. package/dist/repositories/customer-group.js.map +1 -1
  70. package/dist/repositories/money-amount.d.ts +6 -0
  71. package/dist/repositories/money-amount.js +97 -0
  72. package/dist/repositories/money-amount.js.map +1 -1
  73. package/dist/services/customer-group.d.ts +57 -1
  74. package/dist/services/customer-group.js +246 -1
  75. package/dist/services/customer-group.js.map +1 -1
  76. package/dist/services/customer.js +12 -3
  77. package/dist/services/customer.js.map +1 -1
  78. package/dist/services/discount.js +17 -9
  79. package/dist/services/discount.js.map +1 -1
  80. package/dist/services/invite.d.ts +3 -3
  81. package/dist/services/invite.js +4 -2
  82. package/dist/services/invite.js.map +1 -1
  83. package/dist/services/product-collection.js +29 -8
  84. package/dist/services/product-collection.js.map +1 -1
  85. package/dist/services/product-variant.d.ts +1 -0
  86. package/dist/services/product-variant.js +96 -85
  87. package/dist/services/product-variant.js.map +1 -1
  88. package/dist/services/product.js +35 -25
  89. package/dist/services/product.js.map +1 -1
  90. package/dist/services/region.js +1 -0
  91. package/dist/services/region.js.map +1 -1
  92. package/dist/services/swap.js +2 -1
  93. package/dist/services/swap.js.map +1 -1
  94. package/dist/services/tax-rate.js +164 -156
  95. package/dist/services/tax-rate.js.map +1 -1
  96. package/dist/types/customer-groups.d.ts +15 -0
  97. package/dist/types/customer-groups.js +68 -0
  98. package/dist/types/customer-groups.js.map +1 -0
  99. package/dist/utils/exception-formatter.d.ts +5 -0
  100. package/dist/utils/exception-formatter.js +29 -0
  101. package/dist/utils/exception-formatter.js.map +1 -0
  102. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"list-customers.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/customers/list-customers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAwC;AACxC,mDAAgE;AAIhE,yDAAuE;AACvE,yDAAuD;AACvD;;;;;;;;;;;;;;;;;GAiBG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;oBACV,qBAAM,IAAA,qBAAS,EAAC,uBAAuB,EAAE,GAAG,CAAC,KAAK,CAAC,EAAA;;gBAA/D,SAAS,GAAG,SAAmD;gBAE/D,eAAe,GAAoB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;gBAEvE,QAAQ,GAA8B,EAAE,CAAA;gBAE9C,IAAI,SAAS,CAAC,CAAC,EAAE;oBACf,QAAQ,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAA;iBACzB;gBAEG,YAAY,GAAa,EAAE,CAAA;gBAC/B,IAAI,SAAS,CAAC,MAAM,EAAE;oBACpB,YAAY,GAAG,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;iBAC3C;gBAEK,UAAU,GAAyB;oBACvC,SAAS,EAAE,YAAY;oBACvB,IAAI,EAAE,SAAS,CAAC,MAAM;oBACtB,IAAI,EAAE,SAAS,CAAC,KAAK;iBACtB,CAAA;gBAE0B,qBAAM,eAAe,CAAC,YAAY,CAC3D,QAAQ,EACR,UAAU,CACX,EAAA;;gBAHK,KAAA,sBAAqB,SAG1B,KAAA,EAHM,SAAS,QAAA,EAAE,KAAK,QAAA;gBAKvB,GAAG,CAAC,IAAI,CAAC;oBACP,SAAS,WAAA;oBACT,KAAK,OAAA;oBACL,MAAM,EAAE,SAAS,CAAC,MAAM;oBACxB,KAAK,EAAE,SAAS,CAAC,KAAK;iBACvB,CAAC,CAAA;;;;KACH,EAAA;AAED;IAA6C,2CAAyB;IAAtE;QAAA,qEAcC;QAVC,WAAK,GAAG,EAAE,CAAA;QAKV,YAAM,GAAG,CAAC,CAAA;;IAKZ,CAAC;IAVC;QAHC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;QACZ,IAAA,wBAAI,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC;;0DACT;IAKV;QAHC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;QACZ,IAAA,wBAAI,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC;;2DACT;IAIV;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;2DACE;IACjB,8BAAC;CAAA,AAdD,CAA6C,qCAAyB,GAcrE;AAdY,0DAAuB"}
1
+ {"version":3,"file":"list-customers.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/customers/list-customers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAwC;AACxC,mDAAgE;AAChE,gFAAkE;AAClE,yDAAuE;AACvE;;;;;;;;;;;;;;;;;GAiBG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;oBACb,qBAAM,mBAAkB,CAAC,YAAY,CAClD,GAAG,CAAC,KAAK,EACT,GAAG,CAAC,KAAK,EACT,GAAG,CAAC,IAAI,CACT,EAAA;;gBAJK,MAAM,GAAG,SAId;gBAED,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;;;;KACjB,EAAA;AAED;IAA6C,2CAAyB;IAAtE;QAAA,qEAcC;QAVC,WAAK,GAAG,EAAE,CAAA;QAKV,YAAM,GAAG,CAAC,CAAA;;IAKZ,CAAC;IAVC;QAHC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;QACZ,IAAA,wBAAI,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC;;0DACT;IAKV;QAHC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;QACZ,IAAA,wBAAI,EAAC,cAAM,OAAA,MAAM,EAAN,CAAM,CAAC;;2DACT;IAIV;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;2DACE;IACjB,8BAAC;CAAA,AAdD,CAA6C,qCAAyB,GAcrE;AAdY,0DAAuB"}
@@ -27,6 +27,16 @@ declare const _default: (req: any, res: any) => Promise<void>;
27
27
  * password:
28
28
  * type: string
29
29
  * description: The Customer's password.
30
+ * groups:
31
+ * type: array
32
+ * description: A list of customer groups to which the customer belongs.
33
+ * items:
34
+ * required:
35
+ * - id
36
+ * properties:
37
+ * id:
38
+ * description: The id of a customer group
39
+ * type: string
30
40
  * metadata:
31
41
  * type: object
32
42
  * description: Metadata for the customer.
@@ -43,6 +53,9 @@ declare const _default: (req: any, res: any) => Promise<void>;
43
53
  * $ref: "#/components/schemas/customer"
44
54
  */
45
55
  export default _default;
56
+ declare class Group {
57
+ id: string;
58
+ }
46
59
  export declare class AdminPostCustomersCustomerReq {
47
60
  email?: string;
48
61
  first_name?: string;
@@ -50,4 +63,5 @@ export declare class AdminPostCustomersCustomerReq {
50
63
  password?: string;
51
64
  phone?: string;
52
65
  metadata?: object;
66
+ groups?: Group[];
53
67
  }
@@ -49,6 +49,9 @@ exports.AdminPostCustomersCustomerReq = void 0;
49
49
  var class_validator_1 = require("class-validator");
50
50
  var medusa_core_utils_1 = require("medusa-core-utils");
51
51
  var validator_1 = require("../../../../utils/validator");
52
+ var _1 = require(".");
53
+ var class_transformer_1 = require("class-transformer");
54
+ var common_1 = require("../../../../types/common");
52
55
  /**
53
56
  * @oas [post] /customers/{id}
54
57
  * operationId: "PostCustomersCustomer"
@@ -77,6 +80,16 @@ var validator_1 = require("../../../../utils/validator");
77
80
  * password:
78
81
  * type: string
79
82
  * description: The Customer's password.
83
+ * groups:
84
+ * type: array
85
+ * description: A list of customer groups to which the customer belongs.
86
+ * items:
87
+ * required:
88
+ * - id
89
+ * properties:
90
+ * id:
91
+ * description: The id of a customer group
92
+ * type: string
80
93
  * metadata:
81
94
  * type: object
82
95
  * description: Metadata for the customer.
@@ -93,34 +106,53 @@ var validator_1 = require("../../../../utils/validator");
93
106
  * $ref: "#/components/schemas/customer"
94
107
  */
95
108
  exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
96
- var id, validated, customerService, customer;
109
+ var id, validatedBody, validatedQuery, customerService, customer, expandFields, findConfig;
97
110
  return __generator(this, function (_a) {
98
111
  switch (_a.label) {
99
112
  case 0:
100
113
  id = req.params.id;
101
114
  return [4 /*yield*/, (0, validator_1.validator)(AdminPostCustomersCustomerReq, req.body)];
102
115
  case 1:
103
- validated = _a.sent();
116
+ validatedBody = _a.sent();
117
+ return [4 /*yield*/, (0, validator_1.validator)(common_1.FindParams, req.query)];
118
+ case 2:
119
+ validatedQuery = _a.sent();
104
120
  customerService = req.scope.resolve("customerService");
105
121
  return [4 /*yield*/, customerService.retrieve(id)];
106
- case 2:
122
+ case 3:
107
123
  customer = _a.sent();
108
- if (validated.email && customer.has_account) {
124
+ if (validatedBody.email && customer.has_account) {
109
125
  throw new medusa_core_utils_1.MedusaError(medusa_core_utils_1.MedusaError.Types.INVALID_DATA, "Email cannot be changed when the user has registered their account");
110
126
  }
111
- return [4 /*yield*/, customerService.update(id, validated)];
112
- case 3:
113
- _a.sent();
114
- return [4 /*yield*/, customerService.retrieve(id, {
115
- relations: ["orders"],
116
- })];
127
+ return [4 /*yield*/, customerService.update(id, validatedBody)];
117
128
  case 4:
129
+ _a.sent();
130
+ expandFields = [];
131
+ if (validatedQuery.expand) {
132
+ expandFields = validatedQuery.expand.split(",");
133
+ }
134
+ findConfig = {
135
+ relations: expandFields.length
136
+ ? expandFields
137
+ : _1.defaultAdminCustomersRelations,
138
+ };
139
+ return [4 /*yield*/, customerService.retrieve(id, findConfig)];
140
+ case 5:
118
141
  customer = _a.sent();
119
142
  res.status(200).json({ customer: customer });
120
143
  return [2 /*return*/];
121
144
  }
122
145
  });
123
146
  }); });
147
+ var Group = /** @class */ (function () {
148
+ function Group() {
149
+ }
150
+ __decorate([
151
+ (0, class_validator_1.IsString)(),
152
+ __metadata("design:type", String)
153
+ ], Group.prototype, "id", void 0);
154
+ return Group;
155
+ }());
124
156
  var AdminPostCustomersCustomerReq = /** @class */ (function () {
125
157
  function AdminPostCustomersCustomerReq() {
126
158
  }
@@ -154,6 +186,13 @@ var AdminPostCustomersCustomerReq = /** @class */ (function () {
154
186
  (0, class_validator_1.IsOptional)(),
155
187
  __metadata("design:type", Object)
156
188
  ], AdminPostCustomersCustomerReq.prototype, "metadata", void 0);
189
+ __decorate([
190
+ (0, class_validator_1.IsArray)(),
191
+ (0, class_validator_1.IsOptional)(),
192
+ (0, class_transformer_1.Type)(function () { return Group; }),
193
+ (0, class_validator_1.ValidateNested)({ each: true }),
194
+ __metadata("design:type", Array)
195
+ ], AdminPostCustomersCustomerReq.prototype, "groups", void 0);
157
196
  return AdminPostCustomersCustomerReq;
158
197
  }());
159
198
  exports.AdminPostCustomersCustomerReq = AdminPostCustomersCustomerReq;
@@ -1 +1 @@
1
- {"version":3,"file":"update-customer.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/customers/update-customer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAyE;AACzE,uDAA+C;AAE/C,yDAAuD;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEP,qBAAM,IAAA,qBAAS,EAAC,6BAA6B,EAAE,GAAG,CAAC,IAAI,CAAC,EAAA;;gBAApE,SAAS,GAAG,SAAwD;gBAEpE,eAAe,GAAoB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;gBAE9D,qBAAM,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAA;;gBAA7C,QAAQ,GAAG,SAAkC;gBAEjD,IAAI,SAAS,CAAC,KAAK,IAAI,QAAQ,CAAC,WAAW,EAAE;oBAC3C,MAAM,IAAI,+BAAW,CACnB,+BAAW,CAAC,KAAK,CAAC,YAAY,EAC9B,oEAAoE,CACrE,CAAA;iBACF;gBAED,qBAAM,eAAe,CAAC,MAAM,CAAC,EAAE,EAAE,SAAS,CAAC,EAAA;;gBAA3C,SAA2C,CAAA;gBAEhC,qBAAM,eAAe,CAAC,QAAQ,CAAC,EAAE,EAAE;wBAC5C,SAAS,EAAE,CAAC,QAAQ,CAAC;qBACtB,CAAC,EAAA;;gBAFF,QAAQ,GAAG,SAET,CAAA;gBACF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,QAAQ,UAAA,EAAE,CAAC,CAAA;;;;KACnC,EAAA;AAED;IAAA;IAwBA,CAAC;IArBC;QAFC,IAAA,yBAAO,GAAE;QACT,IAAA,4BAAU,GAAE;;gEACC;IAId;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;qEACM;IAInB;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;oEACK;IAIlB;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;mEACI;IAIjB;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;gEACC;IAId;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;mEACI;IACnB,oCAAC;CAAA,AAxBD,IAwBC;AAxBY,sEAA6B"}
1
+ {"version":3,"file":"update-customer.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/customers/update-customer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;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,CAAC,EAAE,EAAE,UAAU,CAAC,EAAA;;gBAAzD,QAAQ,GAAG,SAA8C,CAAA;gBAEzD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,QAAQ,UAAA,EAAE,CAAC,CAAA;;;;KACnC,EAAA;AAED;IAAA;IAGA,CAAC;IADC;QADC,IAAA,0BAAQ,GAAE;;qCACD;IACZ,YAAC;CAAA,AAHD,IAGC;AAED;IAAA;IA8BA,CAAC;IA3BC;QAFC,IAAA,yBAAO,GAAE;QACT,IAAA,4BAAU,GAAE;;gEACC;IAId;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;qEACM;IAInB;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;oEACK;IAIlB;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;mEACI;IAIjB;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;gEACC;IAId;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;mEACI;IAMjB;QAJC,IAAA,yBAAO,GAAE;QACT,IAAA,4BAAU,GAAE;QACZ,IAAA,wBAAI,EAAC,cAAM,OAAA,KAAK,EAAL,CAAK,CAAC;QACjB,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;iEACf;IAClB,oCAAC;CAAA,AA9BD,IA8BC;AA9BY,sEAA6B"}
@@ -68,7 +68,7 @@ export declare class AdminUpdateDiscountRule {
68
68
  id: string;
69
69
  description?: string;
70
70
  type: string;
71
- value: string;
71
+ value: number;
72
72
  allocation: string;
73
- valid_for?: string;
73
+ valid_for?: string[];
74
74
  }
@@ -49,8 +49,8 @@ exports.AdminUpdateDiscountRule = exports.AdminPostDiscountsDiscountReq = void 0
49
49
  var class_transformer_1 = require("class-transformer");
50
50
  var class_validator_1 = require("class-validator");
51
51
  var _1 = require(".");
52
- var greater_than_1 = require("../../../../utils/validators/greater-than");
53
52
  var validator_1 = require("../../../../utils/validator");
53
+ var greater_than_1 = require("../../../../utils/validators/greater-than");
54
54
  var iso8601_duration_1 = require("../../../../utils/validators/iso8601-duration");
55
55
  /**
56
56
  * @oas [post] /discounts/{id}
@@ -210,7 +210,7 @@ var AdminUpdateDiscountRule = /** @class */ (function () {
210
210
  ], AdminUpdateDiscountRule.prototype, "type", void 0);
211
211
  __decorate([
212
212
  (0, class_validator_1.IsNumber)(),
213
- __metadata("design:type", String)
213
+ __metadata("design:type", Number)
214
214
  ], AdminUpdateDiscountRule.prototype, "value", void 0);
215
215
  __decorate([
216
216
  (0, class_validator_1.IsString)(),
@@ -221,7 +221,7 @@ var AdminUpdateDiscountRule = /** @class */ (function () {
221
221
  (0, class_validator_1.IsArray)(),
222
222
  (0, class_validator_1.IsOptional)(),
223
223
  (0, class_validator_1.IsString)({ each: true }),
224
- __metadata("design:type", String)
224
+ __metadata("design:type", Array)
225
225
  ], AdminUpdateDiscountRule.prototype, "valid_for", void 0);
226
226
  return AdminUpdateDiscountRule;
227
227
  }());
@@ -1 +1 @@
1
- {"version":3,"file":"update-discount.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/discounts/update-discount.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAwC;AACxC,mDAWwB;AACxB,sBAA+E;AAE/E,0EAAyE;AACzE,yDAAuD;AACvD,kFAAiF;AAEjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,WAAW,GAAK,GAAG,CAAC,MAAM,YAAf,CAAe;gBAEhB,qBAAM,IAAA,qBAAS,EAAC,6BAA6B,EAAE,GAAG,CAAC,IAAI,CAAC,EAAA;;gBAApE,SAAS,GAAG,SAAwD;gBACpE,eAAe,GAAoB,GAAG,CAAC,KA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sEACO;IAKpB;QAHC,IAAA,yBAAO,GAAE;QACT,IAAA,4BAAU,GAAE;QACZ,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;kEACP;IAIlB;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;mEACI;IACnB,oCAAC;CAAA,AA9CD,IA8CC;AA9CY,sEAA6B;AAgD1C;IAAA;IAwBA,CAAC;IArBC;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;uDACH;IAIV;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;gEACO;IAIpB;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;yDACD;IAGZ;QADC,IAAA,0BAAQ,GAAE;;0DACE;IAIb;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;+DACK;IAKlB;QAHC,IAAA,yBAAO,GAAE;QACT,IAAA,4BAAU,GAAE;QACZ,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;8DACP;IACpB,8BAAC;CAAA,AAxBD,IAwBC;AAxBY,0DAAuB"}
1
+ {"version":3,"file":"update-discount.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/discounts/update-discount.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAwC;AACxC,mDAWwB;AACxB,sBAA+E;AAE/E,yDAAuD;AACvD,0EAAyE;AACzE,kFAAiF;AAEjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,WAAW,GAAK,GAAG,CAAC,MAAM,YAAf,CAAe;gBAEhB,qBAAM,IAAA,qBAAS,EAAC,6BAA6B,EAAE,GAAG,CAAC,IAAI,CAAC,EAAA;;gBAApE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AAE;QACV,IAAA,4BAAU,GAAE;QACZ,IAAA,4BAAU,GAAE;;sEACO;IAKpB;QAHC,IAAA,yBAAO,GAAE;QACT,IAAA,4BAAU,GAAE;QACZ,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;kEACP;IAIlB;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;mEACI;IACnB,oCAAC;CAAA,AA9CD,IA8CC;AA9CY,sEAA6B;AAgD1C;IAAA;IAwBA,CAAC;IArBC;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;uDACH;IAIV;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;gEACO;IAIpB;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;yDACD;IAGZ;QADC,IAAA,0BAAQ,GAAE;;0DACE;IAIb;QAFC,IAAA,0BAAQ,GAAE;QACV,IAAA,4BAAU,GAAE;;+DACK;IAKlB;QAHC,IAAA,yBAAO,GAAE;QACT,IAAA,4BAAU,GAAE;QACZ,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;8DACL;IACtB,8BAAC;CAAA,AAxBD,IAwBC;AAxBY,0DAAuB"}
@@ -0,0 +1,46 @@
1
+ declare const _default: (req: any, res: any) => Promise<void>;
2
+ /**
3
+ * @oas [post] /orders/{id}/swaps/{swap_id}/receive
4
+ * operationId: "PostOrdersOrderSwapsSwapReceive"
5
+ * summary: "Receive a Swap"
6
+ * description: "Registers a Swap as received."
7
+ * x-authenticated: true
8
+ * parameters:
9
+ * - (path) id=* {string} The id of the Order.
10
+ * - (path) swap_id=* {string} The id of the Swap.
11
+ * requestBody:
12
+ * content:
13
+ * application/json:
14
+ * schema:
15
+ * properties:
16
+ * items:
17
+ * description: The Line Items that have been received.
18
+ * type: array
19
+ * items:
20
+ * properties:
21
+ * item_id:
22
+ * description: The id of the Line Item.
23
+ * type: string
24
+ * quantity:
25
+ * description: The quantity of the Line Item.
26
+ * type: integer
27
+ * tags:
28
+ * - Order
29
+ * responses:
30
+ * 200:
31
+ * description: OK
32
+ * content:
33
+ * application/json:
34
+ * schema:
35
+ * properties:
36
+ * order:
37
+ * $ref: "#/components/schemas/order"
38
+ */
39
+ export default _default;
40
+ export declare class AdminPostOrdersOrderSwapsSwapReceiveReq {
41
+ items: Item[];
42
+ }
43
+ declare class Item {
44
+ item_id: string;
45
+ quantity: number;
46
+ }
@@ -0,0 +1,159 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
+ return new (P || (P = Promise))(function (resolve, reject) {
14
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
18
+ });
19
+ };
20
+ var __generator = (this && this.__generator) || function (thisArg, body) {
21
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
22
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ function verb(n) { return function (v) { return step([n, v]); }; }
24
+ function step(op) {
25
+ if (f) throw new TypeError("Generator is already executing.");
26
+ while (_) try {
27
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
28
+ if (y = 0, t) op = [op[0] & 2, t.value];
29
+ switch (op[0]) {
30
+ case 0: case 1: t = op; break;
31
+ case 4: _.label++; return { value: op[1], done: false };
32
+ case 5: _.label++; y = op[1]; op = [0]; continue;
33
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
34
+ default:
35
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
36
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
37
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
38
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
39
+ if (t[2]) _.ops.pop();
40
+ _.trys.pop(); continue;
41
+ }
42
+ op = body.call(thisArg, _);
43
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
44
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
45
+ }
46
+ };
47
+ Object.defineProperty(exports, "__esModule", { value: true });
48
+ exports.AdminPostOrdersOrderSwapsSwapReceiveReq = void 0;
49
+ var class_transformer_1 = require("class-transformer");
50
+ var class_validator_1 = require("class-validator");
51
+ var _1 = require(".");
52
+ var validator_1 = require("../../../../utils/validator");
53
+ /**
54
+ * @oas [post] /orders/{id}/swaps/{swap_id}/receive
55
+ * operationId: "PostOrdersOrderSwapsSwapReceive"
56
+ * summary: "Receive a Swap"
57
+ * description: "Registers a Swap as received."
58
+ * x-authenticated: true
59
+ * parameters:
60
+ * - (path) id=* {string} The id of the Order.
61
+ * - (path) swap_id=* {string} The id of the Swap.
62
+ * requestBody:
63
+ * content:
64
+ * application/json:
65
+ * schema:
66
+ * properties:
67
+ * items:
68
+ * description: The Line Items that have been received.
69
+ * type: array
70
+ * items:
71
+ * properties:
72
+ * item_id:
73
+ * description: The id of the Line Item.
74
+ * type: string
75
+ * quantity:
76
+ * description: The quantity of the Line Item.
77
+ * type: integer
78
+ * tags:
79
+ * - Order
80
+ * responses:
81
+ * 200:
82
+ * description: OK
83
+ * content:
84
+ * application/json:
85
+ * schema:
86
+ * properties:
87
+ * order:
88
+ * $ref: "#/components/schemas/order"
89
+ */
90
+ exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
91
+ var _a, id, swap_id, validated, orderService, swapService, entityManager, order;
92
+ return __generator(this, function (_b) {
93
+ switch (_b.label) {
94
+ case 0:
95
+ _a = req.params, id = _a.id, swap_id = _a.swap_id;
96
+ return [4 /*yield*/, (0, validator_1.validator)(AdminPostOrdersOrderSwapsSwapReceiveReq, req.body)];
97
+ case 1:
98
+ validated = _b.sent();
99
+ orderService = req.scope.resolve("orderService");
100
+ swapService = req.scope.resolve("swapService");
101
+ entityManager = req.scope.resolve("manager");
102
+ return [4 /*yield*/, entityManager.transaction(function (manager) { return __awaiter(void 0, void 0, void 0, function () {
103
+ return __generator(this, function (_a) {
104
+ switch (_a.label) {
105
+ case 0: return [4 /*yield*/, swapService
106
+ .withTransaction(manager)
107
+ .receiveReturn(swap_id, validated.items)];
108
+ case 1:
109
+ _a.sent();
110
+ return [4 /*yield*/, orderService
111
+ .withTransaction(manager)
112
+ .registerSwapReceived(id, swap_id)];
113
+ case 2:
114
+ _a.sent();
115
+ return [2 /*return*/];
116
+ }
117
+ });
118
+ }); })];
119
+ case 2:
120
+ _b.sent();
121
+ return [4 /*yield*/, orderService.retrieve(id, {
122
+ select: _1.defaultAdminOrdersFields,
123
+ relations: _1.defaultAdminOrdersRelations,
124
+ })];
125
+ case 3:
126
+ order = _b.sent();
127
+ res.status(200).json({ order: order });
128
+ return [2 /*return*/];
129
+ }
130
+ });
131
+ }); });
132
+ var AdminPostOrdersOrderSwapsSwapReceiveReq = /** @class */ (function () {
133
+ function AdminPostOrdersOrderSwapsSwapReceiveReq() {
134
+ }
135
+ __decorate([
136
+ (0, class_validator_1.IsArray)(),
137
+ (0, class_validator_1.ValidateNested)({ each: true }),
138
+ (0, class_transformer_1.Type)(function () { return Item; }),
139
+ __metadata("design:type", Array)
140
+ ], AdminPostOrdersOrderSwapsSwapReceiveReq.prototype, "items", void 0);
141
+ return AdminPostOrdersOrderSwapsSwapReceiveReq;
142
+ }());
143
+ exports.AdminPostOrdersOrderSwapsSwapReceiveReq = AdminPostOrdersOrderSwapsSwapReceiveReq;
144
+ var Item = /** @class */ (function () {
145
+ function Item() {
146
+ }
147
+ __decorate([
148
+ (0, class_validator_1.IsString)(),
149
+ (0, class_validator_1.IsNotEmpty)(),
150
+ __metadata("design:type", String)
151
+ ], Item.prototype, "item_id", void 0);
152
+ __decorate([
153
+ (0, class_validator_1.IsInt)(),
154
+ (0, class_validator_1.IsNotEmpty)(),
155
+ __metadata("design:type", Number)
156
+ ], Item.prototype, "quantity", void 0);
157
+ return Item;
158
+ }());
159
+ //# sourceMappingURL=receive-swap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receive-swap.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/orders/receive-swap.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAwC;AACxC,mDAMwB;AAExB,sBAAyE;AAEzE,yDAAuD;AACvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACtB,KAAkB,GAAG,CAAC,MAAM,EAA1B,EAAE,QAAA,EAAE,OAAO,aAAA,CAAe;gBAEhB,qBAAM,IAAA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A,4BAAU,GAAE;;yCACE;IAIf;QAFC,IAAA,uBAAK,GAAE;QACP,IAAA,4BAAU,GAAE;;0CACG;IAClB,WAAC;CAAA,AARD,IAQC"}
@@ -44,31 +44,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
44
44
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
45
45
  }
46
46
  };
47
- var __read = (this && this.__read) || function (o, n) {
48
- var m = typeof Symbol === "function" && o[Symbol.iterator];
49
- if (!m) return o;
50
- var i = m.call(o), r, ar = [], e;
51
- try {
52
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
53
- }
54
- catch (error) { e = { error: error }; }
55
- finally {
56
- try {
57
- if (r && !r.done && (m = i["return"])) m.call(i);
58
- }
59
- finally { if (e) throw e.error; }
60
- }
61
- return ar;
62
- };
63
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
64
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
65
- if (ar || !(i in from)) {
66
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
67
- ar[i] = from[i];
68
- }
69
- }
70
- return to.concat(ar || Array.prototype.slice.call(from));
71
- };
72
47
  Object.defineProperty(exports, "__esModule", { value: true });
73
48
  exports.AdminPostTaxRatesTaxRateProductTypesParams = exports.AdminPostTaxRatesTaxRateProductTypesReq = void 0;
74
49
  var get_query_config_1 = require("./utils/get-query-config");
@@ -95,7 +70,7 @@ var validator_1 = require("../../../../utils/validator");
95
70
  * $ref: "#/components/schemas/tax_rate"
96
71
  */
97
72
  exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
98
- var value, query, rateService, productTypeService, err_1, config, rate, data;
73
+ var value, query, rateService, config, rate, data;
99
74
  return __generator(this, function (_a) {
100
75
  switch (_a.label) {
101
76
  case 0: return [4 /*yield*/, (0, validator_1.validator)(AdminPostTaxRatesTaxRateProductTypesReq, req.body)];
@@ -105,42 +80,12 @@ exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0
105
80
  case 2:
106
81
  query = _a.sent();
107
82
  rateService = req.scope.resolve("taxRateService");
108
- productTypeService = req.scope.resolve("productTypeService");
109
- _a.label = 3;
110
- case 3:
111
- _a.trys.push([3, 5, , 8]);
112
83
  return [4 /*yield*/, rateService.addToProductType(req.params.id, value.product_types)];
113
- case 4:
114
- _a.sent();
115
- return [3 /*break*/, 8];
116
- case 5:
117
- err_1 = _a.sent();
118
- if (!(err_1.code === "23503")) return [3 /*break*/, 7];
119
- // A foreign key constraint failed meaning some thing doesn't exist
120
- // either it is a product type or the tax rate itself. Using Promise.all
121
- // will try to retrieve all of the resources and will fail when something
122
- // is not found.
123
- return [4 /*yield*/, Promise.all(__spreadArray([
124
- rateService.retrieve(req.params.id, {
125
- select: ["id"],
126
- })
127
- ], __read(value.product_types.map(function (id) {
128
- return productTypeService.retrieve(id, {
129
- select: ["id"],
130
- });
131
- })), false))];
132
- case 6:
133
- // A foreign key constraint failed meaning some thing doesn't exist
134
- // either it is a product type or the tax rate itself. Using Promise.all
135
- // will try to retrieve all of the resources and will fail when something
136
- // is not found.
84
+ case 3:
137
85
  _a.sent();
138
- _a.label = 7;
139
- case 7: throw err_1;
140
- case 8:
141
86
  config = (0, get_query_config_1.getRetrieveConfig)(query.fields, query.expand);
142
87
  return [4 /*yield*/, rateService.retrieve(req.params.id, config)];
143
- case 9:
88
+ case 4:
144
89
  rate = _a.sent();
145
90
  data = (0, get_query_config_1.pickByConfig)(rate, config);
146
91
  res.json({ tax_rate: data });
@@ -1 +1 @@
1
- {"version":3,"file":"add-to-product-types.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/tax-rates/add-to-product-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAA0E;AAC1E,mDAAqD;AAIrD,yDAAuD;AAEvD;;;;;;;;;;;;;;;;;;;GAm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M,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,EAAA;;gBAAxD,IAAI,GAAG,SAAiD;gBACxD,IAAI,GAAG,IAAA,+BAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAA;gBAEvC,GAAG,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;;;;KAC7B,EAAA;AAED;IAAA;IAGA,CAAC;IADC;QADC,IAAA,yBAAO,GAAE;;kFACa;IACzB,8CAAC;CAAA,AAHD,IAGC;AAHY,0FAAuC;AAKpD;IAAA;IAQA,CAAC;IALC;QAFC,IAAA,yBAAO,GAAE;QACT,IAAA,4BAAU,GAAE;;8EACI;IAIjB;QAFC,IAAA,yBAAO,GAAE;QACT,IAAA,4BAAU,GAAE;;8EACI;IACnB,iDAAC;CAAA,AARD,IAQC;AARY,gGAA0C"}
1
+ {"version":3,"file":"add-to-product-types.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/tax-rates/add-to-product-types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAA0E;AAC1E,mDAAqD;AAIrD,yDAAuD;AAEvD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;oBACd,qBAAM,IAAA,qBAAS,EAC3B,uCAAuC,EACvC,GAAG,CAAC,IAAI,CACT,EAAA;;gBAHK,KAAK,GAAG,SAGb;gBAEa,qBAAM,IAAA,qBAAS,EAC3B,0CAA0C,EAC1C,GAAG,CAAC,KAAK,CACV,EAAA;;gBAHK,KAAK,GAAG,SAGb;gBAEK,WAAW,GAAmB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;gBAEvE,qBAAM,WAAW,CAAC,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,aAAa,CAAC,EAAA;;gBAAtE,SAAsE,CAAA;gBAEhE,MAAM,GAAG,IAAA,oCAAiB,EAC9B,KAAK,CAAC,MAA2B,EACjC,KAAK,CAAC,MAAM,CACb,CAAA;gBACY,qBAAM,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,EAAA;;gBAAxD,IAAI,GAAG,SAAiD;gBACxD,IAAI,GAAG,IAAA,+BAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAA;gBAEvC,GAAG,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;;;;KAC7B,EAAA;AAED;IAAA;IAGA,CAAC;IADC;QADC,IAAA,yBAAO,GAAE;;kFACa;IACzB,8CAAC;CAAA,AAHD,IAGC;AAHY,0FAAuC;AAKpD;IAAA;IAQA,CAAC;IALC;QAFC,IAAA,yBAAO,GAAE;QACT,IAAA,4BAAU,GAAE;;8EACI;IAIjB;QAFC,IAAA,yBAAO,GAAE;QACT,IAAA,4BAAU,GAAE;;8EACI;IACnB,iDAAC;CAAA,AARD,IAQC;AARY,gGAA0C"}
@@ -44,31 +44,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
44
44
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
45
45
  }
46
46
  };
47
- var __read = (this && this.__read) || function (o, n) {
48
- var m = typeof Symbol === "function" && o[Symbol.iterator];
49
- if (!m) return o;
50
- var i = m.call(o), r, ar = [], e;
51
- try {
52
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
53
- }
54
- catch (error) { e = { error: error }; }
55
- finally {
56
- try {
57
- if (r && !r.done && (m = i["return"])) m.call(i);
58
- }
59
- finally { if (e) throw e.error; }
60
- }
61
- return ar;
62
- };
63
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
64
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
65
- if (ar || !(i in from)) {
66
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
67
- ar[i] = from[i];
68
- }
69
- }
70
- return to.concat(ar || Array.prototype.slice.call(from));
71
- };
72
47
  Object.defineProperty(exports, "__esModule", { value: true });
73
48
  exports.AdminPostTaxRatesTaxRateProductsParams = exports.AdminPostTaxRatesTaxRateProductsReq = void 0;
74
49
  var get_query_config_1 = require("./utils/get-query-config");
@@ -95,7 +70,7 @@ var validator_1 = require("../../../../utils/validator");
95
70
  * $ref: "#/components/schemas/tax_rate"
96
71
  */
97
72
  exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
98
- var value, query, productService, rateService, err_1, config, rate, data;
73
+ var value, query, rateService, config, rate, data;
99
74
  return __generator(this, function (_a) {
100
75
  switch (_a.label) {
101
76
  case 0: return [4 /*yield*/, (0, validator_1.validator)(AdminPostTaxRatesTaxRateProductsReq, req.body)];
@@ -104,39 +79,13 @@ exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0
104
79
  return [4 /*yield*/, (0, validator_1.validator)(AdminPostTaxRatesTaxRateProductsParams, req.query)];
105
80
  case 2:
106
81
  query = _a.sent();
107
- productService = req.scope.resolve("productService");
108
82
  rateService = req.scope.resolve("taxRateService");
109
- _a.label = 3;
110
- case 3:
111
- _a.trys.push([3, 5, , 8]);
112
83
  return [4 /*yield*/, rateService.addToProduct(req.params.id, value.products)];
113
- case 4:
114
- _a.sent();
115
- return [3 /*break*/, 8];
116
- case 5:
117
- err_1 = _a.sent();
118
- if (!(err_1.code === "23503")) return [3 /*break*/, 7];
119
- // A foreign key constraint failed meaning something doesn't exist
120
- // either it is a product or the tax rate itself. Using Promise.all
121
- // will try to retrieve all of the resources and will fail when
122
- // something is not found.
123
- return [4 /*yield*/, Promise.all(__spreadArray([
124
- rateService.retrieve(req.params.id, { select: ["id"] })
125
- ], __read(value.products.map(function (id) {
126
- return productService.retrieve(id, { select: ["id"] });
127
- })), false))];
128
- case 6:
129
- // A foreign key constraint failed meaning something doesn't exist
130
- // either it is a product or the tax rate itself. Using Promise.all
131
- // will try to retrieve all of the resources and will fail when
132
- // something is not found.
84
+ case 3:
133
85
  _a.sent();
134
- _a.label = 7;
135
- case 7: throw err_1;
136
- case 8:
137
86
  config = (0, get_query_config_1.getRetrieveConfig)(query.fields, query.expand);
138
87
  return [4 /*yield*/, rateService.retrieve(req.params.id, config)];
139
- case 9:
88
+ case 4:
140
89
  rate = _a.sent();
141
90
  data = (0, get_query_config_1.pickByConfig)(rate, config);
142
91
  res.json({ tax_rate: data });
@@ -1 +1 @@
1
- {"version":3,"file":"add-to-products.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/tax-rates/add-to-products.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAA0E;AAC1E,mDAAqD;AAIrD,yDAAuD;AAEvD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;oBACd,qBAAM,IAAA,qBAAS,EAAC,mCAAmC,EAAE,GAAG,CAAC,IAAI,CAAC,EAAA;;gBAAtE,KAAK,GAAG,SAA8D;gBAE9D,qBAAM,IAAA,qBAAS,EAC3B,sCAAsC,EACtC,GAAG,CAAC,KAAK,CACV,EAAA;;gBAHK,KAAK,GAAG,SAGb;gBAEK,cAAc,GAAmB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;gBACpE,WAAW,GAAmB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;;;;gBAGrE,qBAAM,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,QAAQ,CAAC,EAAA;;gBAA7D,SAA6D,CAAA;;;;qBAEzD,CAAA,KAAG,CAAC,IAAI,KAAK,OAAO,CAAA,EAApB,wBAAoB;gBACtB,kEAAkE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