@merkaly/api 0.1.11-4 → 0.1.11

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 (104) hide show
  1. package/{src → config}/app.entity.d.ts +0 -0
  2. package/config/app.entity.d.ts.map +1 -0
  3. package/config/app.entity.ts +9 -0
  4. package/index.d.ts +3 -0
  5. package/index.d.ts.map +1 -0
  6. package/index.ts +3 -0
  7. package/package.json +5 -4
  8. package/src/account/connections/connection.validator.d.ts +1 -0
  9. package/src/account/connections/connection.validator.d.ts.map +1 -1
  10. package/src/account/connections/connection.validator.ts +1 -0
  11. package/src/account/organizations/connections/connection.validator.d.ts +1 -0
  12. package/src/account/organizations/connections/connection.validator.d.ts.map +1 -1
  13. package/src/account/organizations/connections/connection.validator.ts +1 -0
  14. package/src/account/organizations/members/member.validator.d.ts +1 -0
  15. package/src/account/organizations/members/member.validator.d.ts.map +1 -1
  16. package/src/account/organizations/members/member.validator.ts +2 -0
  17. package/src/account/organizations/organization.validator.d.ts +5 -4
  18. package/src/account/organizations/organization.validator.d.ts.map +1 -1
  19. package/src/account/organizations/organization.validator.ts +5 -4
  20. package/src/account/roles/role.validator.d.ts +1 -0
  21. package/src/account/roles/role.validator.d.ts.map +1 -1
  22. package/src/account/roles/role.validator.ts +1 -0
  23. package/src/account/roles/users/user.validator.d.ts +1 -0
  24. package/src/account/roles/users/user.validator.d.ts.map +1 -1
  25. package/src/account/roles/users/user.validator.ts +2 -0
  26. package/src/account/users/extra/extra.validator.d.ts +1 -0
  27. package/src/account/users/extra/extra.validator.d.ts.map +1 -1
  28. package/src/account/users/extra/extra.validator.ts +1 -0
  29. package/src/account/users/roles/role.validator.d.ts +1 -0
  30. package/src/account/users/roles/role.validator.d.ts.map +1 -1
  31. package/src/account/users/roles/role.validator.ts +2 -0
  32. package/src/account/users/user.validator.d.ts +1 -0
  33. package/src/account/users/user.validator.d.ts.map +1 -1
  34. package/src/account/users/user.validator.ts +1 -0
  35. package/src/auth/auth.validator.d.ts +1 -0
  36. package/src/auth/auth.validator.d.ts.map +1 -1
  37. package/src/auth/auth.validator.ts +1 -0
  38. package/src/inventory/brands/brand.entity.d.ts +1 -1
  39. package/src/inventory/brands/brand.entity.d.ts.map +1 -1
  40. package/src/inventory/brands/brand.entity.ts +4 -9
  41. package/src/inventory/brands/brand.validator.d.ts +1 -0
  42. package/src/inventory/brands/brand.validator.d.ts.map +1 -1
  43. package/src/inventory/brands/brand.validator.ts +1 -0
  44. package/src/inventory/categories/category.entity.d.ts +1 -3
  45. package/src/inventory/categories/category.entity.d.ts.map +1 -1
  46. package/src/inventory/categories/category.entity.ts +4 -16
  47. package/src/inventory/categories/category.validator.d.ts +1 -0
  48. package/src/inventory/categories/category.validator.d.ts.map +1 -1
  49. package/src/inventory/categories/category.validator.ts +1 -0
  50. package/src/inventory/media/media.entity.d.ts +6 -0
  51. package/src/inventory/media/media.entity.d.ts.map +1 -0
  52. package/src/inventory/media/media.entity.ts +7 -0
  53. package/src/inventory/{products/media → media}/media.validator.d.ts +1 -0
  54. package/src/inventory/media/media.validator.d.ts.map +1 -0
  55. package/src/inventory/{products/media → media}/media.validator.ts +2 -0
  56. package/src/inventory/products/product.entity.d.ts +8 -20
  57. package/src/inventory/products/product.entity.d.ts.map +1 -1
  58. package/src/inventory/products/product.entity.ts +13 -37
  59. package/src/inventory/products/product.validator.d.ts +5 -4
  60. package/src/inventory/products/product.validator.d.ts.map +1 -1
  61. package/src/inventory/products/product.validator.ts +17 -16
  62. package/src/inventory/properties/property.entity.d.ts +2 -2
  63. package/src/inventory/properties/property.entity.d.ts.map +1 -1
  64. package/src/inventory/properties/property.entity.ts +4 -10
  65. package/src/inventory/properties/property.validator.d.ts +1 -0
  66. package/src/inventory/properties/property.validator.d.ts.map +1 -1
  67. package/src/inventory/properties/property.validator.ts +1 -0
  68. package/src/inventory/variants/variant.entity.d.ts +12 -0
  69. package/src/inventory/variants/variant.entity.d.ts.map +1 -0
  70. package/src/inventory/variants/variant.entity.ts +22 -0
  71. package/src/inventory/{products/variants → variants}/variant.validator.d.ts +2 -1
  72. package/src/inventory/variants/variant.validator.d.ts.map +1 -0
  73. package/src/inventory/{products/variants → variants}/variant.validator.ts +3 -1
  74. package/src/store/orders/order.entity.d.ts +1 -3
  75. package/src/store/orders/order.entity.d.ts.map +1 -1
  76. package/src/store/orders/order.entity.ts +3 -11
  77. package/src/store/orders/order.validator.d.ts +1 -0
  78. package/src/store/orders/order.validator.d.ts.map +1 -1
  79. package/src/store/orders/order.validator.ts +3 -0
  80. package/src/app.entity.d.ts.map +0 -1
  81. package/src/app.entity.ts +0 -15
  82. package/src/index.d.ts +0 -3
  83. package/src/index.d.ts.map +0 -1
  84. package/src/index.ts +0 -3
  85. package/src/inventory/products/media/media.entity.d.ts +0 -7
  86. package/src/inventory/products/media/media.entity.d.ts.map +0 -1
  87. package/src/inventory/products/media/media.entity.ts +0 -13
  88. package/src/inventory/products/media/media.validator.d.ts.map +0 -1
  89. package/src/inventory/products/variants/variant.entity.d.ts +0 -10
  90. package/src/inventory/products/variants/variant.entity.d.ts.map +0 -1
  91. package/src/inventory/products/variants/variant.entity.ts +0 -21
  92. package/src/inventory/products/variants/variant.validator.d.ts.map +0 -1
  93. package/src/store/carts/cart.entity.d.ts +0 -17
  94. package/src/store/carts/cart.entity.d.ts.map +0 -1
  95. package/src/store/carts/cart.entity.ts +0 -25
  96. package/src/store/carts/cart.validator.d.ts +0 -7
  97. package/src/store/carts/cart.validator.d.ts.map +0 -1
  98. package/src/store/carts/cart.validator.ts +0 -8
  99. package/src/store/items/item.entity.d.ts +0 -9
  100. package/src/store/items/item.entity.d.ts.map +0 -1
  101. package/src/store/items/item.entity.ts +0 -16
  102. package/src/store/items/item.validator.d.ts +0 -5
  103. package/src/store/items/item.validator.d.ts.map +0 -1
  104. package/src/store/items/item.validator.ts +0 -7
