@merkaly/api 0.1.11-5 → 0.1.12-0

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 (82) hide show
  1. package/{src → config}/app.entity.d.ts +0 -0
  2. package/{src → config}/app.entity.d.ts.map +0 -0
  3. package/{src → config}/app.entity.ts +0 -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 +1 -0
  18. package/src/account/organizations/organization.validator.d.ts.map +1 -1
  19. package/src/account/organizations/organization.validator.ts +1 -0
  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 +1 -1
  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 -1
  45. package/src/inventory/categories/category.entity.d.ts.map +1 -1
  46. package/src/inventory/categories/category.entity.ts +1 -1
  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 +1 -1
  51. package/src/inventory/media/media.entity.d.ts.map +1 -1
  52. package/src/inventory/media/media.entity.ts +1 -1
  53. package/src/inventory/media/media.validator.d.ts +1 -0
  54. package/src/inventory/media/media.validator.d.ts.map +1 -1
  55. package/src/inventory/media/media.validator.ts +2 -0
  56. package/src/inventory/products/product.entity.d.ts +5 -17
  57. package/src/inventory/products/product.entity.d.ts.map +1 -1
  58. package/src/inventory/products/product.entity.ts +11 -20
  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 +16 -15
  62. package/src/inventory/properties/property.entity.d.ts +1 -1
  63. package/src/inventory/properties/property.entity.d.ts.map +1 -1
  64. package/src/inventory/properties/property.entity.ts +1 -1
  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 +4 -1
  69. package/src/inventory/variants/variant.entity.d.ts.map +1 -1
  70. package/src/inventory/variants/variant.entity.ts +11 -1
  71. package/src/inventory/variants/variant.validator.d.ts +2 -0
  72. package/src/inventory/variants/variant.validator.d.ts.map +1 -1
  73. package/src/inventory/variants/variant.validator.ts +6 -1
  74. package/src/store/orders/order.entity.d.ts +1 -1
  75. package/src/store/orders/order.entity.d.ts.map +1 -1
  76. package/src/store/orders/order.entity.ts +1 -1
  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/index.d.ts +0 -3
  81. package/src/index.d.ts.map +0 -1
  82. package/src/index.ts +0 -3
File without changes
File without changes
File without changes
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-5",
3
+ "version": "0.1.12-0",
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,4 +1,5 @@
1
1
  import { Organization } from 'auth0';
2
+ import 'reflect-metadata';
2
3
  export declare class FindOrganizationValidator {
3
4
  }
