test-entity-library-asm 1.1.8 → 1.2.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 (103) hide show
  1. package/dist/entities/Category.d.ts +5 -3
  2. package/dist/entities/Category.js +38 -13
  3. package/dist/entities/CategorySchedule.d.ts +10 -0
  4. package/dist/entities/CategorySchedule.js +67 -0
  5. package/dist/entities/City.d.ts +3 -2
  6. package/dist/entities/City.js +35 -10
  7. package/dist/entities/CodeRedemptionHistoryCompany.d.ts +4 -3
  8. package/dist/entities/CodeRedemptionHistoryCompany.js +31 -10
  9. package/dist/entities/CodeRedemptionHistoryUser.js +13 -6
  10. package/dist/entities/Company.d.ts +2 -1
  11. package/dist/entities/Company.js +64 -26
  12. package/dist/entities/Configuration.d.ts +2 -1
  13. package/dist/entities/Configuration.js +26 -4
  14. package/dist/entities/Country.d.ts +2 -1
  15. package/dist/entities/Country.js +33 -11
  16. package/dist/entities/Day.d.ts +2 -1
  17. package/dist/entities/Day.js +31 -6
  18. package/dist/entities/DiscountCodeCompany.d.ts +2 -1
  19. package/dist/entities/DiscountCodeCompany.js +42 -12
  20. package/dist/entities/DiscountCodeUser.js +24 -13
  21. package/dist/entities/Local.d.ts +14 -2
  22. package/dist/entities/Local.js +73 -13
  23. package/dist/entities/LocalQualification.d.ts +10 -0
  24. package/dist/entities/LocalQualification.js +76 -0
  25. package/dist/entities/Master.d.ts +2 -1
  26. package/dist/entities/Master.js +26 -4
  27. package/dist/entities/PaymentMethod.d.ts +13 -0
  28. package/dist/entities/PaymentMethod.js +102 -0
  29. package/dist/entities/Permission.d.ts +2 -1
  30. package/dist/entities/Permission.js +32 -8
  31. package/dist/entities/Plan.d.ts +2 -1
  32. package/dist/entities/Plan.js +38 -10
  33. package/dist/entities/Product.d.ts +8 -1
  34. package/dist/entities/Product.js +62 -12
  35. package/dist/entities/ProductGroup.js +16 -8
  36. package/dist/entities/ProductIngredient.d.ts +12 -0
  37. package/dist/entities/ProductIngredient.js +84 -0
  38. package/dist/entities/ProductTopping.d.ts +2 -1
  39. package/dist/entities/ProductTopping.js +33 -7
  40. package/dist/entities/Region.d.ts +3 -2
  41. package/dist/entities/Region.js +40 -10
  42. package/dist/entities/Request.d.ts +21 -0
  43. package/dist/entities/Request.js +137 -0
  44. package/dist/entities/RequestProduct.d.ts +12 -0
  45. package/dist/entities/RequestProduct.js +85 -0
  46. package/dist/entities/RequestProductGroupComplement.d.ts +11 -0
  47. package/dist/entities/RequestProductGroupComplement.js +80 -0
  48. package/dist/entities/RequestStatus.d.ts +11 -0
  49. package/dist/entities/RequestStatus.js +85 -0
  50. package/dist/entities/Role.js +11 -4
  51. package/dist/entities/RoleVisibleTo.d.ts +2 -1
  52. package/dist/entities/RoleVisibleTo.js +30 -5
  53. package/dist/entities/Square.d.ts +13 -0
  54. package/dist/entities/Square.js +97 -0
  55. package/dist/entities/Terminal.d.ts +2 -0
  56. package/dist/entities/Terminal.js +21 -4
  57. package/dist/entities/TerminalSession.d.ts +3 -2
  58. package/dist/entities/TerminalSession.js +41 -8
  59. package/dist/entities/TypeFood.d.ts +2 -1
  60. package/dist/entities/TypeFood.js +41 -6
  61. package/dist/entities/TypeMeasureIngredient.d.ts +9 -0
  62. package/dist/entities/TypeMeasureIngredient.js +73 -0
  63. package/dist/entities/User.d.ts +17 -7
  64. package/dist/entities/User.js +104 -25
  65. package/dist/entities/productGroupComplement.d.ts +4 -1
  66. package/dist/entities/productGroupComplement.js +35 -8
  67. package/package.json +1 -1
  68. package/src/entities/Category.ts +33 -15
  69. package/src/entities/CategorySchedule.ts +35 -0
  70. package/src/entities/City.ts +18 -8
  71. package/src/entities/CodeRedemptionHistoryCompany.ts +17 -9
  72. package/src/entities/CodeRedemptionHistoryUser.ts +15 -6
  73. package/src/entities/Company.ts +51 -25
  74. package/src/entities/Configuration.ts +10 -4
  75. package/src/entities/Country.ts +23 -11
  76. package/src/entities/Day.ts +16 -6
  77. package/src/entities/DiscountCodeCompany.ts +26 -11
  78. package/src/entities/DiscountCodeUser.ts +25 -12
  79. package/src/entities/Local.ts +54 -12
  80. package/src/entities/LocalQualification.ts +45 -0
  81. package/src/entities/Master.ts +17 -4
  82. package/src/entities/PaymentMethod.ts +72 -0
  83. package/src/entities/Permission.ts +16 -7
  84. package/src/entities/Plan.ts +22 -9
  85. package/src/entities/Product.ts +47 -11
  86. package/src/entities/ProductGroup.ts +18 -8
  87. package/src/entities/ProductIngredient.ts +55 -0
  88. package/src/entities/ProductTopping.ts +17 -6
  89. package/src/entities/Region.ts +24 -8
  90. package/src/entities/Request.ts +107 -0
  91. package/src/entities/RequestProduct.ts +51 -0
  92. package/src/entities/RequestProductGroupComplement.ts +55 -0
  93. package/src/entities/RequestStatus.ts +55 -0
  94. package/src/entities/Role.ts +12 -4
  95. package/src/entities/RoleVisibleTo.ts +13 -4
  96. package/src/entities/Square.ts +56 -0
  97. package/src/entities/Terminal.ts +24 -4
  98. package/src/entities/TerminalSession.ts +28 -10
  99. package/src/entities/TypeFood.ts +26 -5
  100. package/src/entities/TypeMeasureIngredient.ts +46 -0
  101. package/src/entities/User.ts +93 -28
  102. package/src/entities/productGroupComplement.ts +23 -7
  103. package/src/entities/ScheduleCategory.ts +0 -32
