@merkaly/api 0.1.11-4 → 0.1.11-5

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 (53) hide show
  1. package/package.json +1 -1
  2. package/src/account/organizations/organization.validator.d.ts +4 -4
  3. package/src/account/organizations/organization.validator.d.ts.map +1 -1
  4. package/src/account/organizations/organization.validator.ts +4 -4
  5. package/src/app.entity.d.ts.map +1 -1
  6. package/src/app.entity.ts +0 -6
  7. package/src/inventory/brands/brand.entity.d.ts.map +1 -1
  8. package/src/inventory/brands/brand.entity.ts +3 -8
  9. package/src/inventory/categories/category.entity.d.ts +0 -2
  10. package/src/inventory/categories/category.entity.d.ts.map +1 -1
  11. package/src/inventory/categories/category.entity.ts +3 -15
  12. package/src/inventory/media/media.entity.d.ts +6 -0
  13. package/src/inventory/media/media.entity.d.ts.map +1 -0
  14. package/src/inventory/media/media.entity.ts +7 -0
  15. package/src/inventory/{products/media → media}/media.validator.d.ts +0 -0
  16. package/src/inventory/{products/media → media}/media.validator.d.ts.map +0 -0
  17. package/src/inventory/{products/media → media}/media.validator.ts +0 -0
  18. package/src/inventory/products/product.entity.d.ts +4 -4
  19. package/src/inventory/products/product.entity.d.ts.map +1 -1
  20. package/src/inventory/products/product.entity.ts +5 -20
  21. package/src/inventory/products/product.validator.d.ts +1 -1
  22. package/src/inventory/products/product.validator.d.ts.map +1 -1
  23. package/src/inventory/products/product.validator.ts +1 -1
  24. package/src/inventory/properties/property.entity.d.ts +1 -1
  25. package/src/inventory/properties/property.entity.d.ts.map +1 -1
  26. package/src/inventory/properties/property.entity.ts +3 -9
  27. package/src/inventory/variants/variant.entity.d.ts +9 -0
  28. package/src/inventory/variants/variant.entity.d.ts.map +1 -0
  29. package/src/inventory/variants/variant.entity.ts +12 -0
  30. package/src/inventory/{products/variants → variants}/variant.validator.d.ts +0 -1
  31. package/src/inventory/{products/variants → variants}/variant.validator.d.ts.map +1 -1
  32. package/src/inventory/{products/variants → variants}/variant.validator.ts +1 -4
  33. package/src/store/orders/order.entity.d.ts +0 -2
  34. package/src/store/orders/order.entity.d.ts.map +1 -1
  35. package/src/store/orders/order.entity.ts +2 -10
  36. package/src/inventory/products/media/media.entity.d.ts +0 -7
  37. package/src/inventory/products/media/media.entity.d.ts.map +0 -1
  38. package/src/inventory/products/media/media.entity.ts +0 -13
  39. package/src/inventory/products/variants/variant.entity.d.ts +0 -10
  40. package/src/inventory/products/variants/variant.entity.d.ts.map +0 -1
  41. package/src/inventory/products/variants/variant.entity.ts +0 -21
  42. package/src/store/carts/cart.entity.d.ts +0 -17
  43. package/src/store/carts/cart.entity.d.ts.map +0 -1
  44. package/src/store/carts/cart.entity.ts +0 -25
  45. package/src/store/carts/cart.validator.d.ts +0 -7
  46. package/src/store/carts/cart.validator.d.ts.map +0 -1
  47. package/src/store/carts/cart.validator.ts +0 -8
  48. package/src/store/items/item.entity.d.ts +0 -9
  49. package/src/store/items/item.entity.d.ts.map +0 -1
  50. package/src/store/items/item.entity.ts +0 -16
  51. package/src/store/items/item.validator.d.ts +0 -5
  52. package/src/store/items/item.validator.d.ts.map +0 -1
  53. package/src/store/items/item.validator.ts +0 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkaly/api",
3
- "version": "0.1.11-4",
3
+ "version": "0.1.11-5",
4
4
  "description": "NestJS Backend ApiRest Service",
5
5
  "author": "Randy Tellez Galan <kronhyx@gmail.com>",
6
6
  "license": "UNLICENSED",
@@ -5,13 +5,13 @@ export declare class CreateOrganizationValidator {
5
5
  name: Organization['name'];
6
6
  display_name: Organization['display_name'];
7
7
  logo_url?: string;
8
- primary_color?: string;
9
- secondary_color?: string;
8
+ primary_color: string;
9
+ secondary_color: string;
10
10
  }
