@merkaly/api 0.1.10 → 0.1.11-2

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 (52) hide show
  1. package/package.json +3 -3
  2. package/src/account/connections/connection.validator.d.ts +3 -4
  3. package/src/account/connections/connection.validator.d.ts.map +1 -1
  4. package/src/account/connections/connection.validator.ts +3 -5
  5. package/src/account/organizations/connections/connection.validator.d.ts +3 -3
  6. package/src/account/organizations/connections/connection.validator.d.ts.map +1 -1
  7. package/src/account/organizations/connections/connection.validator.ts +3 -3
  8. package/src/account/organizations/organization.validator.d.ts +10 -10
  9. package/src/account/organizations/organization.validator.d.ts.map +1 -1
  10. package/src/account/organizations/organization.validator.ts +10 -11
  11. package/src/account/roles/role.validator.d.ts +4 -5
  12. package/src/account/roles/role.validator.d.ts.map +1 -1
  13. package/src/account/roles/role.validator.ts +4 -6
  14. package/src/account/users/user.validator.d.ts +7 -8
  15. package/src/account/users/user.validator.d.ts.map +1 -1
  16. package/src/account/users/user.validator.ts +7 -9
  17. package/src/app.entity.d.ts +3 -5
  18. package/src/app.entity.d.ts.map +1 -1
  19. package/src/app.entity.ts +3 -9
  20. package/src/inventory/brands/brand.validator.d.ts +3 -3
  21. package/src/inventory/brands/brand.validator.d.ts.map +1 -1
  22. package/src/inventory/brands/brand.validator.ts +3 -4
  23. package/src/inventory/categories/category.validator.d.ts +4 -4
  24. package/src/inventory/categories/category.validator.d.ts.map +1 -1
  25. package/src/inventory/categories/category.validator.ts +4 -5
  26. package/src/inventory/products/media/media.validator.d.ts +0 -1
  27. package/src/inventory/products/media/media.validator.d.ts.map +1 -1
  28. package/src/inventory/products/media/media.validator.ts +0 -2
  29. package/src/inventory/products/product.entity.d.ts.map +1 -1
  30. package/src/inventory/products/product.entity.ts +4 -4
  31. package/src/inventory/products/product.validator.d.ts +12 -14
  32. package/src/inventory/products/product.validator.d.ts.map +1 -1
  33. package/src/inventory/products/product.validator.ts +18 -25
  34. package/src/inventory/products/variants/variant.entity.d.ts +1 -1
  35. package/src/inventory/products/variants/variant.entity.d.ts.map +1 -1
  36. package/src/inventory/products/variants/variant.entity.ts +3 -4
  37. package/src/inventory/products/variants/variant.validator.d.ts +5 -1
  38. package/src/inventory/products/variants/variant.validator.d.ts.map +1 -1
  39. package/src/inventory/products/variants/variant.validator.ts +14 -2
  40. package/src/inventory/properties/property.entity.ts +2 -2
  41. package/src/inventory/properties/property.validator.d.ts +5 -5
  42. package/src/inventory/properties/property.validator.d.ts.map +1 -1
  43. package/src/inventory/properties/property.validator.ts +5 -6
  44. package/src/store/carts/cart.validator.d.ts +0 -1
  45. package/src/store/carts/cart.validator.d.ts.map +1 -1
  46. package/src/store/carts/cart.validator.ts +0 -2
  47. package/src/store/items/item.validator.d.ts +0 -1
  48. package/src/store/items/item.validator.d.ts.map +1 -1
  49. package/src/store/items/item.validator.ts +0 -2
  50. package/src/store/orders/order.validator.d.ts +0 -1
  51. package/src/store/orders/order.validator.d.ts.map +1 -1
  52. package/src/store/orders/order.validator.ts +0 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkaly/api",
3
- "version": "0.1.10",
3
+ "version": "0.1.11-2",
4
4
  "description": "NestJS Backend ApiRest Service",
5
5
  "author": "Randy Tellez Galan <kronhyx@gmail.com>",
6
6
  "license": "UNLICENSED",
@@ -28,7 +28,8 @@
28
28
  "auth0": "^2.35.0",
29
29
  "class-transformer": "^0.5.1",
30
30
  "class-validator": "^0.13.1",
31
- "reflect-metadata": "^0.1.13"
31
+ "reflect-metadata": "^0.1.13",
32
+ "typeorm": "^0.2.45"
32
33
  },
33
34
  "devDependencies": {
34
35
  "@commitlint/config-conventional": "^16.0.0",
@@ -77,7 +78,6 @@
77
78
  "ts-loader": "^9.2.3",
78
79
  "ts-node": "^10.0.0",
79
80
  "tsconfig-paths": "^3.9.0",
80
- "typeorm": "^0.2.45",
81
81
  "typescript": "^4.6.2",
82
82
  "webpack": "^5"
83
83
  },