File without changes
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,9 @@
1
+ export abstract class AppEntity {
2
+ public id: number
3
+
4
+ public readonly createdAt = new Date()
5
+
6
+ public readonly updatedAt?: Date
7
+
8
+ public readonly deletedAt?: Date
9
+ }
package/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import * as account from '@/src/account';
2
+ export import Account = account;
3
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AAExC,MAAM,QAAQ,OAAO,GAAG,OAAO,CAAA"}
package/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ import * as account from '@/src/account'
2
+
3
+ export import Account = account
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",
4
4
  "description": "NestJS Backend ApiRest Service",
5
5
  "author": "Randy Tellez Galan <kronhyx@gmail.com>",
6
6
  "license": "UNLICENSED",
@@ -36,9 +36,9 @@
36
36
  "@elastic/elasticsearch": "^8.0.0",
37
37
  "@nestjs/axios": "^0.0.7",
38
38
  "@nestjs/cli": "8.2.2",
39
- "@nestjs/common": "8.4.0",
39
+ "@nestjs/common": "8.4.1",
40
40
  "@nestjs/config": "^1.0.0",
41
- "@nestjs/core": "8.4.0",
41
+ "@nestjs/core": "8.4.1",
42
42
  "@nestjs/elasticsearch": "8.1.0",