11
11
  export declare class UpdateOrganizationValidator {
12
12
  display_name?: Organization['display_name'];
13
13
  logo_url?: string;
14
- primary_color?: string;
15
- secondary_color?: string;
14
+ primary_color: string;
15
+ secondary_color: string;
16
16
  }
17
17
  //# sourceMappingURL=organization.validator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"organization.validator.d.ts","sourceRoot":"","sources":["organization.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAGpC,qBAAa,yBAAyB;CAErC;AAED,qBAAa,2BAA2B;IAEtC,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,CAAA;IAG1B,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAI1C,QAAQ,CAAC,EAAE,MAAM,CAAA;IAIjB,aAAa,CAAC,EAAE,MAAM,CAAA;IAItB,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,qBAAa,2BAA2B;IAGtC,YAAY,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAI3C,QAAQ,CAAC,EAAE,MAAM,CAAA;IAIjB,aAAa,CAAC,EAAE,MAAM,CAAA;IAKtB,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB"}
1
+ {"version":3,"file":"organization.validator.d.ts","sourceRoot":"","sources":["organization.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAGpC,qBAAa,yBAAyB;CAErC;AAED,qBAAa,2BAA2B;IAEtC,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,CAAA;IAG1B,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAI1C,QAAQ,CAAC,EAAE,MAAM,CAAA;IAIjB,aAAa,EAAE,MAAM,CAAA;IAIrB,eAAe,EAAE,MAAM,CAAA;CACxB;AAED,qBAAa,2BAA2B;IAGtC,YAAY,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAI3C,QAAQ,CAAC,EAAE,MAAM,CAAA;IAIjB,aAAa,EAAE,MAAM,CAAA;IAKrB,eAAe,EAAE,MAAM,CAAA;CACxB"}
@@ -18,11 +18,11 @@ export class CreateOrganizationValidator {
18
18
 
19
19
  @IsHexColor()
20
20
  @IsOptional()
21
- primary_color?: string
21
+ primary_color: string
22
22
 
23
23
  @IsHexColor()
24
24
  @IsOptional()
25
- secondary_color?: string
25
+ secondary_color: string
26
26
  }
27
27
 
28
28
  export class UpdateOrganizationValidator {
@@ -36,10 +36,10 @@ export class UpdateOrganizationValidator {
36
36
 
37
37
  @IsHexColor()
38
38
  @IsOptional()
39
- primary_color?: string
39
+ primary_color: string
40
40
 
41
41
  @IsString()
42
42
  @IsHexColor()
43
43
  @IsOptional()
44
- secondary_color?: string
44
+ secondary_color: string
45
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"app.entity.d.ts","sourceRoot":"","sources":["app.entity.ts"],"names":[],"mappings":"AAEA,8BAAsB,SAAS;IAEtB,EAAE,EAAE,MAAM,CAAA;IAEjB,SACgB,SAAS,OAAa;IAEtC,SACgB,SAAS,CAAC,EAAE,IAAI,CAAA;IAEhC,SACgB,SAAS,CAAC,EAAE,IAAI,CAAA;CACjC"}
1
+ {"version":3,"file":"app.entity.d.ts","sourceRoot":"","sources":["app.entity.ts"],"names":[],"mappings":"AAAA,8BAAsB,SAAS;IACtB,EAAE,EAAE,MAAM,CAAA;IAEjB,SAAgB,SAAS,OAAa;IAEtC,SAAgB,SAAS,CAAC,EAAE,IAAI,CAAA;IAEhC,SAAgB,SAAS,CAAC,EAAE,IAAI,CAAA;CACjC"}
package/src/app.entity.ts CHANGED
@@ -1,15 +1,9 @@
1
- import { CreateDateColumn, DeleteDateColumn, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
2
-
3
1
  export abstract class AppEntity {
4
- @PrimaryGeneratedColumn()
5
2
  public id: number
6
3
 
7
- @CreateDateColumn()
8
4
  public readonly createdAt = new Date()
9
5
 
10
- @UpdateDateColumn()
11
6
  public readonly updatedAt?: Date
12
7
 
13
- @DeleteDateColumn()
14
8
  public readonly deletedAt?: Date
15
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"brand.entity.d.ts","sourceRoot":"","sources":["brand.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,qBACa,WAAY,SAAQ,SAAS;IAExC,IAAI,EAAE,MAAM,CAAA;IAGZ,WAAW,EAAE,MAAM,CAAA;IAGnB,QAAQ,EAAE,aAAa,EAAE,CAAA;CAC1B"}
1
+ {"version":3,"file":"brand.entity.d.ts","sourceRoot":"","sources":["brand.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,qBAAa,WAAY,SAAQ,SAAS;IACjC,IAAI,EAAE,MAAM,CAAA;IAEZ,WAAW,EAAE,MAAM,CAAA;IAEnB,QAAQ,EAAE,aAAa,EAAE,CAAA;CACjC"}
@@ -1,15 +1,10 @@
1
- import { Column, Entity, OneToMany } from 'typeorm'
2
1
  import { AppEntity } from '../../app.entity'
3
2
  import { ProductEntity } from '../products/product.entity'
4
3
 
5
- @Entity('inventory_brands')
6
4
  export class BrandEntity extends AppEntity {
7
- @Column({ length: 32, unique: true })
8
- name: string
5
+ public name: string
9
6
 
10
- @Column({ type: 'text', nullable: true })
11
- description: string
7
+ public description: string
12
8
 
13
- @OneToMany(() => ProductEntity, product => product.brand)
14
- products: ProductEntity[]
9
+ public products: ProductEntity[]
15
10
  }
@@ -4,8 +4,6 @@ import { PropertyEntity } from '../properties/property.entity';
4
4
  export declare class CategoryEntity extends AppEntity {
5
5
  name: string;
6
6
  description: string;
7
- parent?: CategoryEntity;
8
- children: CategoryEntity[];
9
7
  products: ProductEntity[];
10
8
  properties: PropertyEntity[];
11
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"category.entity.d.ts","sourceRoot":"","sources":["category.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAE9D,qBACa,cAAe,SAAQ,SAAS;IAE3C,IAAI,EAAE,MAAM,CAAA;IAGZ,WAAW,EAAE,MAAM,CAAA;IAGnB,MAAM,CAAC,EAAE,cAAc,CAAA;IAGvB,QAAQ,EAAE,cAAc,EAAE,CAAA;IAG1B,QAAQ,EAAE,aAAa,EAAE,CAAA;IAGlB,UAAU,EAAE,cAAc,EAAE,CAAA;CACpC"}
1
+ {"version":3,"file":"category.entity.d.ts","sourceRoot":"","sources":["category.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAE9D,qBAAa,cAAe,SAAQ,SAAS;IACpC,IAAI,EAAE,MAAM,CAAA;IAEZ,WAAW,EAAE,MAAM,CAAA;IAEnB,QAAQ,EAAE,aAAa,EAAE,CAAA;IAEzB,UAAU,EAAE,cAAc,EAAE,CAAA;CACpC"}
@@ -1,25 +1,13 @@
1
- import { Column, Entity, ManyToOne, OneToMany } from 'typeorm'
2
1
  import { AppEntity } from '../../app.entity'
3
2
  import { ProductEntity } from '../products/product.entity'
4
3
  import { PropertyEntity } from '../properties/property.entity'
5
4
 
6
- @Entity('inventory_categories')
7
5
  export class CategoryEntity extends AppEntity {
8
- @Column({ length: 32, unique: true })
9
- name: string
6
+ public name: string
10
7
 
11
- @Column({ type: 'text', nullable: true })
12
- description: string
8
+ public description: string
13
9
 
14
- @ManyToOne(() => CategoryEntity, c => c.children)
15
- parent?: CategoryEntity
10
+ public products: ProductEntity[]
16
11
 
17
- @OneToMany(() => CategoryEntity, c => c.parent)
18
- children: CategoryEntity[]
19
-
20
- @OneToMany(() => ProductEntity, p => p.category)
21
- products: ProductEntity[]
22
-
23
- @OneToMany(() => PropertyEntity, p => p.category, { eager: true })
24
12
  public properties: PropertyEntity[]
25
13
  }
@@ -0,0 +1,6 @@
1
+ import { AppEntity } from '../../app.entity';
2
+ export declare class MediaEntity extends AppEntity {
3
+ name: string;
4
+ url: string;
5
+ }
6
+ //# sourceMappingURL=media.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.entity.d.ts","sourceRoot":"","sources":["media.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE5C,qBAAa,WAAY,SAAQ,SAAS;IACjC,IAAI,EAAE,MAAM,CAAA;IAEZ,GAAG,EAAE,MAAM,CAAA;CACnB"}
@@ -0,0 +1,7 @@
1
+ import { AppEntity } from '../../app.entity'
2
+
3
+ export class MediaEntity extends AppEntity {
4
+ public name: string
5
+
6
+ public url: string
7
+ }
@@ -2,8 +2,8 @@ import { AppEntity } from '../../app.entity';
2
2
  import { BrandEntity } from '../brands/brand.entity';
3
3
  import { CategoryEntity } from '../categories/category.entity';
4
4
  import { PropertyEntity } from '../properties/property.entity';
5
- import { MediaEntity } from './media/media.entity';
6
- import { VariantEntity } from './variants/variant.entity';
5
+ import { MediaEntity } from '../media/media.entity';
6
+ import { VariantEntity } from '../variants/variant.entity';
7
7
  export declare enum PRODUCT_UNIT {
8
8
  LENGHT = "LENGHT",
9
9
  VOLUME = "VOLUME",
@@ -22,13 +22,13 @@ export declare class ProductEntity extends AppEntity {
22
22
  description?: string;
23
23
  unit: PRODUCT_UNIT;
24
24
  status: PRODUCT_STATUS;
25
- availableFrom?: Date;
25
+ availableFrom: Date;
26
26
  hashtags: string[];
27
27
  category?: CategoryEntity;
28
28
  brand?: BrandEntity;
29
29
  properties: PropertyEntity[];
30
+ variant: VariantEntity;
30
31
  variants: VariantEntity[];
31
32
  media: MediaEntity[];
32
- get masterVariant(): VariantEntity;
33
33
  }
34
34
  //# sourceMappingURL=product.entity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"product.entity.d.ts","sourceRoot":"","sources":["product.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAEzD,oBAAY,YAAY;IACtB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,QAAQ,aAAa;CACtB;AAED,oBAAY,cAAc;IACxB,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,SAAS,cAAc;CACxB;AAED,qBACa,aAAc,SAAQ,SAAS;IAEnC,IAAI,EAAE,MAAM,CAAA;IAGZ,WAAW,CAAC,EAAE,MAAM,CAAA;IAGpB,IAAI,eAAwB;IAG5B,MAAM,iBAAuB;IAG7B,aAAa,CAAC,EAAE,IAAI,CAAA;IAGpB,QAAQ,EAAE,MAAM,EAAE,CAAK;IAGvB,QAAQ,CAAC,EAAE,cAAc,CAAA;IAGzB,KAAK,CAAC,EAAE,WAAW,CAAA;IAGnB,UAAU,EAAE,cAAc,EAAE,CAAA;IAG5B,QAAQ,EAAE,aAAa,EAAE,CAAA;IAGzB,KAAK,EAAE,WAAW,EAAE,CAAA;IAE3B,IAAW,aAAa,kBAEvB;CACF"}
1
+ {"version":3,"file":"product.entity.d.ts","sourceRoot":"","sources":["product.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,oBAAY,YAAY;IACtB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,QAAQ,aAAa;CACtB;AAED,oBAAY,cAAc;IACxB,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,SAAS,cAAc;CACxB;AAED,qBAAa,aAAc,SAAQ,SAAS;IACnC,IAAI,EAAE,MAAM,CAAA;IAEZ,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,IAAI,eAAwB;IAE5B,MAAM,iBAAuB;IAE7B,aAAa,OAAa;IAE1B,QAAQ,EAAE,MAAM,EAAE,CAAK;IAEvB,QAAQ,CAAC,EAAE,cAAc,CAAA;IAEzB,KAAK,CAAC,EAAE,WAAW,CAAA;IAEnB,UAAU,EAAE,cAAc,EAAE,CAAA;IAE5B,OAAO,EAAE,aAAa,CAAA;IAEtB,QAAQ,EAAE,aAAa,EAAE,CAAA;IAEzB,KAAK,EAAE,WAAW,EAAE,CAAA;CAC5B"}
@@ -1,10 +1,9 @@
1
- import { Column, Entity, ManyToOne, OneToMany } from 'typeorm'
2
1
  import { AppEntity } from '../../app.entity'
3
2
  import { BrandEntity } from '../brands/brand.entity'
4
3
  import { CategoryEntity } from '../categories/category.entity'
5
4
  import { PropertyEntity } from '../properties/property.entity'
6
- import { MediaEntity } from './media/media.entity'
7
- import { VariantEntity } from './variants/variant.entity'
5
+ import { MediaEntity } from '../media/media.entity'
6
+ import { VariantEntity } from '../variants/variant.entity'
8
7
 
9
8
  export enum PRODUCT_UNIT {
10
9
  LENGHT = 'LENGHT',
@@ -21,42 +20,28 @@ export enum PRODUCT_STATUS {
21
20
  EXHAUSTED = 'EXHAUSTED',
22
21
  }
23
22
 
24
- @Entity('inventory_products')
25
23
  export class ProductEntity extends AppEntity {
26
- @Column({ length: 64 })
27
24
  public name: string
28
25
 
29
- @Column({ nullable: true, type: 'text' })
30
26
  public description?: string
31
27
 
32
- @Column({ type: 'enum', enum: PRODUCT_UNIT, default: PRODUCT_UNIT.QUANTITY })
33
28
  public unit = PRODUCT_UNIT.QUANTITY
34
29
 
35
- @Column({ type: 'enum', enum: PRODUCT_STATUS, default: PRODUCT_STATUS.DRAFT })
36
30
  public status = PRODUCT_STATUS.DRAFT
37
31
 
38
- @Column({ type: 'date', nullable: true })
39
- public availableFrom?: Date
32
+ public availableFrom = new Date()
40
33
 
41
- @Column('simple-array')
42
34
  public hashtags: string[] = []
43
35
 
44
- @ManyToOne(() => CategoryEntity, c => c.products, { eager: true })
45
36
  public category?: CategoryEntity
46
37
 
47
- @ManyToOne(() => BrandEntity, b => b.products, { eager: true })
48
38
  public brand?: BrandEntity
49
39
 
50
- @OneToMany(() => PropertyEntity, p => p.products, { eager: true })
51
40
  public properties: PropertyEntity[]
52
41
 
53
- @OneToMany(() => VariantEntity, v => v.product, { eager: true })
42
+ public variant: VariantEntity
43
+
54
44
  public variants: VariantEntity[]
55
45
 
56
- @OneToMany(() => MediaEntity, m => m.products, { eager: true })
57
46
  public media: MediaEntity[]
58
-
59
- public get masterVariant () {
60
- return this.variants.find(variant => variant.master)
61
- }
62
47
  }
@@ -1,5 +1,5 @@
1
1
  import { ProductEntity } from './product.entity';
2
- import { CreateVariantValidator } from './variants/variant.validator';
2
+ import { CreateVariantValidator } from '../variants/variant.validator';
3
3
  export declare class FindProductValidator {
4
4
  }
5
5
  export declare class CreateProductValidator {
@@ -1 +1 @@
1
- {"version":3,"file":"product.validator.d.ts","sourceRoot":"","sources":["product.validator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgC,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAErE,qBAAa,oBAAoB;CAEhC;AAED,qBAAa,sBAAsB;IAEjC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAI3B,WAAW,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAA;IAI1C,QAAQ,CAAC,EAAE,MAAM,CAAA;IAIjB,KAAK,CAAC,EAAE,MAAM,CAAA;IAId,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAwB;IAInD,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAK;IAKxC,QAAQ,EAAE,sBAAsB,EAAE,CAAK;CACxC;AAED,qBAAa,sBAAsB;IAGjC,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAI5B,WAAW,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAA;IAI1C,QAAQ,CAAC,EAAE,MAAM,CAAA;IAIjB,KAAK,CAAC,EAAE,MAAM,CAAA;IAId,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAI5B,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;IAIhC,QAAQ,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAA;CACrC"}
1
+ {"version":3,"file":"product.validator.d.ts","sourceRoot":"","sources":["product.validator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgC,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AAEtE,qBAAa,oBAAoB;CAEhC;AAED,qBAAa,sBAAsB;IAEjC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAI3B,WAAW,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAA;IAI1C,QAAQ,CAAC,EAAE,MAAM,CAAA;IAIjB,KAAK,CAAC,EAAE,MAAM,CAAA;IAId,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAwB;IAInD,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAK;IAKxC,QAAQ,EAAE,sBAAsB,EAAE,CAAK;CACxC;AAED,qBAAa,sBAAsB;IAGjC,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAI5B,WAAW,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAA;IAI1C,QAAQ,CAAC,EAAE,MAAM,CAAA;IAIjB,KAAK,CAAC,EAAE,MAAM,CAAA;IAId,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAI5B,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAA;IAIhC,QAAQ,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAA;CACrC"}
@@ -1,7 +1,7 @@
1
1
  import { Type } from 'class-transformer'
2
2
  import { ArrayMinSize, IsEnum, IsOptional, IsPositive, IsString, ValidateNested } from 'class-validator'
3
3
  import { PRODUCT_STATUS, PRODUCT_UNIT, ProductEntity } from './product.entity'
4
- import { CreateVariantValidator } from './variants/variant.validator'
4
+ import { CreateVariantValidator } from '../variants/variant.validator'
5
5
 
6
6
  export class FindProductValidator {
7
7
 
@@ -4,7 +4,7 @@ import { ProductEntity } from '../products/product.entity';
4
4
  export declare class PropertyEntity extends AppEntity {
5
5
  name: string;
6
6
  values: string[];
7
- category?: CategoryEntity;
7
+ category: CategoryEntity;
8
8
  products: ProductEntity[];
9
9
  }
10
10
  //# sourceMappingURL=property.entity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"property.entity.d.ts","sourceRoot":"","sources":["property.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,qBACa,cAAe,SAAQ,SAAS;IAE3C,IAAI,EAAE,MAAM,CAAA;IAGZ,MAAM,EAAE,MAAM,EAAE,CAAA;IAGT,QAAQ,CAAC,EAAE,cAAc,CAAA;IAGzB,QAAQ,EAAE,aAAa,EAAE,CAAA;CAEjC"}
1
+ {"version":3,"file":"property.entity.d.ts","sourceRoot":"","sources":["property.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,qBAAa,cAAe,SAAQ,SAAS;IACpC,IAAI,EAAE,MAAM,CAAA;IAEZ,MAAM,EAAE,MAAM,EAAE,CAAA;IAEhB,QAAQ,EAAE,cAAc,CAAA;IAExB,QAAQ,EAAE,aAAa,EAAE,CAAA;CAEjC"}
@@ -1,20 +1,14 @@
1
- import { Column, Entity, ManyToOne } from 'typeorm'
2
1
  import { AppEntity } from '../../app.entity'
3
2
  import { CategoryEntity } from '../categories/category.entity'
4
3
  import { ProductEntity } from '../products/product.entity'
5
4
 
6
- @Entity('inventory_properties')
7
5
  export class PropertyEntity extends AppEntity {
8
- @Column({ length: 24 })
9
- name: string
6
+ public name: string
10
7
 
11
- @Column('simple-array')
12
- values: string[]
8
+ public values: string[]
13
9
 
14
- @ManyToOne(() => CategoryEntity)
15
- public category?: CategoryEntity
10
+ public category: CategoryEntity
16
11
 
17
- @ManyToOne(() => ProductEntity, p => p.properties)
18
12
  public products: ProductEntity[]
19
13
 
20
14
  }
@@ -0,0 +1,9 @@
1
+ import { AppEntity } from '../../app.entity';
2
+ import { ProductEntity } from '../products/product.entity';
3
+ export declare class VariantEntity extends AppEntity {
4
+ price: number;
5
+ sku: string;
6
+ quantity: number;
7
+ product: ProductEntity;
8
+ }
9
+ //# sourceMappingURL=variant.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"variant.entity.d.ts","sourceRoot":"","sources":["variant.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,qBAAa,aAAc,SAAQ,SAAS;IACnC,KAAK,SAAI;IAET,GAAG,EAAE,MAAM,CAAA;IAEX,QAAQ,SAAI;IAEZ,OAAO,EAAE,aAAa,CAAA;CAC9B"}
@@ -0,0 +1,12 @@
1
+ import { AppEntity } from '../../app.entity'
2
+ import { ProductEntity } from '../products/product.entity'
3
+
4
+ export class VariantEntity extends AppEntity {
5
+ public price = 0
6
+
7
+ public sku: string
8
+
9
+ public quantity = 1
10
+
11
+ public product: ProductEntity
12
+ }
@@ -3,7 +3,6 @@ export declare class CreateVariantValidator {
3
3
  price: VariantEntity['price'];
4
4
  sku: VariantEntity['sku'];
5
5
  quantity: VariantEntity['quantity'];
6
- master: VariantEntity['master'];
7
6
  }
8
7
  export declare class UpdateVariantValidator {
9
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"variant.validator.d.ts","sourceRoot":"","sources":["variant.validator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,qBAAa,sBAAsB;IAE1B,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IAG7B,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,CAAA;IAIzB,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAI;IAGvC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAQ;CAC/C;AAED,qBAAa,sBAAsB;CAElC"}
1
+ {"version":3,"file":"variant.validator.d.ts","sourceRoot":"","sources":["variant.validator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,qBAAa,sBAAsB;IAE1B,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,CAAA;IAG7B,GAAG,EAAE,aAAa,CAAC,KAAK,CAAC,CAAA;IAIzB,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAI;CAC/C;AAED,qBAAa,sBAAsB;CAElC"}
@@ -1,4 +1,4 @@
1
- import { Allow, IsBoolean, IsOptional, IsPositive } from 'class-validator'
1
+ import { Allow, IsOptional, IsPositive } from 'class-validator'
2
2
  import { VariantEntity } from './variant.entity'
3
3
 
4
4
  export class CreateVariantValidator {
@@ -11,9 +11,6 @@ export class CreateVariantValidator {
11
11
  @IsPositive()
12
12
  @IsOptional()
13
13
  public quantity: VariantEntity['quantity'] = 1
14
-
15
- @IsBoolean()
16
- public master: VariantEntity['master'] = false
17
14
  }
18
15
 
19
16
  export class UpdateVariantValidator {
@@ -1,8 +1,6 @@
1
1
  import { AppEntity } from '../../app.entity';
2
- import { CartEntity } from '../carts/cart.entity';
3
2
  export declare class OrderEntity extends AppEntity {
4
3
  number: string;
5
4
  price: number;
6
- cart: CartEntity;
7
5
  }
8
6
  //# sourceMappingURL=order.entity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"order.entity.d.ts","sourceRoot":"","sources":["order.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,qBACa,WAAY,SAAQ,SAAS;IAExC,MAAM,EAAE,MAAM,CAAA;IAGd,KAAK,EAAE,MAAM,CAAA;IAGb,IAAI,EAAE,UAAU,CAAA;CACjB"}
1
+ {"version":3,"file":"order.entity.d.ts","sourceRoot":"","sources":["order.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE5C,qBAAa,WAAY,SAAQ,SAAS;IACjC,MAAM,EAAE,MAAM,CAAA;IAEd,KAAK,EAAE,MAAM,CAAA;CACrB"}
@@ -1,15 +1,7 @@
1
- import { Column, Entity, OneToOne } from 'typeorm'
2
1
  import { AppEntity } from '../../app.entity'
3
- import { CartEntity } from '../carts/cart.entity'
4
2
 
5
- @Entity('store_orders')
6
3
  export class OrderEntity extends AppEntity {
7
- @Column()
8
- number: string
4
+ public number: string
9
5
 
10
- @Column({ type: 'float' })
11
- price: number
12
-
13
- @OneToOne(() => CartEntity, c => c.order, { eager: true })
14
- cart: CartEntity
6
+ public price: number
15
7
  }
@@ -1,7 +0,0 @@
1
- import { AppEntity } from '../../../app.entity';
2
- import { ProductEntity } from '../product.entity';
3
- export declare class MediaEntity extends AppEntity {
4
- name: string;
5
- products: ProductEntity;
6
- }
7
- //# sourceMappingURL=media.entity.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"media.entity.d.ts","sourceRoot":"","sources":["media.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,qBACa,WAAY,SAAQ,SAAS;IAGxC,IAAI,EAAE,MAAM,CAAA;IAGL,QAAQ,EAAE,aAAa,CAAA;CAC/B"}
@@ -1,13 +0,0 @@
1
- import { Column, Entity, ManyToOne } from 'typeorm'
2
- import { AppEntity } from '../../../app.entity'
3
- import { ProductEntity } from '../product.entity'
4
-
5
- @Entity('inventory_products_media')
6
- export class MediaEntity extends AppEntity {
7
-
8
- @Column({})
9
- name: string
10
-
11
- @ManyToOne(() => ProductEntity, (p) => p.media)
12
- public products: ProductEntity
13
- }
@@ -1,10 +0,0 @@
1
- import { AppEntity } from '../../../app.entity';
2
- import { ProductEntity } from '../product.entity';
3
- export declare class VariantEntity extends AppEntity {
4
- price: number;
5
- sku: string;
6
- quantity: number;
7
- master: boolean;
8
- product: ProductEntity;
9
- }
10
- //# sourceMappingURL=variant.entity.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"variant.entity.d.ts","sourceRoot":"","sources":["variant.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,qBACa,aAAc,SAAQ,SAAS;IAEnC,KAAK,SAAI;IAGT,GAAG,EAAE,MAAM,CAAA;IAGX,QAAQ,SAAI;IAGZ,MAAM,UAAQ;IAGd,OAAO,EAAE,aAAa,CAAA;CAC9B"}
@@ -1,21 +0,0 @@
1
- import { Column, Entity, ManyToOne } from 'typeorm'
2
- import { AppEntity } from '../../../app.entity'
3
- import { ProductEntity } from '../product.entity'
4
-
5
- @Entity('inventory_products_variants')
6
- export class VariantEntity extends AppEntity {
7
- @Column({ type: 'float', default: 0 })
8
- public price = 0
9
-
10
- @Column({ unique: true })
11
- public sku: string
12
-
13
- @Column({ type: 'int', default: 1 })
14
- public quantity = 1
15
-
16
- @Column({ type: 'boolean', default: false })
17
- public master = false
18
-
19
- @ManyToOne(() => ProductEntity, (p) => p.variants)
20
- public product: ProductEntity
21
- }
@@ -1,17 +0,0 @@
1
- import { AppEntity } from '../../app.entity';
2
- import { ItemEntity } from '../items/item.entity';
3
- import { OrderEntity } from '../orders/order.entity';
4
- export declare enum CART_STATUS {
5
- EMPTY = "EMPTY",
6
- SAVED = "SAVED",
7
- ACTIVE = "ACTIVE",
8
- DELETED = "DELETED",
9
- ABANDONED = "ABANDONED",
10
- FINALIZED = "FINALIZED"
11
- }
12
- export declare class CartEntity extends AppEntity {
13
- status: CART_STATUS;
14
- items: ItemEntity[];
15
- order: OrderEntity[];
16
- }
17
- //# sourceMappingURL=cart.entity.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cart.entity.d.ts","sourceRoot":"","sources":["cart.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEpD,oBAAY,WAAW;IACrB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,SAAS,cAAc;CACxB;AAED,qBACa,UAAW,SAAQ,SAAS;IAEhC,MAAM,EAAE,WAAW,CAAoB;IAGvC,KAAK,EAAE,UAAU,EAAE,CAAA;IAGnB,KAAK,EAAE,WAAW,EAAE,CAAA;CAC5B"}
@@ -1,25 +0,0 @@
1
- import { Column, Entity, OneToMany, OneToOne } from 'typeorm'
2
- import { AppEntity } from '../../app.entity'
3
- import { ItemEntity } from '../items/item.entity'
4
- import { OrderEntity } from '../orders/order.entity'
5
-
6
- export enum CART_STATUS {
7
- EMPTY = 'EMPTY',
8
- SAVED = 'SAVED',
9
- ACTIVE = 'ACTIVE',
10
- DELETED = 'DELETED',
11
- ABANDONED = 'ABANDONED',
12
- FINALIZED = 'FINALIZED'
13
- }
14
-
15
- @Entity('store_carts')
16
- export class CartEntity extends AppEntity {
17
- @Column({ type: 'enum', enum: CART_STATUS, default: CART_STATUS.EMPTY })
18
- public status: CART_STATUS = CART_STATUS.EMPTY
19
-
20
- @OneToMany(() => ItemEntity, i => i.cart, { eager: true })
21
- public items: ItemEntity[]
22
-
23
- @OneToOne(() => OrderEntity, o => o.cart)
24
- public order: OrderEntity[]
25
- }
@@ -1,7 +0,0 @@
1
- export declare class FindCartValidator {
2
- }
3
- export declare class CreateCartValidator {
4
- }
5
- export declare class UpdateCartValidator {
6
- }
7
- //# sourceMappingURL=cart.validator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cart.validator.d.ts","sourceRoot":"","sources":["cart.validator.ts"],"names":[],"mappings":"AAAA,qBAAa,iBAAiB;CAC7B;AAED,qBAAa,mBAAmB;CAC/B;AAED,qBAAa,mBAAmB;CAC/B"}
@@ -1,8 +0,0 @@
1
- export class FindCartValidator {
2
- }
3
-
4
- export class CreateCartValidator {
5
- }
6
-
7
- export class UpdateCartValidator {
8
- }
@@ -1,9 +0,0 @@
1
- import { AppEntity } from '../../app.entity';
2
- import { VariantEntity } from '../../inventory/products/variants/variant.entity';
3
- import { CartEntity } from '../carts/cart.entity';
4
- export declare class ItemEntity extends AppEntity {
5
- quantity: number;
6
- variant: VariantEntity;
7
- cart: CartEntity[];
8
- }
9
- //# sourceMappingURL=item.entity.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"item.entity.d.ts","sourceRoot":"","sources":["item.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAA;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,qBACa,UAAW,SAAQ,SAAS;IAEhC,QAAQ,EAAE,MAAM,CAAA;IAGhB,OAAO,EAAE,aAAa,CAAA;IAGtB,IAAI,EAAE,UAAU,EAAE,CAAA;CAC1B"}
@@ -1,16 +0,0 @@
1
- import { Column, Entity, ManyToOne } from 'typeorm'
2
- import { AppEntity } from '../../app.entity'
3
- import { VariantEntity } from '../../inventory/products/variants/variant.entity'
4
- import { CartEntity } from '../carts/cart.entity'
5
-
6
- @Entity('store_items')
7
- export class ItemEntity extends AppEntity {
8
- @Column({ type: 'float', default: 1 })
9
- public quantity: number
10
-
11
- @ManyToOne(() => VariantEntity, { eager: true })
12
- public variant: VariantEntity
13
-
14
- @ManyToOne(() => CartEntity, c => c.items)
15
- public cart: CartEntity[]
16
- }
@@ -1,5 +0,0 @@
1
- export declare class CreateItemValidator {
2
- }
3
- export declare class UpdateItemValidator {
4
- }
5
- //# sourceMappingURL=item.validator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"item.validator.d.ts","sourceRoot":"","sources":["item.validator.ts"],"names":[],"mappings":"AAAA,qBAAa,mBAAmB;CAE/B;AAED,qBAAa,mBAAmB;CAE/B"}
@@ -1,7 +0,0 @@
1
- export class CreateItemValidator {
2
-
3
- }
4
-
5
- export class UpdateItemValidator {
6
-
7
- }