@@ -1,9 +1,8 @@
1
- import { CreateConnection, Strategy, UpdateConnection } from 'auth0';
1
+ import { CreateConnection, UpdateConnection } from 'auth0';
2
2
  export declare class CreateConnectionValidator implements CreateConnection {
3
- name: string;
4
- strategy: Strategy;
3
+ name: CreateConnection['name'];
4
+ strategy: CreateConnection['strategy'];
5
5
  }
6
- export declare type IdConnectionalidator = string;
7
6
  export declare class UpdateConnectionValidator implements UpdateConnection {
8
7
  }
9
8
  //# sourceMappingURL=connection.validator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connection.validator.d.ts","sourceRoot":"","sources":["connection.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAA;AAGpE,qBAAa,yBAA0B,YAAW,gBAAgB;IAEzD,IAAI,EAAE,MAAM,CAAA;IAGZ,QAAQ,EAAE,QAAQ,CAAA;CAC1B;AAED,oBAAY,oBAAoB,GAAG,MAAM,CAAA;AAEzC,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;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,16 +1,14 @@
1
- import { CreateConnection, Strategy, UpdateConnection } from 'auth0'
1
+ import { CreateConnection, UpdateConnection } from 'auth0'
2
2
  import { IsString } from 'class-validator'
3
3
 
4
4
  export class CreateConnectionValidator implements CreateConnection {
5
5
  @IsString()
6
- public name: string
6
+ public name: CreateConnection['name']
7
7
 
8
8
  @IsString()
9
- public strategy: Strategy
9
+ public strategy: CreateConnection['strategy']
10
10
  }
11
11
 
12
- export type IdConnectionalidator = string
13
-
14
12
  export class UpdateConnectionValidator implements UpdateConnection {
15
13
 
16
14
  }
@@ -1,9 +1,9 @@
1
1
  import { AddOrganizationEnabledConnection, UpdateOrganizationEnabledConnection } from 'auth0';
2
2
  export declare class CreateConnectionValidator implements AddOrganizationEnabledConnection {
3
- connection_id: string;
4
- assign_membership_on_login: boolean;
3
+ connection_id: AddOrganizationEnabledConnection['connection_id'];
4
+ assign_membership_on_login: AddOrganizationEnabledConnection['assign_membership_on_login'];
5
5
  }
6
6
  export declare class UpdateConnectionValidator implements UpdateOrganizationEnabledConnection {
7
- assign_membership_on_login: boolean;
7
+ assign_membership_on_login: UpdateOrganizationEnabledConnection['assign_membership_on_login'];
8
8
  }
9
9
  //# sourceMappingURL=connection.validator.d.ts.map
@@ -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,MAAM,CAAA;IAGrB,0BAA0B,EAAE,OAAO,CAAA;CACpC;AAED,qBAAa,yBAA0B,YAAW,mCAAmC;IAEnF,0BAA0B,EAAE,OAAO,CAAA;CACpC"}
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"}
@@ -3,13 +3,13 @@ import { IsBoolean, IsString } from 'class-validator'
3
3
 
4
4
  export class CreateConnectionValidator implements AddOrganizationEnabledConnection {
5
5
  @IsString()
6
- connection_id: string
6
+ connection_id: AddOrganizationEnabledConnection['connection_id']
7
7
 
8
8
  @IsBoolean()
9
- assign_membership_on_login: boolean
9
+ assign_membership_on_login: AddOrganizationEnabledConnection['assign_membership_on_login']
10
10
  }
11
11
 
12
12
  export class UpdateConnectionValidator implements UpdateOrganizationEnabledConnection {
13
13
  @IsBoolean()
14
- assign_membership_on_login: boolean
14
+ assign_membership_on_login: UpdateOrganizationEnabledConnection['assign_membership_on_login']
15
15
  }
@@ -1,17 +1,17 @@
1
+ import { Organization } from 'auth0';
1
2
  export declare class FindOrganizationValidator {
2
3
  }
3
4
  export declare class CreateOrganizationValidator {
4
- name: string;
5
- display_name: string;
6
- logo_url?: string;
7
- primary_color?: string;
8
- secondary_color?: string;
5
+ name: Organization['name'];
6
+ display_name: Organization['display_name'];
7
+ logo_url?: Organization['branding']['logo_url'];
8
+ primary_color?: Organization['branding']['colors']['primary'];
9
+ secondary_color?: Organization['branding']['colors']['page_background'];
9
10
  }