43
43
  "@nestjs/event-emitter": "^1.0.0",
44
44
  "@nestjs/jwt": "8.0.0",
@@ -46,7 +46,7 @@
46
46
  "@nestjs/platform-express": "8.4.0",
47
47
  "@nestjs/schematics": "8.0.8",
48
48
  "@nestjs/swagger": "^5.0.9",
49
- "@nestjs/testing": "8.4.0",
49
+ "@nestjs/testing": "8.4.1",
50
50
  "@nestjs/typeorm": "^8.0.3",
51
51
  "@semantic-release/exec": "^6.0.1",
52
52
  "@semantic-release/git": "^10.0.0",
@@ -78,6 +78,7 @@
78
78
  "ts-loader": "^9.2.3",
79
79
  "ts-node": "^10.0.0",
80
80
  "tsconfig-paths": "^3.9.0",
81
+ "typeorm-naming-strategies": "^4.0.0",
81
82
  "typescript": "^4.6.2",
82
83
  "webpack": "^5"
83
84
  },
@@ -1,4 +1,5 @@
1
1
  import { CreateConnection, UpdateConnection } from 'auth0';
2
+ import 'reflect-metadata';
2
3
  export declare class CreateConnectionValidator implements CreateConnection {
3
4
  name: CreateConnection['name'];
4
5
  strategy: CreateConnection['strategy'];
@@ -1 +1 @@
1
- {"version":3,"file":"connection.validator.d.ts","sourceRoot":"","sources":["connection.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAG1D,qBAAa,yBAA0B,YAAW,gBAAgB;IAEzD,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAG9B,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAA;CAC9C;AAED,qBAAa,yBAA0B,YAAW,gBAAgB;CAEjE"}
1
+ {"version":3,"file":"connection.validator.d.ts","sourceRoot":"","sources":["connection.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAE1D,OAAO,kBAAkB,CAAA;AAEzB,qBAAa,yBAA0B,YAAW,gBAAgB;IAEzD,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAA;IAG9B,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAA;CAC9C;AAED,qBAAa,yBAA0B,YAAW,gBAAgB;CAEjE"}
@@ -1,5 +1,6 @@
1
1
  import { CreateConnection, UpdateConnection } from 'auth0'
2
2
  import { IsString } from 'class-validator'
3
+ import 'reflect-metadata'
3
4
 
4
5
  export class CreateConnectionValidator implements CreateConnection {
5
6
  @IsString()
@@ -1,4 +1,5 @@
1
1
  import { AddOrganizationEnabledConnection, UpdateOrganizationEnabledConnection } from 'auth0';
2
+ import 'reflect-metadata';
2
3
  export declare class CreateConnectionValidator implements AddOrganizationEnabledConnection {
3
4
  connection_id: AddOrganizationEnabledConnection['connection_id'];
4
5
  assign_membership_on_login: AddOrganizationEnabledConnection['assign_membership_on_login'];
@@ -1 +1 @@
1
- {"version":3,"file":"connection.validator.d.ts","sourceRoot":"","sources":["connection.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,mCAAmC,EAAE,MAAM,OAAO,CAAA;AAG7F,qBAAa,yBAA0B,YAAW,gCAAgC;IAEhF,aAAa,EAAE,gCAAgC,CAAC,eAAe,CAAC,CAAA;IAGhE,0BAA0B,EAAE,gCAAgC,CAAC,4BAA4B,CAAC,CAAA;CAC3F;AAED,qBAAa,yBAA0B,YAAW,mCAAmC;IAEnF,0BAA0B,EAAE,mCAAmC,CAAC,4BAA4B,CAAC,CAAA;CAC9F"}
1
+ {"version":3,"file":"connection.validator.d.ts","sourceRoot":"","sources":["connection.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,mCAAmC,EAAE,MAAM,OAAO,CAAA;AAE7F,OAAO,kBAAkB,CAAA;AAEzB,qBAAa,yBAA0B,YAAW,gCAAgC;IAEhF,aAAa,EAAE,gCAAgC,CAAC,eAAe,CAAC,CAAA;IAGhE,0BAA0B,EAAE,gCAAgC,CAAC,4BAA4B,CAAC,CAAA;CAC3F;AAED,qBAAa,yBAA0B,YAAW,mCAAmC;IAEnF,0BAA0B,EAAE,mCAAmC,CAAC,4BAA4B,CAAC,CAAA;CAC9F"}
@@ -1,5 +1,6 @@
1
1
  import { AddOrganizationEnabledConnection, UpdateOrganizationEnabledConnection } from 'auth0'
2
2
  import { IsBoolean, IsString } from 'class-validator'
3
+ import 'reflect-metadata'
3
4
 
4
5
  export class CreateConnectionValidator implements AddOrganizationEnabledConnection {
5
6
  @IsString()
@@ -1,3 +1,4 @@
1
+ import 'reflect-metadata';
1
2
  export declare type AddOrganizationMembers = string[];
2
3
  export declare type RemoveOrganizationMembers = string[];
3
4
  //# sourceMappingURL=member.validator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"member.validator.d.ts","sourceRoot":"","sources":["member.validator.ts"],"names":[],"mappings":"AAAA,oBAAY,sBAAsB,GAAG,MAAM,EAAE,CAAA;AAE7C,oBAAY,yBAAyB,GAAG,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"member.validator.d.ts","sourceRoot":"","sources":["member.validator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA;AAEzB,oBAAY,sBAAsB,GAAG,MAAM,EAAE,CAAA;AAE7C,oBAAY,yBAAyB,GAAG,MAAM,EAAE,CAAA"}
@@ -1,3 +1,5 @@
1
+ import 'reflect-metadata'
2
+
1
3
  export type AddOrganizationMembers = string[]
2
4
 
3
5
  export type RemoveOrganizationMembers = string[]
@@ -1,17 +1,18 @@
1
1
  import { Organization } from 'auth0';
2
+ import 'reflect-metadata';
2
3
  export declare class FindOrganizationValidator {
3
4
  }
4
5
  export declare class CreateOrganizationValidator {
5
6
  name: Organization['name'];
6
7
  display_name: Organization['display_name'];
7
8
  logo_url?: string;
8
- primary_color?: string;
9
- secondary_color?: string;
9
+ primary_color: string;
10
+ secondary_color: string;
10
11
  }
11
12
  export declare class UpdateOrganizationValidator {
12
13
  display_name?: Organization['display_name'];
13
14
  logo_url?: string;
14
- primary_color?: string;
15
- secondary_color?: string;
15
+ primary_color: string;
16
+ secondary_color: string;
16
17
  }
17
18
  //# 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;AAEpC,OAAO,kBAAkB,CAAA;AAEzB,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"}
@@ -1,5 +1,6 @@
1
1
  import { Organization } from 'auth0'
2
2
  import { IsHexColor, IsOptional, IsString, IsUrl } from 'class-validator'
3
+ import 'reflect-metadata'
3
4
 
4
5
  export class FindOrganizationValidator {
5
6
 
@@ -18,11 +19,11 @@ export class CreateOrganizationValidator {
18
19
 
19
20
  @IsHexColor()
20
21
  @IsOptional()
21
- primary_color?: string
22
+ primary_color: string
22
23
 
23
24
  @IsHexColor()
24
25
  @IsOptional()
25
- secondary_color?: string
26
+ secondary_color: string
26
27
  }
27
28
 
28
29
  export class UpdateOrganizationValidator {
@@ -36,10 +37,10 @@ export class UpdateOrganizationValidator {
36
37
 
37
38
  @IsHexColor()
38
39
  @IsOptional()
39
- primary_color?: string
40
+ primary_color: string
40
41
 
41
42
  @IsString()
42
43
  @IsHexColor()
43
44
  @IsOptional()
44
- secondary_color?: string
45
+ secondary_color: string
45
46
  }
@@ -1,4 +1,5 @@
1
1
  import { CreateRoleData, UpdateRoleData } from 'auth0';
2
+ import 'reflect-metadata';
2
3
  export declare class FindRoleValidator {
3
4
  }
4
5
  export declare class CreateRoleValidator implements CreateRoleData {
@@ -1 +1 @@
1
- {"version":3,"file":"role.validator.d.ts","sourceRoot":"","sources":["role.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAGtD,qBAAa,iBAAiB;CAE7B;AAED,qBAAa,mBAAoB,YAAW,cAAc;IAExD,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAI5B,WAAW,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;CAC3C;AAED,qBAAa,mBAAoB,YAAW,cAAc;IAGxD,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAI5B,WAAW,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;CAC3C"}
1
+ {"version":3,"file":"role.validator.d.ts","sourceRoot":"","sources":["role.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAEtD,OAAO,kBAAkB,CAAA;AAEzB,qBAAa,iBAAiB;CAE7B;AAED,qBAAa,mBAAoB,YAAW,cAAc;IAExD,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAI5B,WAAW,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;CAC3C;AAED,qBAAa,mBAAoB,YAAW,cAAc;IAGxD,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAI5B,WAAW,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;CAC3C"}
@@ -1,5 +1,6 @@
1
1
  import { CreateRoleData, UpdateRoleData } from 'auth0'
2
2
  import { IsOptional, IsString } from 'class-validator'
3
+ import 'reflect-metadata'
3
4
 
4
5
  export class FindRoleValidator {
5
6
 
@@ -1,3 +1,4 @@
1
+ import 'reflect-metadata';
1
2
  export declare type AddRoleUsers = string[];
2
3
  export declare type RemoveRoleUsers = string[];
3
4
  //# sourceMappingURL=user.validator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"user.validator.d.ts","sourceRoot":"","sources":["user.validator.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY,GAAG,MAAM,EAAE,CAAA;AAEnC,oBAAY,eAAe,GAAG,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"user.validator.d.ts","sourceRoot":"","sources":["user.validator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA;AAEzB,oBAAY,YAAY,GAAG,MAAM,EAAE,CAAA;AAEnC,oBAAY,eAAe,GAAG,MAAM,EAAE,CAAA"}
@@ -1,3 +1,5 @@
1
+ import 'reflect-metadata'
2
+
1
3
  export type AddRoleUsers = string[]
2
4
 
3
5
  export type RemoveRoleUsers = string[]
@@ -1 +1,2 @@
1
+ import 'reflect-metadata';
1
2
  //# sourceMappingURL=extra.validator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extra.validator.d.ts","sourceRoot":"","sources":["extra.validator.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"extra.validator.d.ts","sourceRoot":"","sources":["extra.validator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA"}
@@ -0,0 +1 @@
1
+ import 'reflect-metadata'
@@ -1,3 +1,4 @@
1
+ import 'reflect-metadata';
1
2
  export declare type AddUserRole = string[];
2
3
  export declare type RemoveUserRole = string[];
3
4
  //# sourceMappingURL=role.validator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"role.validator.d.ts","sourceRoot":"","sources":["role.validator.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW,GAAG,MAAM,EAAE,CAAA;AAElC,oBAAY,cAAc,GAAG,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"role.validator.d.ts","sourceRoot":"","sources":["role.validator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA;AAEzB,oBAAY,WAAW,GAAG,MAAM,EAAE,CAAA;AAElC,oBAAY,cAAc,GAAG,MAAM,EAAE,CAAA"}
@@ -1,3 +1,5 @@
1
+ import 'reflect-metadata'
2
+
1
3
  export type AddUserRole = string[]
2
4
 
3
5
  export type RemoveUserRole = string[]
@@ -1,4 +1,5 @@
1
1
  import { CreateUserData, UpdateUserData } from 'auth0';
2
+ import 'reflect-metadata';
2
3
  export declare class FindUserValidator {
3
4
  }
4
5
  export declare class CreateUserValidator implements CreateUserData {
@@ -1 +1 @@
1
- {"version":3,"file":"user.validator.d.ts","sourceRoot":"","sources":["user.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAGtD,qBAAa,iBAAiB;CAC7B;AAED,qBAAa,mBAAoB,YAAW,cAAc;IAExD,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,CAAA;IAG9B,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,CAAA;IAIpC,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAI5B,UAAU,EAAE,cAAc,CAAC,YAAY,CAAC,CAAA;CACzC;AAED,qBAAa,mBAAoB,YAAW,cAAc;IAGxD,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAI7B,QAAQ,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAA;IAIrC,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;CACpC"}
1
+ {"version":3,"file":"user.validator.d.ts","sourceRoot":"","sources":["user.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAEtD,OAAO,kBAAkB,CAAA;AAEzB,qBAAa,iBAAiB;CAC7B;AAED,qBAAa,mBAAoB,YAAW,cAAc;IAExD,KAAK,EAAE,cAAc,CAAC,OAAO,CAAC,CAAA;IAG9B,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC,CAAA;IAIpC,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAI5B,UAAU,EAAE,cAAc,CAAC,YAAY,CAAC,CAAA;CACzC;AAED,qBAAa,mBAAoB,YAAW,cAAc;IAGxD,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAI7B,QAAQ,CAAC,EAAE,cAAc,CAAC,UAAU,CAAC,CAAA;IAIrC,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAA;CACpC"}
@@ -1,5 +1,6 @@
1
1
  import { CreateUserData, UpdateUserData } from 'auth0'
2
2
  import { IsEmail, IsOptional, IsString, IsUrl } from 'class-validator'
3
+ import 'reflect-metadata'
3
4
 
4
5
  export class FindUserValidator {
5
6
  }
@@ -1,3 +1,4 @@
1
+ import 'reflect-metadata';
1
2
  export declare class LoginValidator {
2
3
  username: string;
3
4
  password: string;
@@ -1 +1 @@
1
- {"version":3,"file":"auth.validator.d.ts","sourceRoot":"","sources":["auth.validator.ts"],"names":[],"mappings":"AAEA,qBAAa,cAAc;IAGzB,QAAQ,EAAE,MAAM,CAAA;IAGhB,QAAQ,EAAE,MAAM,CAAA;CAEjB"}
1
+ {"version":3,"file":"auth.validator.d.ts","sourceRoot":"","sources":["auth.validator.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAA;AAEzB,qBAAa,cAAc;IAGzB,QAAQ,EAAE,MAAM,CAAA;IAGhB,QAAQ,EAAE,MAAM,CAAA;CAEjB"}
@@ -1,4 +1,5 @@
1
1
  import { IsEmail, IsNotEmpty } from 'class-validator'
2
+ import 'reflect-metadata'
2
3
 
3
4
  export class LoginValidator {
4
5
 
@@ -1,4 +1,4 @@
1
- import { AppEntity } from '../../app.entity';
1
+ import { AppEntity } from '@/config/app.entity';
2
2
  import { ProductEntity } from '../products/product.entity';
3
3
  export declare class BrandEntity extends AppEntity {
4
4
  name: string;
@@ -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,qBAAqB,CAAA;AAC/C,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
- import { AppEntity } from '../../app.entity'
1
+ import { AppEntity } from '@/config/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
  }
@@ -1,3 +1,4 @@
1
+ import 'reflect-metadata';
1
2
  import { BrandEntity } from './brand.entity';
2
3
  export declare class FindBrandValidator {
3
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"brand.validator.d.ts","sourceRoot":"","sources":["brand.validator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,qBAAa,kBAAkB;CAC9B;AAED,qBAAa,oBAAoB;IAE/B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAC1B;AAED,qBAAa,oBAAoB;IAG/B,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAC3B"}
1
+ {"version":3,"file":"brand.validator.d.ts","sourceRoot":"","sources":["brand.validator.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAE5C,qBAAa,kBAAkB;CAC9B;AAED,qBAAa,oBAAoB;IAE/B,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAC1B;AAED,qBAAa,oBAAoB;IAG/B,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAC3B"}
@@ -1,4 +1,5 @@
1
1
  import { IsOptional, IsString } from 'class-validator'
2
+ import 'reflect-metadata'
2
3
  import { BrandEntity } from './brand.entity'
3
4
 
4
5
  export class FindBrandValidator {
@@ -1,11 +1,9 @@
1
- import { AppEntity } from '../../app.entity';
1
+ import { AppEntity } from '@/config/app.entity';
2
2
  import { ProductEntity } from '../products/product.entity';
3
3
  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,qBAAqB,CAAA;AAC/C,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
- import { AppEntity } from '../../app.entity'
1
+ import { AppEntity } from '@/config/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
  }
@@ -1,3 +1,4 @@
1
+ import 'reflect-metadata';
1
2
  import { CategoryEntity } from './category.entity';
2
3
  export declare class FindCategoryValidator {
3
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"category.validator.d.ts","sourceRoot":"","sources":["category.validator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,qBAAa,qBAAqB;CACjC;AAED,qBAAa,uBAAuB;IAElC,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAI5B,WAAW,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;CAC5C;AAED,qBAAa,uBAAuB;IAElC,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;CAC7B"}
1
+ {"version":3,"file":"category.validator.d.ts","sourceRoot":"","sources":["category.validator.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,qBAAa,qBAAqB;CACjC;AAED,qBAAa,uBAAuB;IAElC,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAI5B,WAAW,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;CAC5C;AAED,qBAAa,uBAAuB;IAElC,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;CAC7B"}
@@ -1,4 +1,5 @@
1
1
  import { IsOptional, IsString } from 'class-validator'
2
+ import 'reflect-metadata'
2
3
  import { CategoryEntity } from './category.entity'
3
4
 
4
5
  export class FindCategoryValidator {
@@ -0,0 +1,6 @@
1
+ import { AppEntity } from '@/config/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,qBAAqB,CAAA;AAE/C,qBAAa,WAAY,SAAQ,SAAS;IACjC,IAAI,EAAE,MAAM,CAAA;IAEZ,GAAG,EAAE,MAAM,CAAA;CACnB"}
@@ -0,0 +1,7 @@
1
+ import { AppEntity } from '@/config/app.entity'
2
+
3
+ export class MediaEntity extends AppEntity {
4
+ public name: string
5
+
6
+ public url: string
7
+ }
@@ -1,3 +1,4 @@
1
+ import 'reflect-metadata';
1
2
  export declare class CreateMediaValidator {
2
3
  }
3
4
  export declare class UpdateMediaValidator {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.validator.d.ts","sourceRoot":"","sources":["media.validator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA;AAEzB,qBAAa,oBAAoB;CAEhC;AAED,qBAAa,oBAAoB;CAEhC"}
@@ -1,3 +1,5 @@
1
+ import 'reflect-metadata'
2
+
1
3
  export class CreateMediaValidator {
2
4
 
3
5
  }
@@ -1,34 +1,22 @@
1
- import { AppEntity } from '../../app.entity';
1
+ import { AppEntity } from '@/config/app.entity';
2
2
  import { BrandEntity } from '../brands/brand.entity';
3
3
  import { CategoryEntity } from '../categories/category.entity';
4
+ import { MediaEntity } from '../media/media.entity';
4
5
  import { PropertyEntity } from '../properties/property.entity';
5
- import { MediaEntity } from './media/media.entity';
6
- import { VariantEntity } from './variants/variant.entity';
7
- export declare enum PRODUCT_UNIT {
8
- LENGHT = "LENGHT",
9
- VOLUME = "VOLUME",
10
- WEIGHT = "WEIGHT",
11
- TIME = "TIME",
12
- QUANTITY = "QUANTITY"
13
- }
14
- export declare enum PRODUCT_STATUS {
15
- DRAFT = "DRAFT",
16
- PUBLISHED = "PUBLISHED",
17
- PAUSED = "PAUSED",
18
- EXHAUSTED = "EXHAUSTED"
19
- }
6
+ import { VariantEntity } from '../variants/variant.entity';
20
7
  export declare class ProductEntity extends AppEntity {
21
8
  name: string;
22
9
  description?: string;
23
- unit: PRODUCT_UNIT;
24
- status: PRODUCT_STATUS;
25
- availableFrom?: Date;
10
+ active: boolean;
11
+ availableFrom: Date;
26
12
  hashtags: string[];
27
13
  category?: CategoryEntity;
28
14
  brand?: BrandEntity;
29
15
  properties: PropertyEntity[];
16
+ variant: VariantEntity;
30
17
  variants: VariantEntity[];
31
18
  media: MediaEntity[];
32
- get masterVariant(): VariantEntity;
19
+ get isOutOfStock(): boolean;
20
+ get isDraft(): boolean;
33
21
  }
34
22
  //# 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,qBAAqB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,qBAAa,aAAc,SAAQ,SAAS;IACnC,IAAI,EAAE,MAAM,CAAA;IAEZ,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB,MAAM,UAAO;IAEb,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;IAE3B,IAAW,YAAY,YAEtB;IAED,IAAW,OAAO,YAEjB;CACF"}
@@ -1,62 +1,38 @@
1
- import { Column, Entity, ManyToOne, OneToMany } from 'typeorm'
2
- import { AppEntity } from '../../app.entity'
1
+ import { AppEntity } from '@/config/app.entity'
3
2
  import { BrandEntity } from '../brands/brand.entity'
4
3
  import { CategoryEntity } from '../categories/category.entity'
4
+ import { MediaEntity } from '../media/media.entity'
5
5
  import { PropertyEntity } from '../properties/property.entity'
6
- import { MediaEntity } from './media/media.entity'
7
- import { VariantEntity } from './variants/variant.entity'
8
-
9
- export enum PRODUCT_UNIT {
10
- LENGHT = 'LENGHT',
11
- VOLUME = 'VOLUME',
12
- WEIGHT = 'WEIGHT',
13
- TIME = 'TIME',
14
- QUANTITY = 'QUANTITY',
15
- }
16
-
17
- export enum PRODUCT_STATUS {
18
- DRAFT = 'DRAFT',
19
- PUBLISHED = 'PUBLISHED',
20
- PAUSED = 'PAUSED',
21
- EXHAUSTED = 'EXHAUSTED',
22
- }
6
+ import { VariantEntity } from '../variants/variant.entity'
23
7
 
24
- @Entity('inventory_products')
25
8
  export class ProductEntity extends AppEntity {
26
- @Column({ length: 64 })
27
9
  public name: string
28
10
 
29
- @Column({ nullable: true, type: 'text' })
30
11
  public description?: string
31
12
 
32
- @Column({ type: 'enum', enum: PRODUCT_UNIT, default: PRODUCT_UNIT.QUANTITY })
33
- public unit = PRODUCT_UNIT.QUANTITY
34
-
35
- @Column({ type: 'enum', enum: PRODUCT_STATUS, default: PRODUCT_STATUS.DRAFT })
36
- public status = PRODUCT_STATUS.DRAFT
13
+ public active = true
37
14
 
38
- @Column({ type: 'date', nullable: true })
39
- public availableFrom?: Date
15
+ public availableFrom = new Date()
40
16
 
41
- @Column('simple-array')
42
17
  public hashtags: string[] = []
43
18
 
44
- @ManyToOne(() => CategoryEntity, c => c.products, { eager: true })
45
19
  public category?: CategoryEntity
46
20
 
47
- @ManyToOne(() => BrandEntity, b => b.products, { eager: true })
48
21
  public brand?: BrandEntity
49
22
 
50
- @OneToMany(() => PropertyEntity, p => p.products, { eager: true })
51
23
  public properties: PropertyEntity[]
52
24
 
53
- @OneToMany(() => VariantEntity, v => v.product, { eager: true })
25
+ public variant: VariantEntity
26
+
54
27
  public variants: VariantEntity[]
55
28
 
56
- @OneToMany(() => MediaEntity, m => m.products, { eager: true })
57
29
  public media: MediaEntity[]
58
30
 
59
- public get masterVariant () {
60
- return this.variants.find(variant => variant.master)
31
+ public get isOutOfStock () {
32
+ return this.variants.every(variant => variant.isOutOfStock)
33
+ }
34
+
35
+ public get isDraft () {
36
+ return this.active === true
61
37
  }
62
38
  }
@@ -1,23 +1,24 @@
1
+ import 'reflect-metadata';
2
+ import { CreateVariantValidator } from '../variants/variant.validator';
1
3
  import { ProductEntity } from './product.entity';
2
- import { CreateVariantValidator } from './variants/variant.validator';
3
4
  export declare class FindProductValidator {
4
5
  }
5
6
  export declare class CreateProductValidator {
6
7
  name: ProductEntity['name'];
7
8
  description?: ProductEntity['description'];
9
+ availableFrom: Date;
10
+ active: boolean;
8
11
  category?: number;
9
12
  brand?: number;
10
- unit: ProductEntity['unit'];
11
13
  hashtags: ProductEntity['hashtags'];
12
14
  variants: CreateVariantValidator[];
15
+ variant: CreateVariantValidator;
13
16
  }
14
17
  export declare class UpdateProductValidator {
15
18
  name?: ProductEntity['name'];
16
19
  description?: ProductEntity['description'];
17
20
  category?: number;
18
21
  brand?: number;
19
- unit?: ProductEntity['unit'];
20
- status?: ProductEntity['status'];
21
22
  hashtags?: ProductEntity['hashtags'];
22
23
  }
23
24
  //# sourceMappingURL=product.validator.d.ts.map