@merkaly/api 0.2.4 → 0.2.5-1

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 (89) hide show
  1. package/.output/modules/asset/files/file.entity.d.ts +10 -0
  2. package/.output/modules/{users → auth/users}/user.validator.d.ts +1 -1
  3. package/.output/modules/{setting → config}/organization/organization.entity.d.ts +1 -1
  4. package/.output/modules/inventory/brands/brand.entity.d.ts +2 -2
  5. package/.output/modules/inventory/categories/category.entity.d.ts +2 -2
  6. package/.output/modules/inventory/products/entities/variant.entity.d.ts +7 -0
  7. package/.output/modules/inventory/products/product.entity.d.ts +5 -4
  8. package/.output/modules/inventory/products/product.fixture.js +1 -1
  9. package/.output/modules/inventory/products/product.validator.d.ts +1 -2
  10. package/.output/modules/inventory/products/product.validator.js +2 -6
  11. package/.output/modules/inventory/products/schemas/variant.schema.d.ts +27 -0
  12. package/.output/modules/inventory/products/schemas/variant.schema.js +6 -0
  13. package/.output/modules/inventory/properties/property.types.d.ts +6 -0
  14. package/.output/modules/inventory/properties/property.types.js +10 -0
  15. package/.output/modules/inventory/properties/property.validator.d.ts +2 -4
  16. package/.output/modules/inventory/properties/property.validator.js +3 -5
  17. package/.output/modules/{content → layout}/pages/page.entity.d.ts +1 -1
  18. package/.output/modules/{sales/clients/client.entity.d.ts → sale/customers/customer.entity.d.ts} +2 -2
  19. package/.output/modules/{sales/clients/client.exception.d.ts → sale/customers/customer.exception.d.ts} +1 -1
  20. package/.output/modules/{sales/clients/client.exception.js → sale/customers/customer.exception.js} +9 -9
  21. package/.output/modules/{sales → sale}/orders/order.entity.d.ts +2 -4
  22. package/.output/modules/{sales → sale}/orders/order.validator.d.ts +1 -4
  23. package/.output/modules/{sales → sale}/orders/order.validator.js +1 -14
  24. package/package.json +1 -1
  25. package/.output/modules/assets/asset.entity.d.ts +0 -10
  26. package/.output/modules/content/banners/banner.entity.d.ts +0 -7
  27. package/.output/modules/content/banners/banner.fixture.d.ts +0 -5
  28. package/.output/modules/content/banners/banner.fixture.js +0 -39
  29. package/.output/modules/content/banners/banner.validator.d.ts +0 -8
  30. package/.output/modules/content/banners/banner.validator.js +0 -63
  31. package/.output/modules/content/pages/page.types.d.ts +0 -20
  32. package/.output/modules/content/pages/page.types.js +0 -13
  33. package/.output/modules/inventory/products/entities/price.entity.d.ts +0 -4
  34. package/.output/modules/inventory/products/validators/price.validator.d.ts +0 -4
  35. package/.output/modules/inventory/products/validators/price.validator.js +0 -30
  36. package/.output/modules/setting/connections/connection.validator.d.ts +0 -8
  37. package/.output/modules/setting/connections/connection.validator.js +0 -37
  38. package/.output/modules/setting/layout/layout.entity.d.ts +0 -6
  39. package/.output/modules/setting/members/member.validator.d.ts +0 -2
  40. package/.output/modules/setting/members/member.validator.js +0 -2
  41. package/.output/modules/setting/theme/theme.entity.d.ts +0 -6
  42. /package/.output/modules/{users → auth/users}/user.validator.js +0 -0
  43. /package/.output/modules/{setting → config}/organization/organization.types.d.ts +0 -0
  44. /package/.output/modules/{setting → config}/organization/organization.types.js +0 -0
  45. /package/.output/modules/{setting → config}/organization/organization.validator.d.ts +0 -0
  46. /package/.output/modules/{setting → config}/organization/organization.validator.js +0 -0
  47. /package/.output/modules/{content → layout}/pages/page.fixture.d.ts +0 -0
  48. /package/.output/modules/{content → layout}/pages/page.fixture.js +0 -0
  49. /package/.output/modules/{content → layout}/pages/page.validator.d.ts +0 -0
  50. /package/.output/modules/{content → layout}/pages/page.validator.js +0 -0
  51. /package/.output/modules/{sales/clients/client.validator.d.ts → sale/customers/customer.validator.d.ts} +0 -0
  52. /package/.output/modules/{sales/clients/client.validator.js → sale/customers/customer.validator.js} +0 -0
  53. /package/.output/modules/{sales → sale}/orders/billing/billing.entity.d.ts +0 -0
  54. /package/.output/modules/{sales → sale}/orders/billing/billing.types.d.ts +0 -0
  55. /package/.output/modules/{sales → sale}/orders/billing/billing.types.js +0 -0
  56. /package/.output/modules/{sales → sale}/orders/billing/billing.validator.d.ts +0 -0
  57. /package/.output/modules/{sales → sale}/orders/billing/billing.validator.js +0 -0
  58. /package/.output/modules/{sales → sale}/orders/billing/entities/address.entity.d.ts +0 -0
  59. /package/.output/modules/{sales → sale}/orders/billing/entities/customer.entity.d.ts +0 -0
  60. /package/.output/modules/{sales → sale}/orders/billing/entities/status.entity.d.ts +0 -0
  61. /package/.output/modules/{sales → sale}/orders/billing/validators/address.validator.d.ts +0 -0
  62. /package/.output/modules/{sales → sale}/orders/billing/validators/address.validator.js +0 -0
  63. /package/.output/modules/{sales → sale}/orders/billing/validators/customer.validator.d.ts +0 -0
  64. /package/.output/modules/{sales → sale}/orders/billing/validators/customer.validator.js +0 -0
  65. /package/.output/modules/{sales → sale}/orders/customer/customer.entity.d.ts +0 -0
  66. /package/.output/modules/{sales → sale}/orders/customer/customer.validator.d.ts +0 -0
  67. /package/.output/modules/{sales → sale}/orders/customer/customer.validator.js +0 -0
  68. /package/.output/modules/{sales → sale}/orders/item/item.entity.d.ts +0 -0
  69. /package/.output/modules/{sales → sale}/orders/item/item.schema.d.ts +0 -0
  70. /package/.output/modules/{sales → sale}/orders/item/item.schema.js +0 -0
  71. /package/.output/modules/{sales → sale}/orders/item/item.validator.d.ts +0 -0
  72. /package/.output/modules/{sales → sale}/orders/item/item.validator.js +0 -0
  73. /package/.output/modules/{sales → sale}/orders/order.exception.d.ts +0 -0
  74. /package/.output/modules/{sales → sale}/orders/order.exception.js +0 -0
  75. /package/.output/modules/{sales → sale}/orders/shipping/entities/address.entity.d.ts +0 -0
  76. /package/.output/modules/{sales → sale}/orders/shipping/entities/customer.entity.d.ts +0 -0
  77. /package/.output/modules/{sales → sale}/orders/shipping/entities/status.entity.d.ts +0 -0
  78. /package/.output/modules/{sales → sale}/orders/shipping/shipping.entity.d.ts +0 -0
  79. /package/.output/modules/{sales → sale}/orders/shipping/shipping.types.d.ts +0 -0
  80. /package/.output/modules/{sales → sale}/orders/shipping/shipping.types.js +0 -0
  81. /package/.output/modules/{sales → sale}/orders/shipping/shipping.validator.d.ts +0 -0
  82. /package/.output/modules/{sales → sale}/orders/shipping/shipping.validator.js +0 -0
  83. /package/.output/modules/{sales → sale}/orders/shipping/validators/address.validator.d.ts +0 -0
  84. /package/.output/modules/{sales → sale}/orders/shipping/validators/address.validator.js +0 -0
  85. /package/.output/modules/{sales → sale}/orders/shipping/validators/customer.validator.d.ts +0 -0
  86. /package/.output/modules/{sales → sale}/orders/shipping/validators/customer.validator.js +0 -0
  87. /package/.output/modules/{sales → sale}/orders/status/status.entity.d.ts +0 -0
  88. /package/.output/modules/{sales → sale}/orders/status/status.validator.d.ts +0 -0
  89. /package/.output/modules/{sales → sale}/orders/status/status.validator.js +0 -0