4
5
  export declare class CreateOrganizationValidator {
@@ -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,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
+ {"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
 
@@ -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":"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
+ {"version":3,"file":"brand.entity.d.ts","sourceRoot":"","sources":["brand.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACtD,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,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
 
4
4
  export class BrandEntity extends AppEntity {
@@ -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,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
  import { PropertyEntity } from '../properties/property.entity';
4
4
  export declare class CategoryEntity extends AppEntity {
@@ -1 +1 @@
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
+ {"version":3,"file":"category.entity.d.ts","sourceRoot":"","sources":["category.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACtD,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,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
  import { PropertyEntity } from '../properties/property.entity'
4
4
 
@@ -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 {
@@ -1,4 +1,4 @@
1
- import { AppEntity } from '../../app.entity';
1
+ import { AppEntity } from '../../../config/app.entity';
2
2
  export declare class MediaEntity extends AppEntity {
3
3
  name: string;
4
4
  url: string;
@@ -1 +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"}
1
+ {"version":3,"file":"media.entity.d.ts","sourceRoot":"","sources":["media.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAEtD,qBAAa,WAAY,SAAQ,SAAS;IACjC,IAAI,EAAE,MAAM,CAAA;IAEZ,GAAG,EAAE,MAAM,CAAA;CACnB"}
@@ -1,4 +1,4 @@
1
- import { AppEntity } from '../../app.entity'
1
+ import { AppEntity } from '../../../config/app.entity'
2
2
 
3
3
  export class MediaEntity extends AppEntity {
4
4
  public name: string
@@ -1,3 +1,4 @@
1
+ import 'reflect-metadata';
1
2
  export declare class CreateMediaValidator {
2
3
  }
3
4
  export declare class UpdateMediaValidator {
@@ -1 +1 @@
1
- {"version":3,"file":"media.validator.d.ts","sourceRoot":"","sources":["media.validator.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAoB;CAEhC;AAED,qBAAa,oBAAoB;CAEhC"}
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,27 +1,13 @@
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 { PropertyEntity } from '../properties/property.entity';
5
4
  import { MediaEntity } from '../media/media.entity';
5
+ import { PropertyEntity } from '../properties/property.entity';
6
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
- }
20
7
  export declare class ProductEntity extends AppEntity {
21
8
  name: string;
22
9
  description?: string;
23
- unit: PRODUCT_UNIT;
24
- status: PRODUCT_STATUS;
10
+ active: boolean;
25
11
  availableFrom: Date;
26
12
  hashtags: string[];
27
13
  category?: CategoryEntity;
@@ -30,5 +16,7 @@ export declare class ProductEntity extends AppEntity {
30
16
  variant: VariantEntity;
31
17
  variants: VariantEntity[];
32
18
  media: MediaEntity[];
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":"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
+ {"version":3,"file":"product.entity.d.ts","sourceRoot":"","sources":["product.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACtD,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,33 +1,16 @@
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 { PropertyEntity } from '../properties/property.entity'
5
4
  import { MediaEntity } from '../media/media.entity'
5
+ import { PropertyEntity } from '../properties/property.entity'
6
6
  import { VariantEntity } from '../variants/variant.entity'
7
7
 
8
- export enum PRODUCT_UNIT {
9
- LENGHT = 'LENGHT',
10
- VOLUME = 'VOLUME',
11
- WEIGHT = 'WEIGHT',
12
- TIME = 'TIME',
13
- QUANTITY = 'QUANTITY',
14
- }
15
-
16
- export enum PRODUCT_STATUS {
17
- DRAFT = 'DRAFT',
18
- PUBLISHED = 'PUBLISHED',
19
- PAUSED = 'PAUSED',
20
- EXHAUSTED = 'EXHAUSTED',
21
- }
22
-
23
8
  export class ProductEntity extends AppEntity {
24
9
  public name: string
25
10
 
26
11
  public description?: string
27
12
 
28
- public unit = PRODUCT_UNIT.QUANTITY
29
-
30
- public status = PRODUCT_STATUS.DRAFT
13
+ public active = true
31
14
 
32
15
  public availableFrom = new Date()
33
16
 
@@ -44,4 +27,12 @@ export class ProductEntity extends AppEntity {
44
27
  public variants: VariantEntity[]
45
28
 
46
29
  public media: MediaEntity[]
30
+
31
+ public get isOutOfStock () {
32
+ return this.variants.every(variant => variant.isOutOfStock)
33
+ }
34
+
35
+ public get isDraft () {
36
+ return this.active === true
37
+ }
47
38
  }
@@ -1,23 +1,24 @@
1
- import { ProductEntity } from './product.entity';
1
+ import 'reflect-metadata';
2
2
  import { CreateVariantValidator } from '../variants/variant.validator';
3
+ import { ProductEntity } from './product.entity';
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
@@ -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,+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
+ {"version":3,"file":"product.validator.d.ts","sourceRoot":"","sources":["product.validator.ts"],"names":[],"mappings":"AAEA,OAAO,kBAAkB,CAAA;AACzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,qBAAa,oBAAoB;CAEhC;AAED,qBAAa,sBAAsB;IAEjC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAA;IAI3B,WAAW,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAA;IAI1C,aAAa,EAAE,IAAI,CAAA;IAInB,MAAM,UAAO;IAIb,QAAQ,CAAC,EAAE,MAAM,CAAA;IAIjB,KAAK,CAAC,EAAE,MAAM,CAAA;IAId,QAAQ,EAAE,aAAa,CAAC,UAAU,CAAC,CAAK;IAKxC,QAAQ,EAAE,sBAAsB,EAAE,CAAK;IAIvC,OAAO,yBAA+B;CACvC;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,QAAQ,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAA;CACrC"}
@@ -1,7 +1,8 @@
1
1
  import { Type } from 'class-transformer'
2
- import { ArrayMinSize, IsEnum, IsOptional, IsPositive, IsString, ValidateNested } from 'class-validator'
3
- import { PRODUCT_STATUS, PRODUCT_UNIT, ProductEntity } from './product.entity'
2
+ import { IsBoolean, IsDateString, IsOptional, IsPositive, IsString, ValidateNested } from 'class-validator'
3
+ import 'reflect-metadata'
4
4
  import { CreateVariantValidator } from '../variants/variant.validator'
5
+ import { ProductEntity } from './product.entity'
5
6
 
6
7
  export class FindProductValidator {
7
8
 
@@ -15,6 +16,14 @@ export class CreateProductValidator {
15
16
  @IsOptional()
16
17
  description?: ProductEntity['description']
17
18
 
19
+ @IsDateString()
20
+ @IsOptional()
21
+ availableFrom: Date
22
+
23
+ @IsBoolean()
24
+ @IsOptional()
25
+ active = true
26
+
18
27
  @IsOptional()
19
28
  @IsPositive()
20
29
  category?: number
@@ -23,18 +32,18 @@ export class CreateProductValidator {
23
32
  @IsPositive()
24
33
  brand?: number
25
34
 
26
- @IsOptional()
27
- @IsEnum(PRODUCT_UNIT)
28
- unit: ProductEntity['unit'] = PRODUCT_UNIT.QUANTITY
29
-
30
35
  @IsOptional()
31
36
  @IsString({ each: true })
32
37
  hashtags: ProductEntity['hashtags'] = []
33
38
 
34
39
  @ValidateNested({ each: true })
35
- @ArrayMinSize(1)
36
40
  @Type(() => CreateVariantValidator)
41
+ @IsOptional()
37
42
  variants: CreateVariantValidator[] = []
43
+
44
+ @ValidateNested()
45
+ @Type(() => CreateVariantValidator)
46
+ variant = new CreateVariantValidator()
38
47
  }
39
48
 
40
49
  export class UpdateProductValidator {
@@ -54,14 +63,6 @@ export class UpdateProductValidator {
54
63
  @IsPositive()
55
64
  brand?: number
56
65
 
57
- @IsOptional()
58
- @IsEnum(PRODUCT_UNIT)
59
- unit?: ProductEntity['unit']
60
-
61
- @IsOptional()
62
- @IsEnum(PRODUCT_STATUS)
63
- status?: ProductEntity['status']
64
-
65
66
  @IsOptional()
66
67
  @IsString({ each: true })
67
68
  hashtags?: ProductEntity['hashtags']
@@ -1,4 +1,4 @@
1
- import { AppEntity } from '../../app.entity';
1
+ import { AppEntity } from '../../../config/app.entity';
2
2
  import { CategoryEntity } from '../categories/category.entity';
3
3
  import { ProductEntity } from '../products/product.entity';
4
4
  export declare class PropertyEntity extends AppEntity {
@@ -1 +1 @@
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
+ {"version":3,"file":"property.entity.d.ts","sourceRoot":"","sources":["property.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACtD,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,4 +1,4 @@
1
- import { AppEntity } from '../../app.entity'
1
+ import { AppEntity } from '../../../config/app.entity'
2
2
  import { CategoryEntity } from '../categories/category.entity'
3
3
  import { ProductEntity } from '../products/product.entity'
4
4
 
@@ -1,3 +1,4 @@
1
+ import 'reflect-metadata';
1
2
  import { PropertyEntity } from './property.entity';
2
3
  export declare class FindPropertyValidator {
3
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"property.validator.d.ts","sourceRoot":"","sources":["property.validator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,qBAAa,qBAAqB;CAEjC;AAED,qBAAa,uBAAuB;IAElC,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAI5B,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;CAClC;AAED,qBAAa,uBAAuB;IAGlC,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAI7B,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;CAClC"}
1
+ {"version":3,"file":"property.validator.d.ts","sourceRoot":"","sources":["property.validator.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,qBAAa,qBAAqB;CAEjC;AAED,qBAAa,uBAAuB;IAElC,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAI5B,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;CAClC;AAED,qBAAa,uBAAuB;IAGlC,IAAI,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAA;IAI7B,MAAM,CAAC,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;CAClC"}
@@ -1,4 +1,5 @@
1
1
  import { IsArray, IsOptional, IsString } from 'class-validator'
2
+ import 'reflect-metadata'
2
3
  import { PropertyEntity } from './property.entity'
3
4
 
4
5
  export class FindPropertyValidator {
@@ -1,9 +1,12 @@
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 VariantEntity extends AppEntity {
4
4
  price: number;
5
5
  sku: string;
6
6
  quantity: number;
7
+ active: boolean;
7
8
  product: ProductEntity;
9
+ get isOutOfStock(): boolean;
10
+ get isDraft(): boolean;
8
11
  }
9
12
  //# sourceMappingURL=variant.entity.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"variant.entity.d.ts","sourceRoot":"","sources":["variant.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,qBAAa,aAAc,SAAQ,SAAS;IACnC,KAAK,SAAI;IAET,GAAG,EAAE,MAAM,CAAA;IAEX,QAAQ,SAAI;IAEZ,MAAM,UAAO;IAEb,OAAO,EAAE,aAAa,CAAA;IAE7B,IAAW,YAAY,YAEtB;IAED,IAAW,OAAO,YAEjB;CACF"}
@@ -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
 
4
4
  export class VariantEntity extends AppEntity {
@@ -8,5 +8,15 @@ export class VariantEntity extends AppEntity {
8
8
 
9
9
  public quantity = 1
10
10
 
11
+ public active = true
12
+
11
13
  public product: ProductEntity
14
+
15
+ public get isOutOfStock () {
16
+ return this.quantity === 0
17
+ }
18
+
19
+ public get isDraft () {
20
+ return this.active === true
21
+ }
12
22
  }
@@ -1,8 +1,10 @@
1
+ import 'reflect-metadata';
1
2
  import { VariantEntity } from './variant.entity';
2
3
  export declare class CreateVariantValidator {
3
4
  price: VariantEntity['price'];
4
5
  sku: VariantEntity['sku'];
5
6
  quantity: VariantEntity['quantity'];
7
+ active: boolean;
6
8
  }
7
9
  export declare class UpdateVariantValidator {
8
10
  }
@@ -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;CAC/C;AAED,qBAAa,sBAAsB;CAElC"}
1
+ {"version":3,"file":"variant.validator.d.ts","sourceRoot":"","sources":["variant.validator.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAA;AACzB,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;IAI9C,MAAM,UAAO;CACd;AAED,qBAAa,sBAAsB;CAElC"}
@@ -1,4 +1,5 @@
1
- import { Allow, IsOptional, IsPositive } from 'class-validator'
1
+ import { Allow, IsBoolean, IsOptional, IsPositive } from 'class-validator'
2
+ import 'reflect-metadata'
2
3
  import { VariantEntity } from './variant.entity'
3
4
 
4
5
  export class CreateVariantValidator {
@@ -11,6 +12,10 @@ export class CreateVariantValidator {
11
12
  @IsPositive()
12
13
  @IsOptional()
13
14
  public quantity: VariantEntity['quantity'] = 1
15
+
16
+ @IsBoolean()
17
+ @IsOptional()
18
+ active = true
14
19
  }
15
20
 
16
21
  export class UpdateVariantValidator {
@@ -1,4 +1,4 @@
1
- import { AppEntity } from '../../app.entity';
1
+ import { AppEntity } from '../../../config/app.entity';
2
2
  export declare class OrderEntity extends AppEntity {
3
3
  number: string;
4
4
  price: number;
@@ -1 +1 @@
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
+ {"version":3,"file":"order.entity.d.ts","sourceRoot":"","sources":["order.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAEtD,qBAAa,WAAY,SAAQ,SAAS;IACjC,MAAM,EAAE,MAAM,CAAA;IAEd,KAAK,EAAE,MAAM,CAAA;CACrB"}
@@ -1,4 +1,4 @@
1
- import { AppEntity } from '../../app.entity'
1
+ import { AppEntity } from '../../../config/app.entity'
2
2
 
3
3
  export class OrderEntity extends AppEntity {
4
4
  public number: string
@@ -1,3 +1,4 @@
1
+ import 'reflect-metadata';
1
2
  export declare class FindOrderValidator {
2
3
  }
3
4
  export declare class CreateOrderValidator {
@@ -1 +1 @@
1
- {"version":3,"file":"order.validator.d.ts","sourceRoot":"","sources":["order.validator.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAkB;CAE9B;AAED,qBAAa,oBAAoB;CAEhC;AAED,qBAAa,oBAAoB;CAEhC"}
1
+ {"version":3,"file":"order.validator.d.ts","sourceRoot":"","sources":["order.validator.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAA;AAEzB,qBAAa,kBAAkB;CAE9B;AAED,qBAAa,oBAAoB;CAEhC;AAED,qBAAa,oBAAoB;CAEhC"}
@@ -1,3 +1,5 @@
1
+ import 'reflect-metadata'
2
+
1
3
  export class FindOrderValidator {
2
4
 
3
5
  }
@@ -9,3 +11,4 @@ export class CreateOrderValidator {
9
11
  export class UpdateOrderValidator {
10
12
 
11
13
  }
14
+
package/src/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import * as account from './account';
2
- export import Account = account;
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,WAAW,CAAA;AAEpC,MAAM,QAAQ,OAAO,GAAG,OAAO,CAAA"}
package/src/index.ts DELETED
@@ -1,3 +0,0 @@
1
- import * as account from './account'
2
-
3
- export import Account = account