@merkaly/api 0.2.5-4 → 0.2.5-6

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 (241) hide show
  1. package/.bin/deploy.sh +9 -0
  2. package/.bin/package.sh +12 -0
  3. package/.docker/Dockerfile +21 -0
  4. package/.dockerignore +12 -0
  5. package/.github/dependabot.yml +17 -0
  6. package/.github/semantic.yml +5 -0
  7. package/.github/workflows/pull_request.yml +35 -0
  8. package/.prettierrc +5 -0
  9. package/app.ts +11 -0
  10. package/authCertificate.pem +19 -0
  11. package/nest-cli.json +8 -0
  12. package/package.json +66 -78
  13. package/src/abstracts/abstarct.repository.ts +62 -0
  14. package/src/abstracts/abstract.controller.ts +18 -0
  15. package/src/abstracts/abstract.entity.ts +22 -0
  16. package/src/abstracts/abstract.router.ts +7 -0
  17. package/src/abstracts/abstract.validator.ts +61 -0
  18. package/src/app.config.ts +59 -0
  19. package/src/app.console.ts +24 -0
  20. package/src/app.guard.ts +39 -0
  21. package/src/app.module.ts +54 -0
  22. package/src/app.strategy.ts +21 -0
  23. package/src/commands/seed.command.ts +263 -0
  24. package/src/decorators/public.decorator.ts +5 -0
  25. package/src/decorators/user.decorator.ts +30 -0
  26. package/src/exceptions/missing-identity.exception.ts +11 -0
  27. package/src/interceptors/mongoose.interceptor.ts +63 -0
  28. package/src/main.ts +27 -0
  29. package/src/middlewares/router.middleware.ts +14 -0
  30. package/src/modules/asset/asset.module.ts +19 -0
  31. package/src/modules/asset/files/file.controller.ts +22 -0
  32. package/src/modules/asset/files/file.entity.ts +24 -0
  33. package/src/modules/asset/files/file.module.ts +21 -0
  34. package/src/modules/asset/files/file.repository.ts +44 -0
  35. package/src/modules/asset/files/file.schema.ts +8 -0
  36. package/src/modules/asset/files/file.service.ts +4 -0
  37. package/src/modules/auth/auth.controller.ts +57 -0
  38. package/src/modules/auth/auth.module.ts +20 -0
  39. package/src/modules/auth/organizations/organization.controller.ts +20 -0
  40. package/src/modules/auth/organizations/organization.entity.ts +22 -0
  41. package/src/modules/auth/organizations/organization.module.ts +21 -0
  42. package/src/modules/auth/organizations/organization.repository.ts +16 -0
  43. package/src/modules/auth/organizations/organization.schema.ts +8 -0
  44. package/src/modules/auth/users/user.controller.ts +23 -0
  45. package/src/modules/auth/users/user.entity.ts +25 -0
  46. package/src/modules/auth/users/user.module.ts +20 -0
  47. package/src/modules/auth/users/user.repository.ts +79 -0
  48. package/src/modules/auth/users/user.schema.ts +8 -0
  49. package/src/modules/auth/users/user.validator.ts +32 -0
  50. package/src/modules/command.module.ts +15 -0
  51. package/src/modules/global.module.ts +46 -0
  52. package/src/modules/inventory/brands/brand.controller.ts +44 -0
  53. package/src/modules/inventory/brands/brand.entity.ts +20 -0
  54. package/src/modules/inventory/brands/brand.module.ts +20 -0
  55. package/src/modules/inventory/brands/brand.repository.ts +40 -0
  56. package/src/modules/inventory/brands/brand.schema.ts +8 -0
  57. package/src/modules/inventory/brands/brand.validator.ts +31 -0
  58. package/src/modules/inventory/categories/category.controller.ts +42 -0
  59. package/src/modules/inventory/categories/category.entity.ts +15 -0
  60. package/src/modules/inventory/categories/category.module.ts +19 -0
  61. package/src/modules/inventory/categories/category.repository.ts +34 -0
  62. package/src/modules/inventory/categories/category.schema.ts +8 -0
  63. package/src/modules/inventory/categories/category.validator.ts +20 -0
  64. package/src/modules/inventory/complements/complement.controller.ts +41 -0
  65. package/src/modules/inventory/complements/complement.entity.ts +15 -0
  66. package/src/modules/inventory/complements/complement.module.ts +19 -0
  67. package/src/modules/inventory/complements/complement.repository.ts +37 -0
  68. package/src/modules/inventory/complements/complement.schema.ts +8 -0
  69. package/src/modules/inventory/complements/complement.validator.ts +28 -0
  70. package/src/modules/inventory/inventory.module.ts +23 -0
  71. package/src/modules/inventory/products/documents/attribute.document.ts +14 -0
  72. package/src/modules/inventory/products/documents/dimension.document.ts +16 -0
  73. package/src/modules/inventory/products/product.controller.ts +62 -0
  74. package/src/modules/inventory/products/product.entity.ts +46 -0
  75. package/src/modules/inventory/products/product.module.ts +19 -0
  76. package/src/modules/inventory/products/product.repository.ts +64 -0
  77. package/src/modules/inventory/products/product.schema.ts +19 -0
  78. package/src/modules/inventory/products/product.validator.ts +132 -0
  79. package/src/modules/inventory/products/validators/attributes.validator.ts +15 -0
  80. package/src/modules/inventory/products/validators/dimension.validator.ts +19 -0
  81. package/src/modules/sale/customers/customer.controller.ts +41 -0
  82. package/src/modules/sale/customers/customer.entity.ts +19 -0
  83. package/src/modules/sale/customers/customer.module.ts +18 -0
  84. package/src/modules/sale/customers/customer.repository.ts +30 -0
  85. package/src/modules/sale/customers/customer.schema.ts +8 -0
  86. package/src/modules/sale/customers/customer.validator.ts +43 -0
  87. package/src/modules/sale/orders/documents/address.document.ts +22 -0
  88. package/src/modules/sale/orders/documents/status.document.ts +17 -0
  89. package/src/modules/sale/orders/entities/item.entity.ts +24 -0
  90. package/src/modules/sale/orders/enums/order.status.ts +6 -0
  91. package/src/modules/sale/orders/order.controller.ts +65 -0
  92. package/src/modules/sale/orders/order.entity.ts +46 -0
  93. package/src/modules/sale/orders/order.module.ts +22 -0
  94. package/src/modules/sale/orders/order.repository.ts +122 -0
  95. package/src/modules/sale/orders/order.schema.ts +36 -0
  96. package/src/modules/sale/orders/order.validator.ts +44 -0
  97. package/src/modules/sale/orders/validators/address.validator.ts +50 -0
  98. package/src/modules/sale/orders/validators/billing.validator.ts +11 -0
  99. package/src/modules/sale/orders/validators/item.validator.ts +14 -0
  100. package/src/modules/sale/orders/validators/payment.validator.ts +44 -0
  101. package/src/modules/sale/orders/validators/shipping.validator.ts +14 -0
  102. package/src/modules/sale/payments/entities/status.entity.ts +17 -0
  103. package/src/modules/sale/payments/enums/billing.type.ts +6 -0
  104. package/src/modules/sale/payments/enums/payment.status.ts +7 -0
  105. package/src/modules/sale/payments/enums/shipping.type.ts +4 -0
  106. package/src/modules/sale/payments/payment.controller.ts +45 -0
  107. package/src/modules/sale/payments/payment.entity.ts +25 -0
  108. package/src/modules/sale/payments/payment.module.ts +20 -0
  109. package/src/modules/sale/payments/payment.repository.ts +57 -0
  110. package/src/modules/sale/payments/payment.schema.ts +14 -0
  111. package/src/modules/sale/payments/payment.validator.ts +32 -0
  112. package/src/modules/sale/sale.module.ts +20 -0
  113. package/src/services/auth0.service.ts +49 -0
  114. package/src/services/mongo.service.ts +52 -0
  115. package/test/auth/auth.spec.ts +20 -0
  116. package/test/main.ts +12 -0
  117. package/tsconfig.build.json +4 -0
  118. package/tsconfig.json +21 -0
  119. package/tsconfig.package.json +22 -0
  120. package/.output/abstract/abstract.entity.d.ts +0 -9
  121. package/.output/abstract/abstract.exception.d.ts +0 -11
  122. package/.output/abstract/abstract.exception.js +0 -53
  123. package/.output/abstract/abstract.fixture.d.ts +0 -4
  124. package/.output/abstract/abstract.fixture.js +0 -11
  125. package/.output/abstract/abstract.validator.d.ts +0 -20
  126. package/.output/abstract/abstract.validator.js +0 -105
  127. package/.output/exceptions/missing-identity.exception.d.ts +0 -5
  128. package/.output/exceptions/missing-identity.exception.js +0 -30
  129. package/.output/exceptions/store-not-implemented.exception.d.ts +0 -5
  130. package/.output/exceptions/store-not-implemented.exception.js +0 -31
  131. package/.output/exceptions/store-not-recognized.exception.d.ts +0 -5
  132. package/.output/exceptions/store-not-recognized.exception.js +0 -30
  133. package/.output/modules/asset/files/file.entity.d.ts +0 -10
  134. package/.output/modules/auth/auth.types.d.ts +0 -3
  135. package/.output/modules/auth/auth.types.js +0 -7
  136. package/.output/modules/auth/users/user.validator.d.ts +0 -10
  137. package/.output/modules/auth/users/user.validator.js +0 -50
  138. package/.output/modules/config/organization/organization.entity.d.ts +0 -21
  139. package/.output/modules/config/organization/organization.types.d.ts +0 -23
  140. package/.output/modules/config/organization/organization.types.js +0 -107
  141. package/.output/modules/config/organization/organization.validator.d.ts +0 -18
  142. package/.output/modules/config/organization/organization.validator.js +0 -88
  143. package/.output/modules/insight/validators/order.validator.d.ts +0 -4
  144. package/.output/modules/insight/validators/order.validator.js +0 -27
  145. package/.output/modules/inventory/brands/brand.entity.d.ts +0 -9
  146. package/.output/modules/inventory/brands/brand.exception.d.ts +0 -5
  147. package/.output/modules/inventory/brands/brand.exception.js +0 -40
  148. package/.output/modules/inventory/brands/brand.validator.d.ts +0 -11
  149. package/.output/modules/inventory/brands/brand.validator.js +0 -75
  150. package/.output/modules/inventory/categories/category.entity.d.ts +0 -12
  151. package/.output/modules/inventory/categories/category.exception.d.ts +0 -5
  152. package/.output/modules/inventory/categories/category.exception.js +0 -40
  153. package/.output/modules/inventory/categories/category.fixture.d.ts +0 -5
  154. package/.output/modules/inventory/categories/category.fixture.js +0 -38
  155. package/.output/modules/inventory/categories/category.validator.d.ts +0 -13
  156. package/.output/modules/inventory/categories/category.validator.js +0 -88
  157. package/.output/modules/inventory/products/entities/code.entity.d.ts +0 -5
  158. package/.output/modules/inventory/products/entities/dimension.entity.d.ts +0 -6
  159. package/.output/modules/inventory/products/entities/seo.entity.d.ts +0 -5
  160. package/.output/modules/inventory/products/entities/variant.entity.d.ts +0 -10
  161. package/.output/modules/inventory/products/product.entity.d.ts +0 -26
  162. package/.output/modules/inventory/products/product.exception.d.ts +0 -5
  163. package/.output/modules/inventory/products/product.exception.js +0 -40
  164. package/.output/modules/inventory/products/product.fixture.d.ts +0 -5
  165. package/.output/modules/inventory/products/product.fixture.js +0 -39
  166. package/.output/modules/inventory/products/product.validator.d.ts +0 -38
  167. package/.output/modules/inventory/products/product.validator.js +0 -235
  168. package/.output/modules/inventory/products/schemas/variant.schema.d.ts +0 -27
  169. package/.output/modules/inventory/products/schemas/variant.schema.js +0 -6
  170. package/.output/modules/inventory/products/validators/code.validator.d.ts +0 -5
  171. package/.output/modules/inventory/products/validators/code.validator.js +0 -37
  172. package/.output/modules/inventory/products/validators/dimension.validator.d.ts +0 -6
  173. package/.output/modules/inventory/products/validators/dimension.validator.js +0 -43
  174. package/.output/modules/inventory/products/validators/seo.validator.d.ts +0 -5
  175. package/.output/modules/inventory/products/validators/seo.validator.js +0 -34
  176. package/.output/modules/inventory/products/validators/variant.validator.d.ts +0 -9
  177. package/.output/modules/inventory/products/validators/variant.validator.js +0 -39
  178. package/.output/modules/inventory/properties/property.entity.d.ts +0 -8
  179. package/.output/modules/inventory/properties/property.exception.d.ts +0 -5
  180. package/.output/modules/inventory/properties/property.exception.js +0 -40
  181. package/.output/modules/inventory/properties/property.types.d.ts +0 -6
  182. package/.output/modules/inventory/properties/property.types.js +0 -10
  183. package/.output/modules/inventory/properties/property.validator.d.ts +0 -12
  184. package/.output/modules/inventory/properties/property.validator.js +0 -79
  185. package/.output/modules/layout/pages/page.entity.d.ts +0 -8
  186. package/.output/modules/layout/pages/page.fixture.d.ts +0 -5
  187. package/.output/modules/layout/pages/page.fixture.js +0 -36
  188. package/.output/modules/layout/pages/page.types.d.ts +0 -20
  189. package/.output/modules/layout/pages/page.types.js +0 -2
  190. package/.output/modules/layout/pages/page.validator.d.ts +0 -8
  191. package/.output/modules/layout/pages/page.validator.js +0 -61
  192. package/.output/modules/sale/customers/customer.entity.d.ts +0 -12
  193. package/.output/modules/sale/customers/customer.exception.d.ts +0 -5
  194. package/.output/modules/sale/customers/customer.exception.js +0 -40
  195. package/.output/modules/sale/customers/customer.validator.d.ts +0 -18
  196. package/.output/modules/sale/customers/customer.validator.js +0 -107
  197. package/.output/modules/sale/orders/billing/billing.entity.d.ts +0 -10
  198. package/.output/modules/sale/orders/billing/billing.types.d.ts +0 -9
  199. package/.output/modules/sale/orders/billing/billing.types.js +0 -14
  200. package/.output/modules/sale/orders/billing/billing.validator.d.ts +0 -9
  201. package/.output/modules/sale/orders/billing/billing.validator.js +0 -42
  202. package/.output/modules/sale/orders/billing/entities/address.entity.d.ts +0 -10
  203. package/.output/modules/sale/orders/billing/entities/customer.entity.d.ts +0 -5
  204. package/.output/modules/sale/orders/billing/entities/status.entity.d.ts +0 -6
  205. package/.output/modules/sale/orders/billing/validators/address.validator.d.ts +0 -10
  206. package/.output/modules/sale/orders/billing/validators/address.validator.js +0 -56
  207. package/.output/modules/sale/orders/billing/validators/customer.validator.d.ts +0 -5
  208. package/.output/modules/sale/orders/billing/validators/customer.validator.js +0 -36
  209. package/.output/modules/sale/orders/customer/customer.entity.d.ts +0 -5
  210. package/.output/modules/sale/orders/customer/customer.validator.d.ts +0 -5
  211. package/.output/modules/sale/orders/customer/customer.validator.js +0 -36
  212. package/.output/modules/sale/orders/item/item.entity.d.ts +0 -9
  213. package/.output/modules/sale/orders/item/item.schema.d.ts +0 -27
  214. package/.output/modules/sale/orders/item/item.schema.js +0 -9
  215. package/.output/modules/sale/orders/item/item.validator.d.ts +0 -4
  216. package/.output/modules/sale/orders/item/item.validator.js +0 -29
  217. package/.output/modules/sale/orders/order.entity.d.ts +0 -21
  218. package/.output/modules/sale/orders/order.exception.d.ts +0 -13
  219. package/.output/modules/sale/orders/order.exception.js +0 -46
  220. package/.output/modules/sale/orders/order.validator.d.ts +0 -28
  221. package/.output/modules/sale/orders/order.validator.js +0 -140
  222. package/.output/modules/sale/orders/shipping/entities/address.entity.d.ts +0 -10
  223. package/.output/modules/sale/orders/shipping/entities/customer.entity.d.ts +0 -5
  224. package/.output/modules/sale/orders/shipping/entities/status.entity.d.ts +0 -6
  225. package/.output/modules/sale/orders/shipping/shipping.entity.d.ts +0 -11
  226. package/.output/modules/sale/orders/shipping/shipping.types.d.ts +0 -11
  227. package/.output/modules/sale/orders/shipping/shipping.types.js +0 -16
  228. package/.output/modules/sale/orders/shipping/shipping.validator.d.ts +0 -10
  229. package/.output/modules/sale/orders/shipping/shipping.validator.js +0 -48
  230. package/.output/modules/sale/orders/shipping/validators/address.validator.d.ts +0 -10
  231. package/.output/modules/sale/orders/shipping/validators/address.validator.js +0 -56
  232. package/.output/modules/sale/orders/shipping/validators/customer.validator.d.ts +0 -5
  233. package/.output/modules/sale/orders/shipping/validators/customer.validator.js +0 -36
  234. package/.output/modules/sale/orders/status/status.entity.d.ts +0 -6
  235. package/.output/modules/sale/orders/status/status.validator.d.ts +0 -8
  236. package/.output/modules/sale/orders/status/status.validator.js +0 -12
  237. package/.output/services/logger.service.d.ts +0 -11
  238. package/.output/services/logger.service.js +0 -50
  239. package/.output/types.d.ts +0 -18
  240. package/.output/types.js +0 -2
  241. package/LICENSE +0 -674
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ItemSchema = void 0;
4
- var mongoose_1 = require("@nestjs/mongoose");
5
- var item_entity_1 = require("./item.entity");
6
- exports.ItemSchema = mongoose_1.SchemaFactory.createForClass(item_entity_1.ItemEntity);
7
- exports.ItemSchema.virtual('total').get(function () {
8
- return this.price * this.quantity;
9
- });
@@ -1,4 +0,0 @@
1
- export declare class CreateItemValidator {
2
- quantity: number;
3
- product: string;
4
- }
@@ -1,29 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.CreateItemValidator = void 0;
13
- var class_validator_1 = require("class-validator");
14
- var CreateItemValidator = (function () {
15
- function CreateItemValidator() {
16
- this.quantity = 1;
17
- }
18
- __decorate([
19
- (0, class_validator_1.IsNumber)(),
20
- (0, class_validator_1.IsNotEmpty)(),
21
- __metadata("design:type", Object)
22
- ], CreateItemValidator.prototype, "quantity", void 0);
23
- __decorate([
24
- (0, class_validator_1.IsMongoId)(),
25
- __metadata("design:type", String)
26
- ], CreateItemValidator.prototype, "product", void 0);
27
- return CreateItemValidator;
28
- }());
29
- exports.CreateItemValidator = CreateItemValidator;
@@ -1,21 +0,0 @@
1
- import { AbstractEntity } from '../../../abstract/abstract.entity';
2
- import { BillingEntity } from './billing/billing.entity';
3
- import { ItemEntity } from './item/item.entity';
4
- import { ShippingEntity } from './shipping/shipping.entity';
5
- import { StatusEntity } from './status/status.entity';
6
- import { CustomerEntity } from "../customers/customer.entity";
7
- export declare class OrderEntity extends AbstractEntity {
8
- static readonly $index = "sale_orders";
9
- number: number;
10
- status: StatusEntity[];
11
- items: ItemEntity[];
12
- billing: BillingEntity;
13
- shipping: ShippingEntity;
14
- customer?: CustomerEntity;
15
- notes: string;
16
- createdBy: string;
17
- readonly fullNumber: string;
18
- readonly total: number;
19
- readonly subtotal: number;
20
- readonly currentStatus: StatusEntity;
21
- }
@@ -1,13 +0,0 @@
1
- import { NotAcceptableException } from '@nestjs/common/exceptions/not-acceptable.exception';
2
- import { ItemEntity } from './item/item.entity';
3
- export declare class OrderWithUnavailableProduct extends NotAcceptableException {
4
- readonly items: ItemEntity[];
5
- readonly message = "Some products are not available";
6
- readonly name: string;
7
- constructor(items: ItemEntity[]);
8
- getResponse(): {
9
- items: ItemEntity[];
10
- message: string;
11
- name: string;
12
- };
13
- }
@@ -1,46 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __assign = (this && this.__assign) || function () {
18
- __assign = Object.assign || function(t) {
19
- for (var s, i = 1, n = arguments.length; i < n; i++) {
20
- s = arguments[i];
21
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
- t[p] = s[p];
23
- }
24
- return t;
25
- };
26
- return __assign.apply(this, arguments);
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.OrderWithUnavailableProduct = void 0;
30
- var not_acceptable_exception_1 = require("@nestjs/common/exceptions/not-acceptable.exception");
31
- var OrderWithUnavailableProduct = (function (_super) {
32
- __extends(OrderWithUnavailableProduct, _super);
33
- function OrderWithUnavailableProduct(items) {
34
- var _this = _super.call(this) || this;
35
- _this.items = [];
36
- _this.message = 'Some products are not available';
37
- _this.name = OrderWithUnavailableProduct.name;
38
- _this.items = items;
39
- return _this;
40
- }
41
- OrderWithUnavailableProduct.prototype.getResponse = function () {
42
- return __assign(__assign({}, _super.prototype.getResponse.call(this)), { items: this.items, message: this.message, name: this.name });
43
- };
44
- return OrderWithUnavailableProduct;
45
- }(not_acceptable_exception_1.NotAcceptableException));
46
- exports.OrderWithUnavailableProduct = OrderWithUnavailableProduct;
@@ -1,28 +0,0 @@
1
- import { CreateBillingValidator } from './billing/billing.validator';
2
- import { CreateItemValidator } from './item/item.validator';
3
- import { CreateShippingValidator } from './shipping/shipping.validator';
4
- import { StatusType } from './status/status.validator';
5
- import { AbstractValidator, FindValidator } from "../../../abstract/abstract.validator";
6
- import { OrderEntity } from './order.entity';
7
- export declare class FindOrdersValidator extends FindValidator<OrderEntity> {
8
- showInactives: boolean;
9
- }
10
- export declare class CreateOrderValidator extends AbstractValidator {
11
- customer?: string;
12
- items: CreateItemValidator[];
13
- billing: CreateBillingValidator;
14
- shipping: CreateShippingValidator;
15
- notes?: string;
16
- }
17
- export declare class UpdateOrderValidator extends CreateOrderValidator {
18
- }
19
- export declare class ChangeOrderStatusValidator extends AbstractValidator {
20
- status: StatusType;
21
- }
22
- export declare class RefundOrderItemsValidator extends AbstractValidator {
23
- quantity: number;
24
- item: string;
25
- }
26
- export declare class GetByStatus extends AbstractValidator {
27
- status: StatusType;
28
- }
@@ -1,140 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
- 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;
21
- return c > 3 && r && Object.defineProperty(target, key, r), r;
22
- };
23
- var __metadata = (this && this.__metadata) || function (k, v) {
24
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
- };
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.GetByStatus = exports.RefundOrderItemsValidator = exports.ChangeOrderStatusValidator = exports.UpdateOrderValidator = exports.CreateOrderValidator = exports.FindOrdersValidator = void 0;
28
- var class_transformer_1 = require("class-transformer");
29
- var class_validator_1 = require("class-validator");
30
- var billing_validator_1 = require("./billing/billing.validator");
31
- var item_validator_1 = require("./item/item.validator");
32
- var shipping_validator_1 = require("./shipping/shipping.validator");
33
- var status_validator_1 = require("./status/status.validator");
34
- var abstract_validator_1 = require("../../../abstract/abstract.validator");
35
- var FindOrdersValidator = (function (_super) {
36
- __extends(FindOrdersValidator, _super);
37
- function FindOrdersValidator() {
38
- var _this = _super !== null && _super.apply(this, arguments) || this;
39
- _this.showInactives = false;
40
- return _this;
41
- }
42
- __decorate([
43
- (0, class_validator_1.IsBoolean)(),
44
- (0, class_transformer_1.Transform)(function (_a) {
45
- var value = _a.value;
46
- return value === 'true';
47
- }),
48
- __metadata("design:type", Object)
49
- ], FindOrdersValidator.prototype, "showInactives", void 0);
50
- return FindOrdersValidator;
51
- }(abstract_validator_1.FindValidator));
52
- exports.FindOrdersValidator = FindOrdersValidator;
53
- var CreateOrderValidator = (function (_super) {
54
- __extends(CreateOrderValidator, _super);
55
- function CreateOrderValidator() {
56
- var _this = _super !== null && _super.apply(this, arguments) || this;
57
- _this.items = [];
58
- _this.billing = new billing_validator_1.CreateBillingValidator();
59
- _this.shipping = new shipping_validator_1.CreateShippingValidator();
60
- return _this;
61
- }
62
- __decorate([
63
- (0, class_validator_1.IsMongoId)(),
64
- (0, class_validator_1.IsOptional)(),
65
- __metadata("design:type", String)
66
- ], CreateOrderValidator.prototype, "customer", void 0);
67
- __decorate([
68
- (0, class_validator_1.ArrayNotEmpty)(),
69
- (0, class_validator_1.ValidateNested)({ each: true }),
70
- (0, class_transformer_1.Type)(function () { return item_validator_1.CreateItemValidator; }),
71
- __metadata("design:type", Array)
72
- ], CreateOrderValidator.prototype, "items", void 0);
73
- __decorate([
74
- (0, class_validator_1.ValidateNested)(),
75
- (0, class_transformer_1.Type)(function () { return billing_validator_1.CreateBillingValidator; }),
76
- (0, class_validator_1.IsNotEmptyObject)(),
77
- __metadata("design:type", Object)
78
- ], CreateOrderValidator.prototype, "billing", void 0);
79
- __decorate([
80
- (0, class_validator_1.ValidateNested)(),
81
- (0, class_transformer_1.Type)(function () { return shipping_validator_1.CreateShippingValidator; }),
82
- (0, class_validator_1.IsNotEmptyObject)(),
83
- __metadata("design:type", Object)
84
- ], CreateOrderValidator.prototype, "shipping", void 0);
85
- __decorate([
86
- (0, class_validator_1.IsOptional)(),
87
- (0, class_validator_1.IsString)(),
88
- __metadata("design:type", String)
89
- ], CreateOrderValidator.prototype, "notes", void 0);
90
- return CreateOrderValidator;
91
- }(abstract_validator_1.AbstractValidator));
92
- exports.CreateOrderValidator = CreateOrderValidator;
93
- var UpdateOrderValidator = (function (_super) {
94
- __extends(UpdateOrderValidator, _super);
95
- function UpdateOrderValidator() {
96
- return _super !== null && _super.apply(this, arguments) || this;
97
- }
98
- return UpdateOrderValidator;
99
- }(CreateOrderValidator));
100
- exports.UpdateOrderValidator = UpdateOrderValidator;
101
- var ChangeOrderStatusValidator = (function (_super) {
102
- __extends(ChangeOrderStatusValidator, _super);
103
- function ChangeOrderStatusValidator() {
104
- return _super !== null && _super.apply(this, arguments) || this;
105
- }
106
- __decorate([
107
- (0, class_validator_1.IsEnum)(status_validator_1.StatusType),
108
- __metadata("design:type", String)
109
- ], ChangeOrderStatusValidator.prototype, "status", void 0);
110
- return ChangeOrderStatusValidator;
111
- }(abstract_validator_1.AbstractValidator));
112
- exports.ChangeOrderStatusValidator = ChangeOrderStatusValidator;
113
- var RefundOrderItemsValidator = (function (_super) {
114
- __extends(RefundOrderItemsValidator, _super);
115
- function RefundOrderItemsValidator() {
116
- return _super !== null && _super.apply(this, arguments) || this;
117
- }
118
- __decorate([
119
- (0, class_validator_1.IsNumber)(),
120
- __metadata("design:type", Number)
121
- ], RefundOrderItemsValidator.prototype, "quantity", void 0);
122
- __decorate([
123
- (0, class_validator_1.IsMongoId)(),
124
- __metadata("design:type", String)
125
- ], RefundOrderItemsValidator.prototype, "item", void 0);
126
- return RefundOrderItemsValidator;
127
- }(abstract_validator_1.AbstractValidator));
128
- exports.RefundOrderItemsValidator = RefundOrderItemsValidator;
129
- var GetByStatus = (function (_super) {
130
- __extends(GetByStatus, _super);
131
- function GetByStatus() {
132
- return _super !== null && _super.apply(this, arguments) || this;
133
- }
134
- __decorate([
135
- (0, class_validator_1.IsEnum)(status_validator_1.StatusType),
136
- __metadata("design:type", String)
137
- ], GetByStatus.prototype, "status", void 0);
138
- return GetByStatus;
139
- }(abstract_validator_1.AbstractValidator));
140
- exports.GetByStatus = GetByStatus;
@@ -1,10 +0,0 @@
1
- import { MetaAddress } from "../../../../../types";
2
- export declare class ShippingAddressEntity extends Map implements MetaAddress {
3
- country: string;
4
- code: string;
5
- street: string;
6
- number: string;
7
- complement: string;
8
- city: string;
9
- state: string;
10
- }
@@ -1,5 +0,0 @@
1
- export declare class ShippingCustomerEntity extends Map {
2
- name: string;
3
- email: string;
4
- phone: string;
5
- }
@@ -1,6 +0,0 @@
1
- import { ShippingStatus } from "../shipping.types";
2
- export declare class ShippingStatusEntity {
3
- name: ShippingStatus;
4
- user: string;
5
- date: any;
6
- }
@@ -1,11 +0,0 @@
1
- import { ShippingMethod } from "./shipping.types";
2
- import { ShippingAddressEntity } from "./entities/address.entity";
3
- import { ShippingCustomerEntity } from "./entities/customer.entity";
4
- import { ShippingStatusEntity } from "./entities/status.entity";
5
- export declare class ShippingEntity extends Map {
6
- address: ShippingAddressEntity;
7
- customer: ShippingCustomerEntity;
8
- method: ShippingMethod;
9
- price: number;
10
- status: ShippingStatusEntity[];
11
- }
@@ -1,11 +0,0 @@
1
- export declare enum ShippingMethod {
2
- RETIRE_ON_SITE = "RETIRE ON SITE",
3
- DIRECT_DELIVERY = "DIRECT DELIVERY"
4
- }
5
- export declare enum ShippingStatus {
6
- ORDERED = "ORDERED",
7
- PACKED = "PACKED",
8
- IN_TRANSIT = "IN_TRANSIT",
9
- FAILED = "FAILED",
10
- DELIVERED = "DELIVERED"
11
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ShippingStatus = exports.ShippingMethod = void 0;
4
- var ShippingMethod;
5
- (function (ShippingMethod) {
6
- ShippingMethod["RETIRE_ON_SITE"] = "RETIRE ON SITE";
7
- ShippingMethod["DIRECT_DELIVERY"] = "DIRECT DELIVERY";
8
- })(ShippingMethod = exports.ShippingMethod || (exports.ShippingMethod = {}));
9
- var ShippingStatus;
10
- (function (ShippingStatus) {
11
- ShippingStatus["ORDERED"] = "ORDERED";
12
- ShippingStatus["PACKED"] = "PACKED";
13
- ShippingStatus["IN_TRANSIT"] = "IN_TRANSIT";
14
- ShippingStatus["FAILED"] = "FAILED";
15
- ShippingStatus["DELIVERED"] = "DELIVERED";
16
- })(ShippingStatus = exports.ShippingStatus || (exports.ShippingStatus = {}));
@@ -1,10 +0,0 @@
1
- import { ShippingMethod } from "./shipping.types";
2
- import 'reflect-metadata';
3
- import { ShippingAddressValidator } from "./validators/address.validator";
4
- import { ShippingCustomerValidator } from "./validators/customer.validator";
5
- export declare class CreateShippingValidator {
6
- customer: ShippingCustomerValidator;
7
- address: ShippingAddressValidator;
8
- method: ShippingMethod;
9
- price: number;
10
- }
@@ -1,48 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.CreateShippingValidator = void 0;
13
- var class_transformer_1 = require("class-transformer");
14
- var class_validator_1 = require("class-validator");
15
- var shipping_types_1 = require("./shipping.types");
16
- require("reflect-metadata");
17
- var address_validator_1 = require("./validators/address.validator");
18
- var customer_validator_1 = require("./validators/customer.validator");
19
- var CreateShippingValidator = (function () {
20
- function CreateShippingValidator() {
21
- this.customer = new customer_validator_1.ShippingCustomerValidator();
22
- this.address = new address_validator_1.ShippingAddressValidator();
23
- this.price = 0;
24
- }
25
- __decorate([
26
- (0, class_validator_1.ValidateNested)(),
27
- (0, class_transformer_1.Type)(function () { return customer_validator_1.ShippingCustomerValidator; }),
28
- (0, class_validator_1.IsNotEmptyObject)(),
29
- __metadata("design:type", Object)
30
- ], CreateShippingValidator.prototype, "customer", void 0);
31
- __decorate([
32
- (0, class_validator_1.ValidateNested)(),
33
- (0, class_transformer_1.Type)(function () { return address_validator_1.ShippingAddressValidator; }),
34
- (0, class_validator_1.IsNotEmptyObject)(),
35
- __metadata("design:type", Object)
36
- ], CreateShippingValidator.prototype, "address", void 0);
37
- __decorate([
38
- (0, class_validator_1.IsEnum)(shipping_types_1.ShippingMethod),
39
- __metadata("design:type", String)
40
- ], CreateShippingValidator.prototype, "method", void 0);
41
- __decorate([
42
- (0, class_validator_1.IsNumber)(),
43
- (0, class_validator_1.Min)(0),
44
- __metadata("design:type", Object)
45
- ], CreateShippingValidator.prototype, "price", void 0);
46
- return CreateShippingValidator;
47
- }());
48
- exports.CreateShippingValidator = CreateShippingValidator;
@@ -1,10 +0,0 @@
1
- import { MetaAddress } from "../../../../../types";
2
- export declare class ShippingAddressValidator implements MetaAddress {
3
- country: string;
4
- code: string;
5
- street: string;
6
- number: string;
7
- complement?: string;
8
- city: string;
9
- state: string;
10
- }
@@ -1,56 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ShippingAddressValidator = void 0;
13
- var class_validator_1 = require("class-validator");
14
- var ShippingAddressValidator = (function () {
15
- function ShippingAddressValidator() {
16
- this.country = String();
17
- this.code = String();
18
- this.street = String();
19
- this.number = String();
20
- this.complement = undefined;
21
- this.city = String();
22
- this.state = String();
23
- }
24
- __decorate([
25
- (0, class_validator_1.IsISO31661Alpha2)(),
26
- __metadata("design:type", Object)
27
- ], ShippingAddressValidator.prototype, "country", void 0);
28
- __decorate([
29
- (0, class_validator_1.IsString)(),
30
- __metadata("design:type", Object)
31
- ], ShippingAddressValidator.prototype, "code", void 0);
32
- __decorate([
33
- (0, class_validator_1.IsString)(),
34
- __metadata("design:type", Object)
35
- ], ShippingAddressValidator.prototype, "street", void 0);
36
- __decorate([
37
- (0, class_validator_1.IsString)(),
38
- (0, class_validator_1.IsOptional)(),
39
- __metadata("design:type", Object)
40
- ], ShippingAddressValidator.prototype, "number", void 0);
41
- __decorate([
42
- (0, class_validator_1.IsString)(),
43
- (0, class_validator_1.IsOptional)(),
44
- __metadata("design:type", String)
45
- ], ShippingAddressValidator.prototype, "complement", void 0);
46
- __decorate([
47
- (0, class_validator_1.IsString)(),
48
- __metadata("design:type", Object)
49
- ], ShippingAddressValidator.prototype, "city", void 0);
50
- __decorate([
51
- (0, class_validator_1.IsString)(),
52
- __metadata("design:type", Object)
53
- ], ShippingAddressValidator.prototype, "state", void 0);
54
- return ShippingAddressValidator;
55
- }());
56
- exports.ShippingAddressValidator = ShippingAddressValidator;
@@ -1,5 +0,0 @@
1
- export declare class ShippingCustomerValidator {
2
- name: string;
3
- email: string;
4
- phone?: string;
5
- }
@@ -1,36 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ShippingCustomerValidator = void 0;
13
- var class_validator_1 = require("class-validator");
14
- var ShippingCustomerValidator = (function () {
15
- function ShippingCustomerValidator() {
16
- this.name = String();
17
- this.email = String();
18
- this.phone = undefined;
19
- }
20
- __decorate([
21
- (0, class_validator_1.IsString)(),
22
- (0, class_validator_1.IsNotEmpty)(),
23
- __metadata("design:type", Object)
24
- ], ShippingCustomerValidator.prototype, "name", void 0);
25
- __decorate([
26
- (0, class_validator_1.IsEmail)(),
27
- __metadata("design:type", Object)
28
- ], ShippingCustomerValidator.prototype, "email", void 0);
29
- __decorate([
30
- (0, class_validator_1.IsString)(),
31
- (0, class_validator_1.IsOptional)(),
32
- __metadata("design:type", String)
33
- ], ShippingCustomerValidator.prototype, "phone", void 0);
34
- return ShippingCustomerValidator;
35
- }());
36
- exports.ShippingCustomerValidator = ShippingCustomerValidator;
@@ -1,6 +0,0 @@
1
- import { StatusType } from './status.validator';
2
- export declare class StatusEntity {
3
- name: StatusType;
4
- user: string;
5
- date: any;
6
- }
@@ -1,8 +0,0 @@
1
- export declare enum StatusType {
2
- CREATED = "CREATED",
3
- ACCEPTED = "ACCEPTED",
4
- IN_PREPARATION = "IN_PREPARATION",
5
- SENDED = "SENDED",
6
- COMPLETED = "COMPLETED",
7
- CANCELED = "CANCELED"
8
- }
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StatusType = void 0;
4
- var StatusType;
5
- (function (StatusType) {
6
- StatusType["CREATED"] = "CREATED";
7
- StatusType["ACCEPTED"] = "ACCEPTED";
8
- StatusType["IN_PREPARATION"] = "IN_PREPARATION";
9
- StatusType["SENDED"] = "SENDED";
10
- StatusType["COMPLETED"] = "COMPLETED";
11
- StatusType["CANCELED"] = "CANCELED";
12
- })(StatusType = exports.StatusType || (exports.StatusType = {}));
@@ -1,11 +0,0 @@
1
- import { LoggerService as NestLogger } from '@nestjs/common';
2
- import { Request } from 'express';
3
- export declare class LoggerService implements NestLogger {
4
- protected readonly $request: Request;
5
- protected get organization(): string | string[];
6
- log(message: string): void;
7
- error(reason: Error): void;
8
- warn(message: string, scope?: string): void;
9
- debug(message: string, scope?: string): void;
10
- verbose(message: string, scope?: string): void;
11
- }
@@ -1,50 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.LoggerService = void 0;
13
- var common_1 = require("@nestjs/common");
14
- var core_1 = require("@nestjs/core");
15
- var LoggerService = (function () {
16
- function LoggerService() {
17
- }
18
- Object.defineProperty(LoggerService.prototype, "organization", {
19
- get: function () {
20
- var identity = this.$request.headers.identity;
21
- return identity;
22
- },
23
- enumerable: false,
24
- configurable: true
25
- });
26
- LoggerService.prototype.log = function (message) {
27
- return common_1.Logger.log(message, this.organization);
28
- };
29
- LoggerService.prototype.error = function (reason) {
30
- return common_1.Logger.error("[" + reason.name + "]: " + reason.message, this.organization);
31
- };
32
- LoggerService.prototype.warn = function (message, scope) {
33
- return common_1.Logger.warn("[" + scope + "]: " + message, this.organization);
34
- };
35
- LoggerService.prototype.debug = function (message, scope) {
36
- return common_1.Logger.debug("[" + scope + "]: " + message, this.organization);
37
- };
38
- LoggerService.prototype.verbose = function (message, scope) {
39
- return common_1.Logger.verbose("[" + scope + "]: " + message, this.organization);
40
- };
41
- __decorate([
42
- (0, common_1.Inject)(core_1.REQUEST),
43
- __metadata("design:type", Object)
44
- ], LoggerService.prototype, "$request", void 0);
45
- LoggerService = __decorate([
46
- (0, common_1.Injectable)()
47
- ], LoggerService);
48
- return LoggerService;
49
- }());
50
- exports.LoggerService = LoggerService;