10
- export declare type IdOrganizationValidator = string;
11
11
  export declare class UpdateOrganizationValidator {
12
- display_name?: string;
13
- logo_url?: string;
14
- primary_color?: string;
15
- secondary_color?: string;
12
+ display_name?: Organization['display_name'];
13
+ logo_url?: Organization['branding']['logo_url'];
14
+ primary_color?: Organization['branding']['colors']['primary'];
15
+ secondary_color?: Organization['branding']['colors']['page_background'];
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":"AAEA,qBAAa,yBAAyB;CAErC;AAED,qBAAa,2BAA2B;IAEtC,IAAI,EAAE,MAAM,CAAA;IAGZ,YAAY,EAAE,MAAM,CAAA;IAIpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IAIjB,aAAa,CAAC,EAAE,MAAM,CAAA;IAItB,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,oBAAY,uBAAuB,GAAG,MAAM,CAAA;AAE5C,qBAAa,2BAA2B;IAGtC,YAAY,CAAC,EAAE,MAAM,CAAA;IAIrB,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,YAAY,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,CAAA;IAI/C,aAAa,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAA;IAI7D,eAAe,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAAA;CACxE;AAED,qBAAa,2BAA2B;IAGtC,YAAY,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAI3C,QAAQ,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,CAAA;IAI/C,aAAa,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,CAAA;IAK7D,eAAe,CAAC,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAAA;CACxE"}
@@ -1,3 +1,4 @@
1
+ import { Organization } from 'auth0'
1
2
  import { IsHexColor, IsOptional, IsString, IsUrl } from 'class-validator'
2
3
 
3
4
  export class FindOrganizationValidator {
@@ -6,41 +7,39 @@ export class FindOrganizationValidator {
6
7
 
7
8
  export class CreateOrganizationValidator {
8
9
  @IsString()
9
- name: string
10
+ name: Organization['name']
10
11
 
11
12
  @IsString()
12
- display_name: string
13
+ display_name: Organization['display_name']
13
14
 
14
15
  @IsUrl({})
15
16
  @IsOptional()
16
- logo_url?: string
17
+ logo_url?: Organization['branding']['logo_url']
17
18
 
18
19
  @IsHexColor()
19
20
  @IsOptional()
20
- primary_color?: string
21
+ primary_color?: Organization['branding']['colors']['primary']
21
22
 
22
23
  @IsHexColor()
23
24
  @IsOptional()
24
- secondary_color?: string
25
+ secondary_color?: Organization['branding']['colors']['page_background']
25
26
  }
26
27
 
27
- export type IdOrganizationValidator = string
28
-
29
28
  export class UpdateOrganizationValidator {
30
29
  @IsString()
31
30
  @IsOptional()
32
- display_name?: string
31
+ display_name?: Organization['display_name']
33
32
 
34
33
  @IsUrl()
35
34
  @IsOptional()
36
- logo_url?: string
35
+ logo_url?: Organization['branding']['logo_url']
37
36
 
38
37
  @IsHexColor()
39
38
  @IsOptional()
40
- primary_color?: string
39
+ primary_color?: Organization['branding']['colors']['primary']
41
40
 
42
41
  @IsString()
43
42
  @IsHexColor()
44
43
  @IsOptional()
45
- secondary_color?: string
44
+ secondary_color?: Organization['branding']['colors']['page_background']
46
45
  }
@@ -2,12 +2,11 @@ import { CreateRoleData, UpdateRoleData } from 'auth0';
2
2
  export declare class FindRoleValidator {
3
3
  }
4
4
  export declare class CreateRoleValidator implements CreateRoleData {
5
- name: string;
6
- description: string;
5
+ name: CreateRoleData['name'];
6
+ description: CreateRoleData['description'];
7
7
  }
8
- export declare type IdRoleValidator = string;
9
8
  export declare class UpdateRoleValidator implements UpdateRoleData {
10
- name: string;
11
- description: string;
9
+ name: UpdateRoleData['name'];
10
+ description: UpdateRoleData['description'];
12
11
  }
13
12
  //# sourceMappingURL=role.validator.d.ts.map
@@ -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,MAAM,CAAA;IAIZ,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,oBAAY,eAAe,GAAG,MAAM,CAAA;AAEpC,qBAAa,mBAAoB,YAAW,cAAc;IAGxD,IAAI,EAAE,MAAM,CAAA;IAIZ,WAAW,EAAE,MAAM,CAAA;CACpB"}
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"}
@@ -7,21 +7,19 @@ export class FindRoleValidator {
7
7
 
8
8
  export class CreateRoleValidator implements CreateRoleData {
9
9
  @IsString()
10
- name: string
10
+ name: CreateRoleData['name']
11
11
 
12
12
  @IsString()
13
13
  @IsOptional()
14
- description: string
14
+ description: CreateRoleData['description']
15
15
  }
16
16
 
17
- export type IdRoleValidator = string
18
-
19
17
  export class UpdateRoleValidator implements UpdateRoleData {
20
18
  @IsOptional()
21
19
  @IsString()
22
- name: string
20
+ name: UpdateRoleData['name']
23
21
 
24
22
  @IsString()
25
23
  @IsOptional()
26
- description: string
24
+ description: UpdateRoleData['description']
27
25
  }
@@ -2,15 +2,14 @@ import { CreateUserData, UpdateUserData } from 'auth0';
2
2
  export declare class FindUserValidator {
3
3
  }
4
4
  export declare class CreateUserValidator implements CreateUserData {
5
- email: string;
6
- password: string;
7
- name: string;
8
- connection: string;
5
+ email: CreateUserData['email'];
6
+ password: CreateUserData['password'];
7
+ name: CreateUserData['name'];
8
+ connection: CreateUserData['connection'];
9
9
  }
10
- export declare type IdUserValidator = string;
11
10
  export declare class UpdateUserValidator implements UpdateUserData {
12
- name?: string;
13
- nickname?: string;
14
- picture?: string;
11
+ name?: UpdateUserData['name'];
12
+ nickname?: UpdateUserData['nickname'];
13
+ picture?: UpdateUserData['picture'];
15
14
  }
16
15
  //# sourceMappingURL=user.validator.d.ts.map
@@ -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,MAAM,CAAA;IAGb,QAAQ,EAAE,MAAM,CAAA;IAIhB,IAAI,EAAE,MAAM,CAAA;IAIZ,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,oBAAY,eAAe,GAAG,MAAM,CAAA;AAEpC,qBAAa,mBAAoB,YAAW,cAAc;IAGxD,IAAI,CAAC,EAAE,MAAM,CAAA;IAIb,QAAQ,CAAC,EAAE,MAAM,CAAA;IAIjB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"}
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"}
@@ -6,32 +6,30 @@ export class FindUserValidator {
6
6
 
7
7
  export class CreateUserValidator implements CreateUserData {
8
8
  @IsEmail()
9
- email: string
9
+ email: CreateUserData['email']
10
10
 
11
11
  @IsString()
12
- password: string
12
+ password: CreateUserData['password']
13
13
 
14
14
  @IsOptional()
15
15
  @IsString()
16
- name: string
16
+ name: CreateUserData['name']
17
17
 
18
18
  @IsOptional()
19
19
  @IsString()
20
- connection: string
20
+ connection: CreateUserData['connection']
21
21
  }
22
22
 
23
- export type IdUserValidator = string
24
-
25
23
  export class UpdateUserValidator implements UpdateUserData {
26
24
  @IsOptional()
27
25
  @IsString()
28
- name?: string
26
+ name?: UpdateUserData['name']
29
27
 
30
28
  @IsOptional()
31
29
  @IsString()
32
- nickname?: string
30
+ nickname?: UpdateUserData['nickname']
33
31
 
34
32
  @IsOptional()
35
33
  @IsUrl()
36
- picture?: string
34
+ picture?: UpdateUserData['picture']
37
35
  }
@@ -1,9 +1,7 @@
1
- import { TransformFnParams } from 'class-transformer';
2
1
  export declare abstract class AppEntity {
3
2
  id: number;
4
- readonly createdAt: any;
5
- readonly updatedAt: any;
6
- readonly deletedAt: any;
7
- static transformSubCollection({ value }: TransformFnParams): string;
3
+ readonly createdAt: Date;
4
+ readonly updatedAt?: Date;
5
+ readonly deletedAt?: Date;
8
6
  }
9
7
  //# sourceMappingURL=app.entity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app.entity.d.ts","sourceRoot":"","sources":["app.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAGrD,8BAAsB,SAAS;IAEtB,EAAE,EAAE,MAAM,CAAA;IAEjB,SACgB,SAAS,MAAA;IAEzB,SACgB,SAAS,MAAA;IAEzB,SACgB,SAAS,MAAA;WAEX,sBAAsB,CAAE,EAAE,KAAK,EAAE,EAAE,iBAAiB,GAAG,MAAM;CAI5E"}
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,EAAE,IAAI,CAAA;IAE/B,SACgB,SAAS,CAAC,EAAE,IAAI,CAAA;IAEhC,SACgB,SAAS,CAAC,EAAE,IAAI,CAAA;CACjC"}
package/src/app.entity.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { TransformFnParams } from 'class-transformer'
2
1
  import { CreateDateColumn, DeleteDateColumn, PrimaryGeneratedColumn, UpdateDateColumn } from 'typeorm'
3
2
 
4
3
  export abstract class AppEntity {
@@ -6,16 +5,11 @@ export abstract class AppEntity {
6
5
  public id: number
7
6
 
8
7
  @CreateDateColumn()
9
- public readonly createdAt
8
+ public readonly createdAt: Date
10
9
 
11
10
  @UpdateDateColumn()
12
- public readonly updatedAt
11
+ public readonly updatedAt?: Date
13
12
 
14
13
  @DeleteDateColumn()
15
- public readonly deletedAt
16
-
17
- public static transformSubCollection ({ value }: TransformFnParams): string {
18
- return value.path
19
- }
20
-
14
+ public readonly deletedAt?: Date
21
15
  }
@@ -1,10 +1,10 @@
1
+ import { BrandEntity } from './brand.entity';
1
2
  export declare class FindBrandValidator {
2
3
  }
3
4
  export declare class CreateBrandValidator {
4
- name: string;
5
+ name: BrandEntity['name'];
5
6
  }
6
- export declare type IdBrandValidator = string;
7
7
  export declare class UpdateBrandValidator {
8
- name?: string;
8
+ name?: BrandEntity['name'];
9
9
  }
10
10
  //# sourceMappingURL=brand.validator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"brand.validator.d.ts","sourceRoot":"","sources":["brand.validator.ts"],"names":[],"mappings":"AAEA,qBAAa,kBAAkB;CAC9B;AAED,qBAAa,oBAAoB;IAE/B,IAAI,EAAE,MAAM,CAAA;CACb;AAED,oBAAY,gBAAgB,GAAG,MAAM,CAAA;AAErC,qBAAa,oBAAoB;IAG/B,IAAI,CAAC,EAAE,MAAM,CAAA;CACd"}
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,17 +1,16 @@
1
1
  import { IsOptional, IsString } from 'class-validator'
2
+ import { BrandEntity } from './brand.entity'
2
3
 
3
4
  export class FindBrandValidator {
4
5
  }
5
6
 
6
7
  export class CreateBrandValidator {
7
8
  @IsString()
8
- name: string
9
+ name: BrandEntity['name']
9
10
  }
10
11
 
11
- export type IdBrandValidator = string
12
-
13
12
  export class UpdateBrandValidator {
14
13
  @IsString()
15
14
  @IsOptional()
16
- name?: string
15
+ name?: BrandEntity['name']
17
16
  }
@@ -1,11 +1,11 @@
1
+ import { CategoryEntity } from './category.entity';
1
2
  export declare class FindCategoryValidator {
2
3
  }
3
4
  export declare class CreateCategoryValidator {
4
- name: string;
5
- description?: string;
5
+ name: CategoryEntity['name'];
6
+ description?: CategoryEntity['description'];
6
7
  }
7
- export declare type IdCategoryValidator = string;
8
8
  export declare class UpdateCategoryValidator {
9
- name: string;
9
+ name: CategoryEntity['name'];
10
10
  }
11
11
  //# sourceMappingURL=category.validator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"category.validator.d.ts","sourceRoot":"","sources":["category.validator.ts"],"names":[],"mappings":"AAEA,qBAAa,qBAAqB;CACjC;AAED,qBAAa,uBAAuB;IAElC,IAAI,EAAE,MAAM,CAAA;IAIZ,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED,oBAAY,mBAAmB,GAAG,MAAM,CAAA;AAExC,qBAAa,uBAAuB;IAElC,IAAI,EAAE,MAAM,CAAA;CACb"}
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,20 +1,19 @@
1
1
  import { IsOptional, IsString } from 'class-validator'
2
+ import { CategoryEntity } from './category.entity'
2
3
 
3
4
  export class FindCategoryValidator {
4
5
  }
5
6
 
6
7
  export class CreateCategoryValidator {
7
8
  @IsString()
8
- name: string
9
+ name: CategoryEntity['name']
9
10
 
10
11
  @IsString()
11
12
  @IsOptional()
12
- description?: string
13
+ description?: CategoryEntity['description']
13
14
  }
14
15
 
15
- export type IdCategoryValidator = string
16
-
17
16
  export class UpdateCategoryValidator {
18
17
  @IsString()
19
- name: string
18
+ name: CategoryEntity['name']
20
19
  }
@@ -1,6 +1,5 @@
1
1
  export declare class CreateMediaValidator {
2
2
  }
3
- export declare type IdMediaValidator = string;
4
3
  export declare class UpdateMediaValidator {
5
4
  }
6
5
  //# sourceMappingURL=media.validator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"media.validator.d.ts","sourceRoot":"","sources":["media.validator.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAoB;CAEhC;AAED,oBAAY,gBAAgB,GAAG,MAAM,CAAA;AAErC,qBAAa,oBAAoB;CAEhC"}
1
+ {"version":3,"file":"media.validator.d.ts","sourceRoot":"","sources":["media.validator.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAoB;CAEhC;AAED,qBAAa,oBAAoB;CAEhC"}
@@ -2,8 +2,6 @@ export class CreateMediaValidator {
2
2
 
3
3
  }
4
4
 
5
- export type IdMediaValidator = string
6
-
7
5
  export class UpdateMediaValidator {
8
6
 
9
7
  }
@@ -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,EAAE,YAAY,CAAwB;IAG1C,MAAM,EAAE,cAAc,CAAuB;IAG7C,aAAa,CAAC,EAAE,IAAI,CAAA;IAGpB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAGlB,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":"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"}
@@ -26,20 +26,20 @@ export class ProductEntity extends AppEntity {
26
26
  @Column({ length: 64 })
27
27
  public name: string
28
28
 
29
- @Column({ nullable: true })
29
+ @Column({ nullable: true, type: 'text' })
30
30
  public description?: string
31
31
 
32
32
  @Column({ type: 'enum', enum: PRODUCT_UNIT, default: PRODUCT_UNIT.QUANTITY })
33
- public unit: PRODUCT_UNIT = PRODUCT_UNIT.QUANTITY
33
+ public unit = PRODUCT_UNIT.QUANTITY
34
34
 
35
35
  @Column({ type: 'enum', enum: PRODUCT_STATUS, default: PRODUCT_STATUS.DRAFT })
36
- public status: PRODUCT_STATUS = PRODUCT_STATUS.DRAFT
36
+ public status = PRODUCT_STATUS.DRAFT
37
37
 
38
38
  @Column({ type: 'date', nullable: true })
39
39
  public availableFrom?: Date
40
40
 
41
41
  @Column('simple-array')
42
- public hashtags: string[]
42
+ public hashtags: string[] = []
43
43
 
44
44
  @ManyToOne(() => CategoryEntity, c => c.products, { eager: true })
45
45
  public category?: CategoryEntity
@@ -1,25 +1,23 @@
1
- import { PRODUCT_STATUS, PRODUCT_UNIT } from './product.entity';
1
+ import { ProductEntity } from './product.entity';
2
+ import { CreateVariantValidator } from './variants/variant.validator';
2
3
  export declare class FindProductValidator {
3
4
  }
4
5
  export declare class CreateProductValidator {
5
- name: string;
6
- price: number;
7
- description?: string;
6
+ name: ProductEntity['name'];
7
+ description?: ProductEntity['description'];
8
8
  category?: number;
9
9
  brand?: number;
10
- unit: PRODUCT_UNIT;
11
- status: PRODUCT_STATUS;
12
- hashtags: string[];
10
+ unit: ProductEntity['unit'];
11
+ hashtags: ProductEntity['hashtags'];
12
+ variants: CreateVariantValidator[];
13
13
  }
14
- export declare type IdProductValidator = number;
15
14
  export declare class UpdateProductValidator {
16
- name?: string;
17
- price?: number;
18
- description?: string;
15
+ name?: ProductEntity['name'];
16
+ description?: ProductEntity['description'];
19
17
  category?: number;
20
18
  brand?: number;
21
- unit?: PRODUCT_UNIT;
22
- status?: PRODUCT_STATUS;
23
- hashtags?: string[];
19
+ unit?: ProductEntity['unit'];
20
+ status?: ProductEntity['status'];
21
+ hashtags?: ProductEntity['hashtags'];
24
22
  }
25
23
  //# sourceMappingURL=product.validator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"product.validator.d.ts","sourceRoot":"","sources":["product.validator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/D,qBAAa,oBAAoB;CAEhC;AAED,qBAAa,sBAAsB;IAGjC,IAAI,EAAE,MAAM,CAAA;IAGZ,KAAK,EAAE,MAAM,CAAA;IAIb,WAAW,CAAC,EAAE,MAAM,CAAA;IAIpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IAIjB,KAAK,CAAC,EAAE,MAAM,CAAA;IAId,IAAI,EAAE,YAAY,CAAwB;IAI1C,MAAM,EAAE,cAAc,CAAuB;IAI7C,QAAQ,EAAE,MAAM,EAAE,CAAK;CACxB;AAED,oBAAY,kBAAkB,GAAG,MAAM,CAAA;AAEvC,qBAAa,sBAAsB;IAGjC,IAAI,CAAC,EAAE,MAAM,CAAA;IAIb,KAAK,CAAC,EAAE,MAAM,CAAA;IAId,WAAW,CAAC,EAAE,MAAM,CAAA;IAIpB,QAAQ,CAAC,EAAE,MAAM,CAAA;IAIjB,KAAK,CAAC,EAAE,MAAM,CAAA;IAId,IAAI,CAAC,EAAE,YAAY,CAAA;IAInB,MAAM,CAAC,EAAE,cAAc,CAAA;IAIvB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CACpB"}
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,21 +1,19 @@
1
- import { IsEnum, IsOptional, IsPositive, IsString } from 'class-validator'
2
- import { PRODUCT_STATUS, PRODUCT_UNIT } from './product.entity'
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'
4
+ import { CreateVariantValidator } from './variants/variant.validator'
3
5
 
4
6
  export class FindProductValidator {
5
7
 
6
8
  }
7
9
 
8
10
  export class CreateProductValidator {
9
-
10
11
  @IsString()
11
- name: string
12
-
13
- @IsPositive()
14
- price: number
12
+ name: ProductEntity['name']
15
13
 
16
14
  @IsString()
17
15
  @IsOptional()
18
- description?: string
16
+ description?: ProductEntity['description']
19
17
 
20
18
  @IsOptional()
21
19
  @IsPositive()
@@ -27,31 +25,26 @@ export class CreateProductValidator {
27
25
 
28
26
  @IsOptional()
29
27
  @IsEnum(PRODUCT_UNIT)
30
- unit: PRODUCT_UNIT = PRODUCT_UNIT.QUANTITY
31
-
32
- @IsOptional()
33
- @IsEnum(PRODUCT_STATUS)
34
- status: PRODUCT_STATUS = PRODUCT_STATUS.DRAFT
28
+ unit: ProductEntity['unit'] = PRODUCT_UNIT.QUANTITY
35
29
 
36
30
  @IsOptional()
37
31
  @IsString({ each: true })
38
- hashtags: string[] = []
39
- }
32
+ hashtags: ProductEntity['hashtags'] = []
40
33
 
41
- export type IdProductValidator = number
34
+ @ValidateNested({ each: true })
35
+ @ArrayMinSize(1)
36
+ @Type(() => CreateVariantValidator)
37
+ variants: CreateVariantValidator[] = []
38
+ }
42
39
 
43
40
  export class UpdateProductValidator {
44
41
  @IsString()
45
42
  @IsOptional()
46
- name?: string
47
-
48
- @IsPositive()
49
- @IsOptional()
50
- price?: number
43
+ name?: ProductEntity['name']
51
44
 
52
45
  @IsString()
53
46
  @IsOptional()
54
- description?: string
47
+ description?: ProductEntity['description']
55
48
 
56
49
  @IsOptional()
57
50
  @IsPositive()
@@ -63,13 +56,13 @@ export class UpdateProductValidator {
63
56
 
64
57
  @IsOptional()
65
58
  @IsEnum(PRODUCT_UNIT)
66
- unit?: PRODUCT_UNIT
59
+ unit?: ProductEntity['unit']
67
60
 
68
61
  @IsOptional()
69
62
  @IsEnum(PRODUCT_STATUS)
70
- status?: PRODUCT_STATUS
63
+ status?: ProductEntity['status']
71
64
 
72
65
  @IsOptional()
73
66
  @IsString({ each: true })
74
- hashtags?: string[]
67
+ hashtags?: ProductEntity['hashtags']
75
68
  }
@@ -1,8 +1,8 @@
1
1
  import { AppEntity } from '../../../app.entity';
2
2
  import { ProductEntity } from '../product.entity';
3
3
  export declare class VariantEntity extends AppEntity {
4
- name: string;
5
4
  price: number;
5
+ sku: string;
6
6
  quantity: number;
7
7
  master: boolean;
8
8
  product: ProductEntity;
@@ -1 +1 @@
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;IAGnC,IAAI,EAAE,MAAM,CAAA;IAGZ,KAAK,SAAI;IAGT,QAAQ,SAAI;IAGZ,MAAM,UAAQ;IAGd,OAAO,EAAE,aAAa,CAAA;CAC9B"}
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"}
@@ -4,13 +4,12 @@ import { ProductEntity } from '../product.entity'
4
4
 
5
5
  @Entity('inventory_products_variants')
6
6
  export class VariantEntity extends AppEntity {
7
-
8
- @Column({ length: 64 })
9
- public name: string
10
-
11
7
  @Column({ type: 'float', default: 0 })
12
8
  public price = 0
13
9
 
10
+ @Column({ unique: true })
11
+ public sku: string
12
+
14
13
  @Column({ type: 'int', default: 1 })
15
14
  public quantity = 1
16
15
 
@@ -1,6 +1,10 @@
1
+ import { VariantEntity } from './variant.entity';
1
2
  export declare class CreateVariantValidator {
3
+ price: VariantEntity['price'];
4
+ sku: VariantEntity['sku'];
5
+ quantity: VariantEntity['quantity'];
6
+ master: VariantEntity['master'];
2
7
  }
3
- export declare type IdVariantValidator = string;
4
8
  export declare class UpdateVariantValidator {
5
9
  }
6
10
  //# sourceMappingURL=variant.validator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"variant.validator.d.ts","sourceRoot":"","sources":["variant.validator.ts"],"names":[],"mappings":"AAAA,qBAAa,sBAAsB;CAElC;AAED,oBAAY,kBAAkB,GAAG,MAAM,CAAA;AAEvC,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;IAGvC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAQ;CAC/C;AAED,qBAAa,sBAAsB;CAElC"}
@@ -1,8 +1,20 @@
1
+ import { Allow, IsBoolean, IsOptional, IsPositive } from 'class-validator'
2
+ import { VariantEntity } from './variant.entity'
3
+
1
4
  export class CreateVariantValidator {
5
+ @IsPositive()
6
+ public price: VariantEntity['price']
2
7
 
3
- }
8
+ @Allow()
9
+ public sku: VariantEntity['sku']
4
10
 
5
- export type IdVariantValidator = string
11
+ @IsPositive()
12
+ @IsOptional()
13
+ public quantity: VariantEntity['quantity'] = 1
14
+
15
+ @IsBoolean()
16
+ public master: VariantEntity['master'] = false
17
+ }
6
18
 
7
19
  export class UpdateVariantValidator {
8
20
 
@@ -11,10 +11,10 @@ export class PropertyEntity extends AppEntity {
11
11
  @Column('simple-array')
12
12
  values: string[]
13
13
 
14
- @ManyToOne(() => CategoryEntity, null, { eager: true })
14
+ @ManyToOne(() => CategoryEntity)
15
15
  public category?: CategoryEntity
16
16
 
17
- @ManyToOne(() => ProductEntity, product => product.properties)
17
+ @ManyToOne(() => ProductEntity, p => p.properties)
18
18
  public products: ProductEntity[]
19
19
 
20
20
  }
@@ -1,12 +1,12 @@
1
+ import { PropertyEntity } from './property.entity';
1
2
  export declare class FindPropertyValidator {
2
3
  }
3
4
  export declare class CreatePropertyValidator {
4
- name: string;
5
- values?: string[];
5
+ name: PropertyEntity['name'];
6
+ values?: PropertyEntity['values'];
6
7
  }
7
- export declare type IdPropertyValidator = string;
8
8
  export declare class UpdatePropertyValidator {
9
- name?: string;
10
- values?: string[];
9
+ name?: PropertyEntity['name'];
10
+ values?: PropertyEntity['values'];
11
11
  }
12
12
  //# sourceMappingURL=property.validator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"property.validator.d.ts","sourceRoot":"","sources":["property.validator.ts"],"names":[],"mappings":"AAEA,qBAAa,qBAAqB;CAEjC;AAED,qBAAa,uBAAuB;IAElC,IAAI,EAAE,MAAM,CAAA;IAIZ,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,oBAAY,mBAAmB,GAAG,MAAM,CAAA;AAExC,qBAAa,uBAAuB;IAGlC,IAAI,CAAC,EAAE,MAAM,CAAA;IAIb,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAClB"}
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,4 +1,5 @@
1
1
  import { IsArray, IsOptional, IsString } from 'class-validator'
2
+ import { PropertyEntity } from './property.entity'
2
3
 
3
4
  export class FindPropertyValidator {
4
5
 
@@ -6,21 +7,19 @@ export class FindPropertyValidator {
6
7
 
7
8
  export class CreatePropertyValidator {
8
9
  @IsString()
9
- name: string
10
+ name: PropertyEntity['name']
10
11
 
11
12
  @IsArray()
12
13
  @IsOptional()
13
- values?: string[]
14
+ values?: PropertyEntity['values']
14
15
  }
15
16
 
16
- export type IdPropertyValidator = string
17
-
18
17
  export class UpdatePropertyValidator {
19
18
  @IsString()
20
19
  @IsOptional()
21
- name?: string
20
+ name?: PropertyEntity['name']
22
21
 
23
22
  @IsArray()
24
23
  @IsOptional()
25
- values?: string[]
24
+ values?: PropertyEntity['values']
26
25
  }
@@ -2,7 +2,6 @@ export declare class FindCartValidator {
2
2
  }
3
3
  export declare class CreateCartValidator {
4
4
  }
5
- export declare type IdCartValidator = string;
6
5
  export declare class UpdateCartValidator {
7
6
  }
8
7
  //# sourceMappingURL=cart.validator.d.ts.map
@@ -1 +1 @@
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,oBAAY,eAAe,GAAG,MAAM,CAAA;AAEpC,qBAAa,mBAAmB;CAC/B"}
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"}
@@ -4,7 +4,5 @@ export class FindCartValidator {
4
4
  export class CreateCartValidator {
5
5
  }
6
6
 
7
- export type IdCartValidator = string
8
-
9
7
  export class UpdateCartValidator {
10
8
  }
@@ -1,6 +1,5 @@
1
1
  export declare class CreateItemValidator {
2
2
  }
3
- export declare type IdItemValidator = string;
4
3
  export declare class UpdateItemValidator {
5
4
  }
6
5
  //# sourceMappingURL=item.validator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"item.validator.d.ts","sourceRoot":"","sources":["item.validator.ts"],"names":[],"mappings":"AAAA,qBAAa,mBAAmB;CAE/B;AAED,oBAAY,eAAe,GAAG,MAAM,CAAA;AAEpC,qBAAa,mBAAmB;CAE/B"}
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"}
@@ -2,8 +2,6 @@ export class CreateItemValidator {
2
2
 
3
3
  }
4
4
 
5
- export type IdItemValidator = string
6
-
7
5
  export class UpdateItemValidator {
8
6
 
9
7
  }
@@ -2,7 +2,6 @@ export declare class FindOrderValidator {
2
2
  }
3
3
  export declare class CreateOrderValidator {
4
4
  }
5
- export declare type IdOrderValidator = string;
6
5
  export declare class UpdateOrderValidator {
7
6
  }
8
7
  //# sourceMappingURL=order.validator.d.ts.map
@@ -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,oBAAY,gBAAgB,GAAG,MAAM,CAAA;AAErC,qBAAa,oBAAoB;CAEhC"}
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"}
@@ -6,8 +6,6 @@ export class CreateOrderValidator {
6
6
 
7
7
  }
8
8
 
9
- export type IdOrderValidator = string
10
-
11
9
  export class UpdateOrderValidator {
12
10
 
13
11
  }