@@ -0,0 +1,10 @@
1
+ import { AbstractEntity } from '../../../abstract/abstract.entity';
2
+ export declare class FileEntity extends AbstractEntity {
3
+ static readonly $index = "asset_files";
4
+ name: string;
5
+ url: string;
6
+ weak: boolean;
7
+ description: string;
8
+ type: string;
9
+ size: number;
10
+ }
@@ -1,4 +1,4 @@
1
- import { MetaAddress } from '../../types';
1
+ import { MetaAddress } from '../../../types';
2
2
  export declare class AddressValidator implements MetaAddress {
3
3
  country: string;
4
4
  code: string;
@@ -9,7 +9,7 @@ interface OrganizationMetadata {
9
9
  theme: string;
10
10
  }
11
11
  export declare class OrganizationEntity extends AbstractEntity {
12
- static readonly $index = "setting_organization";
12
+ static readonly $index = "config_organization";
13
13
  metadata: OrganizationMetadata;
14
14
  }
15
15
  export {};
@@ -1,9 +1,9 @@
1
1
  import { AbstractEntity } from '../../../abstract/abstract.entity';
2
- import { AssetEntity } from '../../assets/asset.entity';
2
+ import { FileEntity } from '../../asset/files/file.entity';
3
3
  export declare class BrandEntity extends AbstractEntity {
4
4
  static readonly $index = "inventory_brands";
5
5
  name: string;
6
6
  description: string;
7
- image: AssetEntity;
7
+ image: FileEntity;
8
8
  readonly picture: string;
9
9
  }
@@ -1,12 +1,12 @@
1
1
  import { AbstractEntity } from '../../../abstract/abstract.entity';
2
2
  import { PropertyEntity } from '../properties/property.entity';
3
- import { AssetEntity } from '../../assets/asset.entity';
3
+ import { FileEntity } from '../../asset/files/file.entity';
4
4
  export declare class CategoryEntity extends AbstractEntity {
5
5
  static readonly $index = "inventory_categories";
6
6
  name: string;
7
7
  description: string;
8
8
  icon: string;
9
9
  properties: PropertyEntity[];
10
- image: AssetEntity;
10
+ image: FileEntity;
11
11
  readonly picture: string;
12
12
  }
@@ -0,0 +1,7 @@
1
+ import { PropertyEntity } from '../../properties/property.entity';
2
+ import { AbstractEntity } from '../../../../abstract/abstract.entity';
3
+ export declare class VariantEntity extends AbstractEntity {
4
+ property: PropertyEntity;
5
+ price: number;
6
+ stock: number;
7
+ }
@@ -1,11 +1,11 @@
1
1
  import { AbstractEntity } from '../../../abstract/abstract.entity';
2
- import { AssetEntity } from '../../assets/asset.entity';
2
+ import { FileEntity } from '../../asset/files/file.entity';
3
3
  import { BrandEntity } from '../brands/brand.entity';
4
4
  import { CategoryEntity } from '../categories/category.entity';
5
5
  import { CodeEntity } from './entities/code.entity';
6
6
  import { DimensionEntity } from './entities/dimension.entity';
7
- import { PriceEntity } from './entities/price.entity';
8
7
  import { SeoEntity } from './entities/seo.entity';
8
+ import { VariantEntity } from './entities/variant.entity';
9
9
  export declare class ProductEntity extends AbstractEntity {
10
10
  static readonly $index = "inventory_products";
11
11
  name: string;
@@ -15,11 +15,12 @@ export declare class ProductEntity extends AbstractEntity {
15
15
  hashtags: string[];
16
16
  category?: CategoryEntity;
17
17
  brand?: BrandEntity;
18
- files: AssetEntity[];
19
- price: PriceEntity;
18
+ files: FileEntity[];
19
+ price: number;
20
20
  code: CodeEntity;
21
21
  dimension: DimensionEntity;
22
22
  seo: SeoEntity;
23
23
  stock: number;
24
+ variants: VariantEntity[];
24
25
  readonly picture: string;
25
26
  }
@@ -31,7 +31,7 @@ var ProductFixture = (function (_super) {
31
31
  });
32
32
  product.name = this.$faker.vehicle.vehicle();
33
33
  product.description = this.$faker.commerce.productDescription();
34
- product.price.sale = Number(this.$faker.commerce.price(1000, 10000, 2));
34
+ product.price = Number(this.$faker.commerce.price(1000, 10000, 2));
35
35
  return product;
36
36
  };
37
37
  return ProductFixture;
@@ -1,7 +1,6 @@
1
1
  import 'reflect-metadata';
2
2
  import { ProductCodeValidator } from './validators/code.validator';
3
3
  import { ProductDimensionValidator } from './validators/dimension.validator';
4
- import { ProductPriceValidator } from './validators/price.validator';
5
4
  import { ProductSeoValidator } from './validators/seo.validator';
6
5
  import { AbstractValidator } from '../../../abstract/abstract.validator';
7
6
  export declare class CreateProductValidator extends AbstractValidator {
@@ -13,7 +12,7 @@ export declare class CreateProductValidator extends AbstractValidator {
13
12
  brand?: string;
14
13
  files: string[];
15
14
  hashtags: string[];
16
- price: ProductPriceValidator;
15
+ price: number;
17
16
  seo: ProductSeoValidator;
18
17
  dimension: ProductDimensionValidator;
19
18
  code: ProductCodeValidator;
@@ -30,7 +30,6 @@ var class_validator_1 = require("class-validator");
30
30
  require("reflect-metadata");
31
31
  var code_validator_1 = require("./validators/code.validator");
32
32
  var dimension_validator_1 = require("./validators/dimension.validator");
33
- var price_validator_1 = require("./validators/price.validator");
34
33
  var seo_validator_1 = require("./validators/seo.validator");
35
34
  var abstract_validator_1 = require("../../../abstract/abstract.validator");
36
35
  var CreateProductValidator = (function (_super) {
@@ -45,7 +44,6 @@ var CreateProductValidator = (function (_super) {
45
44
  _this.brand = null;
46
45
  _this.files = [];
47
46
  _this.hashtags = [];
48
- _this.price = new price_validator_1.ProductPriceValidator();
49
47
  _this.seo = new seo_validator_1.ProductSeoValidator();
50
48
  _this.dimension = new dimension_validator_1.ProductDimensionValidator();
51
49
  _this.code = new code_validator_1.ProductCodeValidator();
@@ -91,10 +89,8 @@ var CreateProductValidator = (function (_super) {
91
89
  __metadata("design:type", Array)
92
90
  ], CreateProductValidator.prototype, "hashtags", void 0);
93
91
  __decorate([
94
- (0, class_validator_1.ValidateNested)(),
95
- (0, class_validator_1.IsNotEmptyObject)(),
96
- (0, class_transformer_1.Type)(function () { return price_validator_1.ProductPriceValidator; }),
97
- __metadata("design:type", Object)
92
+ (0, class_validator_1.IsNumber)(),
93
+ __metadata("design:type", Number)
98
94
  ], CreateProductValidator.prototype, "price", void 0);
99
95
  __decorate([
100
96
  (0, class_validator_1.ValidateNested)(),
@@ -0,0 +1,27 @@
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose" />
25
+ /// <reference types="mongoose/types/inferschematype" />
26
+ import { VariantEntity } from '../entities/variant.entity';
27
+ export declare const VariantSchema: import("mongoose").Schema<VariantEntity, import("mongoose").Model<VariantEntity, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, VariantEntity>;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VariantSchema = void 0;
4
+ var mongoose_1 = require("@nestjs/mongoose");
5
+ var variant_entity_1 = require("../entities/variant.entity");
6
+ exports.VariantSchema = mongoose_1.SchemaFactory.createForClass(variant_entity_1.VariantEntity);
@@ -0,0 +1,6 @@
1
+ export declare enum PropertyType {
2
+ TEXT = "TEXT",
3
+ COLOR = "COLOR",
4
+ RADIO = "RADIO",
5
+ CHECKBOX = "CHECKBOX"
6
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PropertyType = void 0;
4
+ var PropertyType;
5
+ (function (PropertyType) {
6
+ PropertyType["TEXT"] = "TEXT";
7
+ PropertyType["COLOR"] = "COLOR";
8
+ PropertyType["RADIO"] = "RADIO";
9
+ PropertyType["CHECKBOX"] = "CHECKBOX";
10
+ })(PropertyType = exports.PropertyType || (exports.PropertyType = {}));
@@ -1,11 +1,9 @@
1
1
  import { AbstractValidator } from "../../../abstract/abstract.validator";
2
- export declare enum PropertyType {
3
- STRING = "STRING"
4
- }
2
+ import { PropertyType } from './property.types';
5
3
  export declare class CreatePropertyValidator extends AbstractValidator {
6
4
  name: string;
7
5
  title: string;
8
- type: string;
6
+ type: PropertyType;
9
7
  }
10
8
  export declare class UpdatePropertyValidator extends AbstractValidator {
11
9
  name?: string;
@@ -24,13 +24,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
24
24
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
25
  };
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.UpdatePropertyValidator = exports.CreatePropertyValidator = exports.PropertyType = void 0;
27
+ exports.UpdatePropertyValidator = exports.CreatePropertyValidator = void 0;
28
28
  var class_validator_1 = require("class-validator");
29
29
  var abstract_validator_1 = require("../../../abstract/abstract.validator");
30
- var PropertyType;
31
- (function (PropertyType) {
32
- PropertyType["STRING"] = "STRING";
33
- })(PropertyType = exports.PropertyType || (exports.PropertyType = {}));
30
+ var property_types_1 = require("./property.types");
34
31
  var CreatePropertyValidator = (function (_super) {
35
32
  __extends(CreatePropertyValidator, _super);
36
33
  function CreatePropertyValidator() {
@@ -46,6 +43,7 @@ var CreatePropertyValidator = (function (_super) {
46
43
  ], CreatePropertyValidator.prototype, "title", void 0);
47
44
  __decorate([
48
45
  (0, class_validator_1.IsString)(),
46
+ (0, class_validator_1.IsEnum)(property_types_1.PropertyType),
49
47
  __metadata("design:type", String)
50
48
  ], CreatePropertyValidator.prototype, "type", void 0);
51
49
  return CreatePropertyValidator;
@@ -1,6 +1,6 @@
1
1
  import { AbstractEntity } from '../../../abstract/abstract.entity';
2
2
  export declare class PageEntity<C = Record<string, any>> extends AbstractEntity {
3
- static readonly $index = "content_pages";
3
+ static readonly $index = "layout_pages";
4
4
  name: string;
5
5
  title: string;
6
6
  description: string;
@@ -1,8 +1,8 @@
1
1
  import { User } from 'auth0';
2
2
  import { AbstractEntity } from '../../../abstract/abstract.entity';
3
3
  import { MetaAddress } from '../../../types';
4
- export declare class ClientEntity extends AbstractEntity implements User {
5
- static readonly $index = "store_clients";
4
+ export declare class CustomerEntity extends AbstractEntity implements User {
5
+ static readonly $index = "sale_customers";
6
6
  readonly name: string;
7
7
  readonly email: string;
8
8
  readonly phone?: string;
@@ -1,5 +1,5 @@
1
1
  import { HttpException } from '@nestjs/common';
2
2
  import { AbstractException } from '../../../abstract/abstract.exception';
3
- export declare class ClientException extends AbstractException {
3
+ export declare class CustomerException extends AbstractException {
4
4
  handleError(exception: HttpException): HttpException;
5
5
  }
@@ -21,20 +21,20 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
21
21
  return c > 3 && r && Object.defineProperty(target, key, r), r;
22
22
  };
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.ClientException = void 0;
24
+ exports.CustomerException = void 0;
25
25
  var common_1 = require("@nestjs/common");
26
26
  var abstract_exception_1 = require("../../../abstract/abstract.exception");
27
- var ClientException = (function (_super) {
28
- __extends(ClientException, _super);
29
- function ClientException() {
27
+ var CustomerException = (function (_super) {
28
+ __extends(CustomerException, _super);
29
+ function CustomerException() {
30
30
  return _super !== null && _super.apply(this, arguments) || this;
31
31
  }
32
- ClientException.prototype.handleError = function (exception) {
32
+ CustomerException.prototype.handleError = function (exception) {
33
33
  return exception;
34
34
  };
35
- ClientException = __decorate([
35
+ CustomerException = __decorate([
36
36
  (0, common_1.Catch)()
37
- ], ClientException);
38
- return ClientException;
37
+ ], CustomerException);
38
+ return CustomerException;
39
39
  }(abstract_exception_1.AbstractException));
40
- exports.ClientException = ClientException;
40
+ exports.CustomerException = CustomerException;
@@ -3,14 +3,12 @@ import { BillingEntity } from './billing/billing.entity';
3
3
  import { ItemEntity } from './item/item.entity';
4
4
  import { ShippingEntity } from './shipping/shipping.entity';
5
5
  import { StatusEntity } from './status/status.entity';
6
- import { ClientEntity } from "../clients/client.entity";
7
- import { CustomerEntity } from "./customer/customer.entity";
6
+ import { CustomerEntity } from "../customers/customer.entity";
8
7
  export declare class OrderEntity extends AbstractEntity {
9
- static readonly $index = "store_orders";
8
+ static readonly $index = "sale_orders";
10
9
  number: number;
11
10
  status: StatusEntity[];
12
11
  items: ItemEntity[];
13
- client?: ClientEntity;
14
12
  billing: BillingEntity;
15
13
  shipping: ShippingEntity;
16
14
  customer: CustomerEntity;
@@ -2,18 +2,15 @@ import { CreateBillingValidator } from './billing/billing.validator';
2
2
  import { CreateItemValidator } from './item/item.validator';
3
3
  import { CreateShippingValidator } from './shipping/shipping.validator';
4
4
  import { StatusType } from './status/status.validator';
5
- import { CustomerValidator } from "./customer/customer.validator";
6
5
  import { AbstractValidator } from "../../../abstract/abstract.validator";
7
6
  export declare class CreateOrderValidator extends AbstractValidator {
8
- client?: string;
7
+ customer: string;
9
8
  items: CreateItemValidator[];
10
9
  billing: CreateBillingValidator;
11
10
  shipping: CreateShippingValidator;
12
- customer?: CustomerValidator;
13
11
  notes?: string;
14
12
  }
15
13
  export declare class UpdateOrderValidator extends CreateOrderValidator {
16
- client?: string;
17
14
  }
18
15
  export declare class ChangeOrderStatusValidator extends AbstractValidator {
19
16
  status: StatusType;
@@ -31,7 +31,6 @@ var billing_validator_1 = require("./billing/billing.validator");
31
31
  var item_validator_1 = require("./item/item.validator");
32
32
  var shipping_validator_1 = require("./shipping/shipping.validator");
33
33
  var status_validator_1 = require("./status/status.validator");
34
- var customer_validator_1 = require("./customer/customer.validator");
35
34
  var abstract_validator_1 = require("../../../abstract/abstract.validator");
36
35
  var CreateOrderValidator = (function (_super) {
37
36
  __extends(CreateOrderValidator, _super);
@@ -43,10 +42,9 @@ var CreateOrderValidator = (function (_super) {
43
42
  return _this;
44
43
  }
45
44
  __decorate([
46
- (0, class_validator_1.IsOptional)(),
47
45
  (0, class_validator_1.IsMongoId)(),
48
46
  __metadata("design:type", String)
49
- ], CreateOrderValidator.prototype, "client", void 0);
47
+ ], CreateOrderValidator.prototype, "customer", void 0);
50
48
  __decorate([
51
49
  (0, class_validator_1.ArrayNotEmpty)(),
52
50
  (0, class_validator_1.ValidateNested)({ each: true }),
@@ -65,12 +63,6 @@ var CreateOrderValidator = (function (_super) {
65
63
  (0, class_validator_1.IsNotEmptyObject)(),
66
64
  __metadata("design:type", Object)
67
65
  ], CreateOrderValidator.prototype, "shipping", void 0);
68
- __decorate([
69
- (0, class_validator_1.ValidateNested)(),
70
- (0, class_transformer_1.Type)(function () { return customer_validator_1.CustomerValidator; }),
71
- (0, class_validator_1.IsOptional)(),
72
- __metadata("design:type", customer_validator_1.CustomerValidator)
73
- ], CreateOrderValidator.prototype, "customer", void 0);
74
66
  __decorate([
75
67
  (0, class_validator_1.IsOptional)(),
76
68
  (0, class_validator_1.IsString)(),
@@ -84,11 +76,6 @@ var UpdateOrderValidator = (function (_super) {
84
76
  function UpdateOrderValidator() {
85
77
  return _super !== null && _super.apply(this, arguments) || this;
86
78
  }
87
- __decorate([
88
- (0, class_validator_1.IsOptional)(),
89
- (0, class_validator_1.IsMongoId)(),
90
- __metadata("design:type", String)
91
- ], UpdateOrderValidator.prototype, "client", void 0);
92
79
  return UpdateOrderValidator;
93
80
  }(CreateOrderValidator));
94
81
  exports.UpdateOrderValidator = UpdateOrderValidator;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkaly/api",
3
- "version": "0.2.4",
3
+ "version": "0.2.5-1",
4
4
  "description": "NestJS Backend ApiRest Service",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,10 +0,0 @@
1
- import { AbstractEntity } from '../../abstract/abstract.entity';
2
- export declare class AssetEntity extends AbstractEntity {
3
- static readonly $index = "assets";
4
- name: string;
5
- url: string;
6
- weak: boolean;
7
- description: string;
8
- type: string;
9
- size: number;
10
- }
@@ -1,7 +0,0 @@
1
- import { AbstractEntity } from '../../../abstract/abstract.entity';
2
- export declare class BannerEntity extends AbstractEntity {
3
- static readonly $index = "content_banners";
4
- name: string;
5
- image: string;
6
- href: string;
7
- }
@@ -1,5 +0,0 @@
1
- import { AbstractFixture } from '../../../abstract/abstract.fixture';
2
- import { BannerEntity } from "./banner.entity";
3
- export declare class BannerFixture extends AbstractFixture {
4
- normal(): BannerEntity;
5
- }
@@ -1,39 +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
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.BannerFixture = void 0;
19
- var faker_1 = require("@faker-js/faker");
20
- var abstract_fixture_1 = require("../../../abstract/abstract.fixture");
21
- var banner_entity_1 = require("./banner.entity");
22
- var BannerFixture = (function (_super) {
23
- __extends(BannerFixture, _super);
24
- function BannerFixture() {
25
- return _super !== null && _super.apply(this, arguments) || this;
26
- }
27
- BannerFixture.prototype.normal = function () {
28
- var banner = new banner_entity_1.BannerEntity({
29
- _id: this.$faker.datatype.uuid(),
30
- createdAt: this.$faker.date.past(1),
31
- updatedAt: this.$faker.date.past(1),
32
- });
33
- banner.name = faker_1.faker.random.words(6);
34
- banner.image = faker_1.faker.image.placeholder.imageUrl(850, 400, 'webp');
35
- return banner;
36
- };
37
- return BannerFixture;
38
- }(abstract_fixture_1.AbstractFixture));
39
- exports.BannerFixture = BannerFixture;
@@ -1,8 +0,0 @@
1
- export declare class CreateBannerValidator {
2
- name: string;
3
- image: string;
4
- href: string;
5
- }
6
- export declare class UpdateBannerValidator extends CreateBannerValidator {
7
- image: string;
8
- }
@@ -1,63 +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.UpdateBannerValidator = exports.CreateBannerValidator = void 0;
28
- var class_validator_1 = require("class-validator");
29
- var CreateBannerValidator = (function () {
30
- function CreateBannerValidator() {
31
- this.image = null;
32
- }
33
- __decorate([
34
- (0, class_validator_1.IsString)(),
35
- __metadata("design:type", String)
36
- ], CreateBannerValidator.prototype, "name", void 0);
37
- __decorate([
38
- (0, class_validator_1.IsUrl)(),
39
- __metadata("design:type", String)
40
- ], CreateBannerValidator.prototype, "image", void 0);
41
- __decorate([
42
- (0, class_validator_1.IsUrl)(),
43
- (0, class_validator_1.IsOptional)(),
44
- __metadata("design:type", String)
45
- ], CreateBannerValidator.prototype, "href", void 0);
46
- return CreateBannerValidator;
47
- }());
48
- exports.CreateBannerValidator = CreateBannerValidator;
49
- var UpdateBannerValidator = (function (_super) {
50
- __extends(UpdateBannerValidator, _super);
51
- function UpdateBannerValidator() {
52
- var _this = _super !== null && _super.apply(this, arguments) || this;
53
- _this.image = null;
54
- return _this;
55
- }
56
- __decorate([
57
- (0, class_validator_1.IsUrl)(),
58
- (0, class_validator_1.IsOptional)(),
59
- __metadata("design:type", String)
60
- ], UpdateBannerValidator.prototype, "image", void 0);
61
- return UpdateBannerValidator;
62
- }(CreateBannerValidator));
63
- exports.UpdateBannerValidator = UpdateBannerValidator;
@@ -1,20 +0,0 @@
1
- import { ProductEntity } from '../../inventory/products/product.entity';
2
- import { BrandEntity } from '../../inventory/brands/brand.entity';
3
- import { CategoryEntity } from '../../inventory/categories/category.entity';
4
- export declare enum PageTypes {
5
- PAGE = "PAGE",
6
- POST = "POST"
7
- }
8
- export declare enum PageEvents {
9
- VALIDATE = "database.content.pages.validate",
10
- UPSERT_ES_DOCUMENT = "database.content.pages.upsert-es-document"
11
- }
12
- export interface IndexPageContent {
13
- hero: any[];
14
- banners: any[];
15
- products: ProductEntity[];
16
- categories: CategoryEntity[];
17
- brands: BrandEntity[];
18
- promotions: unknown[];
19
- services: unknown[];
20
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PageEvents = exports.PageTypes = void 0;
4
- var PageTypes;
5
- (function (PageTypes) {
6
- PageTypes["PAGE"] = "PAGE";
7
- PageTypes["POST"] = "POST";
8
- })(PageTypes = exports.PageTypes || (exports.PageTypes = {}));
9
- var PageEvents;
10
- (function (PageEvents) {
11
- PageEvents["VALIDATE"] = "database.content.pages.validate";
12
- PageEvents["UPSERT_ES_DOCUMENT"] = "database.content.pages.upsert-es-document";
13
- })(PageEvents = exports.PageEvents || (exports.PageEvents = {}));
@@ -1,4 +0,0 @@
1
- export declare class PriceEntity extends Map {
2
- sale: number;
3
- purchase: number;
4
- }
@@ -1,4 +0,0 @@
1
- export declare class ProductPriceValidator {
2
- sale: number;
3
- purchase?: number;
4
- }
@@ -1,30 +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.ProductPriceValidator = void 0;
13
- var class_validator_1 = require("class-validator");
14
- var ProductPriceValidator = (function () {
15
- function ProductPriceValidator() {
16
- this.sale = 0;
17
- this.purchase = 0;
18
- }
19
- __decorate([
20
- (0, class_validator_1.IsNumber)(),
21
- __metadata("design:type", Object)
22
- ], ProductPriceValidator.prototype, "sale", void 0);
23
- __decorate([
24
- (0, class_validator_1.IsNumber)(),
25
- (0, class_validator_1.IsOptional)(),
26
- __metadata("design:type", Object)
27
- ], ProductPriceValidator.prototype, "purchase", void 0);
28
- return ProductPriceValidator;
29
- }());
30
- exports.ProductPriceValidator = ProductPriceValidator;
@@ -1,8 +0,0 @@
1
- import { AddOrganizationEnabledConnection, UpdateOrganizationEnabledConnection } from 'auth0';
2
- export declare class CreateConnectionValidator implements AddOrganizationEnabledConnection {
3
- connection_id: AddOrganizationEnabledConnection['connection_id'];
4
- assign_membership_on_login: AddOrganizationEnabledConnection['assign_membership_on_login'];
5
- }
6
- export declare class UpdateConnectionValidator implements UpdateOrganizationEnabledConnection {
7
- assign_membership_on_login: UpdateOrganizationEnabledConnection['assign_membership_on_login'];
8
- }
@@ -1,37 +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.UpdateConnectionValidator = exports.CreateConnectionValidator = void 0;
13
- var class_validator_1 = require("class-validator");
14
- var CreateConnectionValidator = (function () {
15
- function CreateConnectionValidator() {
16
- }
17
- __decorate([
18
- (0, class_validator_1.IsString)(),
19
- __metadata("design:type", Object)
20
- ], CreateConnectionValidator.prototype, "connection_id", void 0);
21
- __decorate([
22
- (0, class_validator_1.IsBoolean)(),
23
- __metadata("design:type", Object)
24
- ], CreateConnectionValidator.prototype, "assign_membership_on_login", void 0);
25
- return CreateConnectionValidator;
26
- }());
27
- exports.CreateConnectionValidator = CreateConnectionValidator;
28
- var UpdateConnectionValidator = (function () {
29
- function UpdateConnectionValidator() {
30
- }
31
- __decorate([
32
- (0, class_validator_1.IsBoolean)(),
33
- __metadata("design:type", Object)
34
- ], UpdateConnectionValidator.prototype, "assign_membership_on_login", void 0);
35
- return UpdateConnectionValidator;
36
- }());
37
- exports.UpdateConnectionValidator = UpdateConnectionValidator;
@@ -1,6 +0,0 @@
1
- import { AbstractEntity } from '../../../abstract/abstract.entity';
2
- export declare class LayoutEntity extends AbstractEntity {
3
- static readonly $index = "settings_layout";
4
- path: string;
5
- content: Map<string, any>;
6
- }
@@ -1,2 +0,0 @@
1
- export declare type AddOrganizationMembers = string[];
2
- export declare type RemoveOrganizationMembers = string[];
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +0,0 @@
1
- import { AbstractEntity } from '../../../abstract/abstract.entity';
2
- export declare class ThemeEntity extends AbstractEntity {
3
- static readonly $index = "settings_theme";
4
- path: string;
5
- content: Map<string, any>;
6
- }