@@ -1,4 +1,19 @@
1
1
  "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
2
17
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
18
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
19
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -12,11 +27,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
27
  exports.Master = void 0;
13
28
  var typeorm_1 = require("typeorm");
14
29
  var User_1 = require("./User");
15
- var Master = /** @class */ (function () {
30
+ var Master = /** @class */ (function (_super) {
31
+ __extends(Master, _super);
16
32
  function Master() {
33
+ return _super !== null && _super.apply(this, arguments) || this;
17
34
  }
18
35
  __decorate([
19
- (0, typeorm_1.PrimaryColumn)(),
36
+ (0, typeorm_1.PrimaryColumn)({
37
+ comment: 'Número de identificación (ID) único de cada registro.',
38
+ }),
20
39
  __metadata("design:type", Number)
21
40
  ], Master.prototype, "id", void 0);
22
41
  __decorate([
@@ -25,12 +44,15 @@ var Master = /** @class */ (function () {
25
44
  __metadata("design:type", User_1.User)
26
45
  ], Master.prototype, "user", void 0);
27
46
  __decorate([
28
- (0, typeorm_1.Column)({ default: 1 }),
47
+ (0, typeorm_1.Column)({
48
+ default: 1,
49
+ comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
50
+ }),
29
51
  __metadata("design:type", Number)
30
52
  ], Master.prototype, "status", void 0);
31
53
  Master = __decorate([
32
54
  (0, typeorm_1.Entity)()
33
55
  ], Master);
34
56
  return Master;
35
- }());
57
+ }(typeorm_1.BaseEntity));
36
58
  exports.Master = Master;
@@ -0,0 +1,13 @@
1
+ import { BaseEntity } from 'typeorm';
2
+ import { Local } from './Local';
3
+ import { Request } from './Request';
4
+ export declare class PaymentMethod extends BaseEntity {
5
+ id: number;
6
+ name: string;
7
+ description: string;
8
+ settings: string;
9
+ created: Date;
10
+ status: number;
11
+ locals: Local[];
12
+ requests: Request[];
13
+ }
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __metadata = (this && this.__metadata) || function (k, v) {
24
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.PaymentMethod = void 0;
28
+ var typeorm_1 = require("typeorm");
29
+ var Local_1 = require("./Local");
30
+ var Request_1 = require("./Request");
31
+ var PaymentMethod = /** @class */ (function (_super) {
32
+ __extends(PaymentMethod, _super);
33
+ function PaymentMethod() {
34
+ return _super !== null && _super.apply(this, arguments) || this;
35
+ }
36
+ __decorate([
37
+ (0, typeorm_1.PrimaryColumn)({
38
+ comment: 'Número de identificación (ID) único de cada registro.',
39
+ }),
40
+ __metadata("design:type", Number)
41
+ ], PaymentMethod.prototype, "id", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)({
44
+ length: 50,
45
+ comment: 'Nombre del estado, este campo debe tener el id/key de cada lenguaje. \r\n\r\nVer la carpeta locales del proyecto frontend para ver el id de cada tipo de elemento.',
46
+ }),
47
+ __metadata("design:type", String)
48
+ ], PaymentMethod.prototype, "name", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.Column)({
51
+ length: 50,
52
+ nullable: true,
53
+ comment: 'Descripción del estado, este campo debe tener el id/key de cada lenguaje. \r\n\r\nVer la carpeta locales del proyecto frontend para ver el id de cada tipo de elemento.',
54
+ }),
55
+ __metadata("design:type", String)
56
+ ], PaymentMethod.prototype, "description", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.Column)({
59
+ type: 'longtext',
60
+ nullable: true,
61
+ comment: 'Campo de tipo JSON donde se pueden agregar columnas u otros elementos que sean necesarios.',
62
+ }),
63
+ __metadata("design:type", String)
64
+ ], PaymentMethod.prototype, "settings", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.Column)({ type: 'datetime', comment: 'Fecha de creación del registro.' }),
67
+ __metadata("design:type", Date)
68
+ ], PaymentMethod.prototype, "created", void 0);
69
+ __decorate([
70
+ (0, typeorm_1.Column)({
71
+ default: 1,
72
+ comment: 'Valida si el estado es visible para mostrar al cliente (local/company): \r\n1. Activo. \r\n0. Inactivo.',
73
+ }),
74
+ __metadata("design:type", Number)
75
+ ], PaymentMethod.prototype, "status", void 0);
76
+ __decorate([
77
+ (0, typeorm_1.ManyToMany)(function () { return Local_1.Local; }),
78
+ (0, typeorm_1.JoinTable)({
79
+ name: 'local_payment_method',
80
+ joinColumn: {
81
+ name: 'local',
82
+ referencedColumnName: 'id',
83
+ },
84
+ inverseJoinColumn: {
85
+ name: 'payment_method',
86
+ referencedColumnName: 'id',
87
+ },
88
+ }),
89
+ __metadata("design:type", Array)
90
+ ], PaymentMethod.prototype, "locals", void 0);
91
+ __decorate([
92
+ (0, typeorm_1.OneToMany)(function () { return Request_1.Request; }, function (request) { return request.payment_method; }),
93
+ __metadata("design:type", Array)
94
+ ], PaymentMethod.prototype, "requests", void 0);
95
+ PaymentMethod = __decorate([
96
+ (0, typeorm_1.Entity)('payment_method', {
97
+ comment: 'Métodos de pago qué la plataforma tendrá disponible, estos serán visibles cuando un cliente (local) desee agregarlos para que se vean en los pedidos.',
98
+ })
99
+ ], PaymentMethod);
100
+ return PaymentMethod;
101
+ }(typeorm_1.BaseEntity));
102
+ exports.PaymentMethod = PaymentMethod;
@@ -1,5 +1,6 @@
1
+ import { BaseEntity } from 'typeorm';
1
2
  import { Role } from './Role';
2
- export declare class Permission {
3
+ export declare class Permission extends BaseEntity {
3
4
  id: number;
4
5
  code: string;
5
6
  name: string;
@@ -1,4 +1,19 @@
1
1
  "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
2
17
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
18
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
19
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -12,33 +27,40 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
27
  exports.Permission = void 0;
13
28
  var typeorm_1 = require("typeorm");
14
29
  var Role_1 = require("./Role");
15
- var Permission = /** @class */ (function () {
30
+ var Permission = /** @class */ (function (_super) {
31
+ __extends(Permission, _super);
16
32
  function Permission() {
33
+ return _super !== null && _super.apply(this, arguments) || this;
17
34
  }
18
35
  __decorate([
19
- (0, typeorm_1.PrimaryGeneratedColumn)(),
36
+ (0, typeorm_1.PrimaryGeneratedColumn)({
37
+ comment: 'Número de identificación (ID) único de cada registro.',
38
+ }),
20
39
  __metadata("design:type", Number)
21
40
  ], Permission.prototype, "id", void 0);
22
41
  __decorate([
23
- (0, typeorm_1.Column)({ length: 10, unique: true }),
42
+ (0, typeorm_1.Column)({ length: 10, unique: true, comment: 'Código del permiso.' }),
24
43
  __metadata("design:type", String)
25
44
  ], Permission.prototype, "code", void 0);
26
45
  __decorate([
27
46
  (0, typeorm_1.Column)({
28
47
  length: 40,
29
- comment: 'Id de la variable que se encuentra en los archivos "locale" para el multilenguaje.',
48
+ comment: 'Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.',
30
49
  }),
31
50
  __metadata("design:type", String)
32
51
  ], Permission.prototype, "name", void 0);
33
52
  __decorate([
34
53
  (0, typeorm_1.Column)({
35
54
  length: 40,
36
- comment: 'Id de la variable que se encuentra en los archivos "locale" para el multilenguaje.',
55
+ comment: 'Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.',
37
56
  }),
38
57
  __metadata("design:type", String)
39
58
  ], Permission.prototype, "description", void 0);
40
59
  __decorate([
41
- (0, typeorm_1.Column)({ default: 1 }),
60
+ (0, typeorm_1.Column)({
61
+ default: 1,
62
+ comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
63
+ }),
42
64
  __metadata("design:type", Number)
43
65
  ], Permission.prototype, "status", void 0);
44
66
  __decorate([
@@ -49,8 +71,10 @@ var Permission = /** @class */ (function () {
49
71
  __metadata("design:type", Array)
50
72
  ], Permission.prototype, "roles", void 0);
51
73
  Permission = __decorate([
52
- (0, typeorm_1.Entity)()
74
+ (0, typeorm_1.Entity)('permission', {
75
+ comment: 'Permisos que va a tener cada rol.',
76
+ })
53
77
  ], Permission);
54
78
  return Permission;
55
- }());
79
+ }(typeorm_1.BaseEntity));
56
80
  exports.Permission = Permission;
@@ -1,6 +1,7 @@
1
+ import { BaseEntity } from 'typeorm';
1
2
  import { User } from './User';
2
3
  import { Company } from './Company';
3
- export declare class Plan {
4
+ export declare class Plan extends BaseEntity {
4
5
  id: number;
5
6
  code: string;
6
7
  name: string;
@@ -1,4 +1,19 @@
1
1
  "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
2
17
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
18
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
19
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -13,21 +28,25 @@ exports.Plan = void 0;
13
28
  var typeorm_1 = require("typeorm");
14
29
  var User_1 = require("./User");
15
30
  var Company_1 = require("./Company");
16
- var Plan = /** @class */ (function () {
31
+ var Plan = /** @class */ (function (_super) {
32
+ __extends(Plan, _super);
17
33
  function Plan() {
34
+ return _super !== null && _super.apply(this, arguments) || this;
18
35
  }
19
36
  __decorate([
20
- (0, typeorm_1.PrimaryGeneratedColumn)(),
37
+ (0, typeorm_1.PrimaryGeneratedColumn)({
38
+ comment: 'Número de identificación (ID) único de cada registro.',
39
+ }),
21
40
  __metadata("design:type", Number)
22
41
  ], Plan.prototype, "id", void 0);
23
42
  __decorate([
24
- (0, typeorm_1.Column)({ length: 20, unique: true }),
43
+ (0, typeorm_1.Column)({ length: 20, unique: true, comment: 'Código del plan.' }),
25
44
  __metadata("design:type", String)
26
45
  ], Plan.prototype, "code", void 0);
27
46
  __decorate([
28
47
  (0, typeorm_1.Column)({
29
48
  length: 50,
30
- comment: 'Id de la variable que se encuentra en los archivos "locale" para el multilenguaje.',
49
+ comment: 'Id de la variable que se encuentra en los archivos `locale` para el multilenguaje.',
31
50
  }),
32
51
  __metadata("design:type", String)
33
52
  ], Plan.prototype, "name", void 0);
@@ -47,20 +66,27 @@ var Plan = /** @class */ (function () {
47
66
  __metadata("design:type", Number)
48
67
  ], Plan.prototype, "customized", void 0);
49
68
  __decorate([
50
- (0, typeorm_1.Column)({ type: 'datetime' }),
69
+ (0, typeorm_1.Column)({ type: 'datetime', comment: 'Fecha de creación del registro.' }),
51
70
  __metadata("design:type", Date)
52
71
  ], Plan.prototype, "created", void 0);
53
72
  __decorate([
54
- (0, typeorm_1.Column)({ type: 'date' }),
73
+ (0, typeorm_1.Column)({ type: 'date', comment: 'Fecha de expiración del registro.' }),
55
74
  __metadata("design:type", Date)
56
75
  ], Plan.prototype, "expiration", void 0);
57
76
  __decorate([
58
- (0, typeorm_1.ManyToOne)(function () { return User_1.User; }, function (user) { return user.plans; }, { nullable: true }),
77
+ (0, typeorm_1.ManyToOne)(function () { return User_1.User; }, function (user) { return user.plans; }, {
78
+ nullable: true,
79
+ onDelete: 'RESTRICT',
80
+ onUpdate: 'NO ACTION',
81
+ }),
59
82
  (0, typeorm_1.JoinColumn)({ name: 'created_by' }),
60
83
  __metadata("design:type", User_1.User)
61
84
  ], Plan.prototype, "created_by", void 0);
62
85
  __decorate([
63
- (0, typeorm_1.Column)({ default: 1 }),
86
+ (0, typeorm_1.Column)({
87
+ default: 1,
88
+ comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
89
+ }),
64
90
  __metadata("design:type", Number)
65
91
  ], Plan.prototype, "status", void 0);
66
92
  __decorate([
@@ -68,8 +94,10 @@ var Plan = /** @class */ (function () {
68
94
  __metadata("design:type", Array)
69
95
  ], Plan.prototype, "companies", void 0);
70
96
  Plan = __decorate([
71
- (0, typeorm_1.Entity)()
97
+ (0, typeorm_1.Entity)({
98
+ comment: 'Planes que tendrá la plataforma para las empresas (company)',
99
+ })
72
100
  ], Plan);
73
101
  return Plan;
74
- }());
102
+ }(typeorm_1.BaseEntity));
75
103
  exports.Plan = Plan;
@@ -1,8 +1,13 @@
1
+ import { BaseEntity } from 'typeorm';
1
2
  import { Local } from './Local';
2
3
  import { ProductGroup } from './ProductGroup';
3
- export declare class Product {
4
+ import { Category } from './Category';
5
+ import { ProductIngredient } from './ProductIngredient';
6
+ import { RequestProduct } from './RequestProduct';
7
+ export declare class Product extends BaseEntity {
4
8
  id: number;
5
9
  local: Local;
10
+ category: Category;
6
11
  name: string;
7
12
  details: string;
8
13
  price: string;
@@ -14,4 +19,6 @@ export declare class Product {
14
19
  created: Date;
15
20
  updated: Date;
16
21
  product_groups: ProductGroup[];
22
+ product_ingredients: ProductIngredient[];
23
+ request_products: RequestProduct[];
17
24
  }
@@ -1,4 +1,19 @@
1
1
  "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
2
17
  var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
18
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
19
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -13,28 +28,49 @@ exports.Product = void 0;
13
28
  var typeorm_1 = require("typeorm");
14
29
  var Local_1 = require("./Local");
15
30
  var ProductGroup_1 = require("./ProductGroup");
16
- var Product = /** @class */ (function () {
31
+ var Category_1 = require("./Category");
32
+ var ProductIngredient_1 = require("./ProductIngredient");
33
+ var RequestProduct_1 = require("./RequestProduct");
34
+ var Product = /** @class */ (function (_super) {
35
+ __extends(Product, _super);
17
36
  function Product() {
37
+ return _super !== null && _super.apply(this, arguments) || this;
18
38
  }
19
39
  __decorate([
20
- (0, typeorm_1.PrimaryGeneratedColumn)(),
40
+ (0, typeorm_1.PrimaryGeneratedColumn)({
41
+ comment: 'Número de identificación (ID) único de cada registro.',
42
+ }),
21
43
  __metadata("design:type", Number)
22
44
  ], Product.prototype, "id", void 0);
23
45
  __decorate([
24
- (0, typeorm_1.ManyToOne)(function () { return Local_1.Local; }, function (local) { return local.products; }),
46
+ (0, typeorm_1.ManyToOne)(function () { return Local_1.Local; }, function (local) { return local.products; }, {
47
+ onDelete: 'CASCADE',
48
+ onUpdate: 'NO ACTION',
49
+ }),
25
50
  (0, typeorm_1.JoinColumn)({ name: 'local' }),
26
51
  __metadata("design:type", Local_1.Local)
27
52
  ], Product.prototype, "local", void 0);
28
53
  __decorate([
29
- (0, typeorm_1.Column)({ length: 50 }),
54
+ (0, typeorm_1.ManyToOne)(function () { return Category_1.Category; }, function (category) { return category.products; }, {
55
+ onDelete: 'CASCADE',
56
+ onUpdate: 'NO ACTION',
57
+ }),
58
+ (0, typeorm_1.JoinColumn)({ name: 'category' }),
59
+ __metadata("design:type", Category_1.Category)
60
+ ], Product.prototype, "category", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.Column)({ length: 50, comment: 'Nombre del producto.' }),
30
63
  __metadata("design:type", String)
31
64
  ], Product.prototype, "name", void 0);
32
65
  __decorate([
33
- (0, typeorm_1.Column)({ length: 400 }),
66
+ (0, typeorm_1.Column)({
67
+ length: 400,
68
+ comment: 'Detalles del producto. \n\n ¿Qué contiene?',
69
+ }),
34
70
  __metadata("design:type", String)
35
71
  ], Product.prototype, "details", void 0);
36
72
  __decorate([
37
- (0, typeorm_1.Column)({ length: 20 }),
73
+ (0, typeorm_1.Column)({ length: 20, comment: 'Precio del producto.' }),
38
74
  __metadata("design:type", String)
39
75
  ], Product.prototype, "price", void 0);
40
76
  __decorate([
@@ -52,7 +88,7 @@ var Product = /** @class */ (function () {
52
88
  __metadata("design:type", Number)
53
89
  ], Product.prototype, "combo", void 0);
54
90
  __decorate([
55
- (0, typeorm_1.Column)(),
91
+ (0, typeorm_1.Column)({ comment: 'En qué posición se va a mostrar el producto.' }),
56
92
  __metadata("design:type", Number)
57
93
  ], Product.prototype, "position", void 0);
58
94
  __decorate([
@@ -64,24 +100,38 @@ var Product = /** @class */ (function () {
64
100
  __metadata("design:type", String)
65
101
  ], Product.prototype, "photo", void 0);
66
102
  __decorate([
67
- (0, typeorm_1.Column)({ type: 'mediumtext', nullable: true }),
103
+ (0, typeorm_1.Column)({
104
+ type: 'mediumtext',
105
+ nullable: true,
106
+ comment: 'Campo de tipo JSON donde se guarda información necesaria para el registro.',
107
+ }),
68
108
  __metadata("design:type", String)
69
109
  ], Product.prototype, "additional_information", void 0);
70
110
  __decorate([
71
- (0, typeorm_1.Column)({ type: 'datetime' }),
111
+ (0, typeorm_1.Column)({ type: 'datetime', comment: 'Fecha de creación del registro.' }),
72
112
  __metadata("design:type", Date)
73
113
  ], Product.prototype, "created", void 0);
74
114
  __decorate([
75
- (0, typeorm_1.Column)({ type: 'datetime' }),
115
+ (0, typeorm_1.Column)({ type: 'datetime', comment: 'Fecha de actualización del registro.' }),
76
116
  __metadata("design:type", Date)
77
117
  ], Product.prototype, "updated", void 0);
78
118
  __decorate([
79
119
  (0, typeorm_1.OneToMany)(function () { return ProductGroup_1.ProductGroup; }, function (productGroup) { return productGroup.product; }),
80
120
  __metadata("design:type", Array)
81
121
  ], Product.prototype, "product_groups", void 0);
122
+ __decorate([
123
+ (0, typeorm_1.OneToMany)(function () { return ProductIngredient_1.ProductIngredient; }, function (productIngredient) { return productIngredient.product; }),
124
+ __metadata("design:type", Array)
125
+ ], Product.prototype, "product_ingredients", void 0);
126
+ __decorate([
127
+ (0, typeorm_1.OneToMany)(function () { return RequestProduct_1.RequestProduct; }, function (requestProduct) { return requestProduct.product; }),
128
+ __metadata("design:type", Array)
129
+ ], Product.prototype, "request_products", void 0);
82
130
  Product = __decorate([
83
- (0, typeorm_1.Entity)()
131
+ (0, typeorm_1.Entity)({
132
+ comment: 'Productos qué serán visibles a los usuarios, estos están asociados a un local.',
133
+ })
84
134
  ], Product);
85
135
  return Product;
86
- }());
136
+ }(typeorm_1.BaseEntity));
87
137
  exports.Product = Product;
@@ -18,34 +18,42 @@ var ProductGroup = /** @class */ (function () {
18
18
  function ProductGroup() {
19
19
  }
20
20
  __decorate([
21
- (0, typeorm_1.PrimaryGeneratedColumn)(),
21
+ (0, typeorm_1.PrimaryGeneratedColumn)({
22
+ comment: 'Número de identificación (ID) único de cada registro.',
23
+ }),
22
24
  __metadata("design:type", Number)
23
25
  ], ProductGroup.prototype, "id", void 0);
24
26
  __decorate([
25
- (0, typeorm_1.ManyToOne)(function () { return Product_1.Product; }, function (product) { return product.product_groups; }),
27
+ (0, typeorm_1.ManyToOne)(function () { return Product_1.Product; }, function (product) { return product.product_groups; }, {
28
+ onDelete: 'CASCADE',
29
+ onUpdate: 'NO ACTION',
30
+ }),
26
31
  (0, typeorm_1.JoinColumn)({ name: 'product' }),
27
32
  __metadata("design:type", Product_1.Product)
28
33
  ], ProductGroup.prototype, "product", void 0);
29
34
  __decorate([
30
- (0, typeorm_1.ManyToOne)(function () { return ProductTopping_1.ProductTopping; }, function (productTopping) { return productTopping.product_groups; }),
35
+ (0, typeorm_1.ManyToOne)(function () { return ProductTopping_1.ProductTopping; }, function (productTopping) { return productTopping.product_groups; }, {
36
+ onDelete: 'CASCADE',
37
+ onUpdate: 'NO ACTION',
38
+ }),
31
39
  (0, typeorm_1.JoinColumn)({ name: 'topping' }),
32
40
  __metadata("design:type", ProductTopping_1.ProductTopping)
33
41
  ], ProductGroup.prototype, "topping", void 0);
34
42
  __decorate([
35
- (0, typeorm_1.Column)({ length: 30 }),
43
+ (0, typeorm_1.Column)({ length: 30, comment: 'Nombre del grupo.' }),
36
44
  __metadata("design:type", String)
37
45
  ], ProductGroup.prototype, "name", void 0);
38
46
  __decorate([
39
47
  (0, typeorm_1.Column)({
40
48
  default: 1,
41
- comment: 'El "type" se refiere a si el grupo es opcional o si es requerido:\r\n1. Opcional.\r\n2. Requerido.',
49
+ comment: 'El `type` se refiere a si el grupo es opcional o si es requerido:\r\n1. Opcional.\r\n2. Requerido.',
42
50
  }),
43
51
  __metadata("design:type", Number)
44
52
  ], ProductGroup.prototype, "type", void 0);
45
53
  __decorate([
46
54
  (0, typeorm_1.Column)({
47
55
  default: 0,
48
- comment: 'Cantidad mínima que el usuario puede agregar para el grupo.\r\n\r\n- Cuando "type" es "Requerido (2)" entonces la cantidad mínima debería ser 1.\r\n\r\n- Cuando "type" es "Opcional (1)" entonces la cantidad puede ser 0.',
56
+ comment: 'Cantidad mínima que el usuario puede agregar para el grupo.\r\n\r\n- Cuando `type` es `Requerido (2)` entonces la cantidad mínima debería ser 1.\r\n\r\n- Cuando `type` es `Opcional (1)` entonces la cantidad puede ser 0.',
49
57
  }),
50
58
  __metadata("design:type", Number)
51
59
  ], ProductGroup.prototype, "minimum_quantity", void 0);
@@ -57,7 +65,7 @@ var ProductGroup = /** @class */ (function () {
57
65
  __metadata("design:type", Number)
58
66
  ], ProductGroup.prototype, "maximum_quantity", void 0);
59
67
  __decorate([
60
- (0, typeorm_1.Column)(),
68
+ (0, typeorm_1.Column)({ comment: 'El orden en que aparece los grupos en el producto.' }),
61
69
  __metadata("design:type", Number)
62
70
  ], ProductGroup.prototype, "position", void 0);
63
71
  __decorate([
@@ -66,7 +74,7 @@ var ProductGroup = /** @class */ (function () {
66
74
  ], ProductGroup.prototype, "groups_complement", void 0);
67
75
  ProductGroup = __decorate([
68
76
  (0, typeorm_1.Entity)('product_group', {
69
- comment: 'Grupos para agregar al topping por producto',
77
+ comment: 'Grupos para agregar al topping por producto.\r\n\r\nEstos elementos que se agreguen acá estarán visibles para los usuarios en la APP.',
70
78
  })
71
79
  ], ProductGroup);
72
80
  return ProductGroup;
@@ -0,0 +1,12 @@
1
+ import { BaseEntity } from 'typeorm';
2
+ import { Product } from './Product';
3
+ import { TypeMeasureIngredient } from './TypeMeasureIngredient';
4
+ export declare class ProductIngredient extends BaseEntity {
5
+ id: number;
6
+ product: Product;
7
+ name: string;
8
+ type_measure_ingredient: TypeMeasureIngredient;
9
+ quantity: number;
10
+ created: Date;
11
+ status: number;
12
+ }