test-entity-library-asm 1.1.9 → 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 -18
  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 +33 -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 -17
  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 +18 -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,48 +27,55 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
27
  exports.Country = void 0;
13
28
  var typeorm_1 = require("typeorm");
14
29
  var Region_1 = require("./Region");
15
- var Country = /** @class */ (function () {
30
+ var Country = /** @class */ (function (_super) {
31
+ __extends(Country, _super);
16
32
  function Country() {
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
  ], Country.prototype, "id", void 0);
22
41
  __decorate([
23
- (0, typeorm_1.Column)({ length: 10 }),
42
+ (0, typeorm_1.Column)({ length: 10, comment: 'Código del país.' }),
24
43
  __metadata("design:type", String)
25
44
  ], Country.prototype, "code", void 0);
26
45
  __decorate([
27
- (0, typeorm_1.Column)({ length: 50 }),
46
+ (0, typeorm_1.Column)({ length: 50, comment: 'Nombre del país.' }),
28
47
  __metadata("design:type", String)
29
48
  ], Country.prototype, "name", void 0);
30
49
  __decorate([
31
50
  (0, typeorm_1.Column)({
32
51
  length: 10,
33
- comment: 'Usamos esta columna para saber la moneda del país y sugerírsela al usuario o al local',
52
+ comment: 'Usamos esta columna para saber la moneda del país y sugerírsela al usuario o al local.',
34
53
  }),
35
54
  __metadata("design:type", String)
36
55
  ], Country.prototype, "currency", void 0);
37
56
  __decorate([
38
- (0, typeorm_1.Column)({ length: 10 }),
57
+ (0, typeorm_1.Column)({ length: 10, comment: 'Prefijo para los números de teléfono.' }),
39
58
  __metadata("design:type", String)
40
59
  ], Country.prototype, "prefix", void 0);
41
60
  __decorate([
42
61
  (0, typeorm_1.Column)({
43
62
  type: 'longtext',
44
- comment: 'Esta columna de tipo JSON nos sirve para agregar toda la información que se necesita a nivel de información legal de la empresa que se registre, ya que para cada país cambia la información',
63
+ comment: 'Esta columna de tipo JSON nos sirve para agregar toda la información que se necesita a nivel de información legal de la empresa que se registre, ya que para cada país cambia la información.',
45
64
  }),
46
65
  __metadata("design:type", String)
47
66
  ], Country.prototype, "legal_information", void 0);
48
67
  __decorate([
49
68
  (0, typeorm_1.Column)({
50
69
  type: 'longtext',
51
- comment: 'Columna de tipo JSON para almacenar la información que se necesita para la información del representante legal de la empresa',
70
+ comment: 'Columna de tipo JSON para almacenar la información que se necesita para la información del representante legal de la empresa.',
52
71
  }),
53
72
  __metadata("design:type", String)
54
73
  ], Country.prototype, "legal_agent", void 0);
55
74
  __decorate([
56
- (0, typeorm_1.Column)({ default: 1 }),
75
+ (0, typeorm_1.Column)({
76
+ default: 1,
77
+ comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
78
+ }),
57
79
  __metadata("design:type", Number)
58
80
  ], Country.prototype, "status", void 0);
59
81
  __decorate([
@@ -61,8 +83,8 @@ var Country = /** @class */ (function () {
61
83
  __metadata("design:type", Array)
62
84
  ], Country.prototype, "regions", void 0);
63
85
  Country = __decorate([
64
- (0, typeorm_1.Entity)()
86
+ (0, typeorm_1.Entity)({ comment: 'Países donde está disponible la plataforma.' })
65
87
  ], Country);
66
88
  return Country;
67
- }());
89
+ }(typeorm_1.BaseEntity));
68
90
  exports.Country = Country;
@@ -1,4 +1,5 @@
1
- export declare class Day {
1
+ import { BaseEntity } from 'typeorm';
2
+ export declare class Day extends BaseEntity {
2
3
  id: number;
3
4
  name: string;
4
5
  status: number;
@@ -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);
@@ -11,24 +26,34 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
26
  Object.defineProperty(exports, "__esModule", { value: true });
12
27
  exports.Day = void 0;
13
28
  var typeorm_1 = require("typeorm");
14
- var Day = /** @class */ (function () {
29
+ var Day = /** @class */ (function (_super) {
30
+ __extends(Day, _super);
15
31
  function Day() {
32
+ return _super !== null && _super.apply(this, arguments) || this;
16
33
  }
17
34
  __decorate([
18
- (0, typeorm_1.PrimaryGeneratedColumn)(),
35
+ (0, typeorm_1.PrimaryGeneratedColumn)({
36
+ comment: 'Número de identificación (ID) único de cada registro.',
37
+ }),
19
38
  __metadata("design:type", Number)
20
39
  ], Day.prototype, "id", void 0);
21
40
  __decorate([
22
- (0, typeorm_1.Column)({ length: 50 }),
41
+ (0, typeorm_1.Column)({
42
+ length: 50,
43
+ comment: 'Nombre del día.\r\n\r\nID/KEY de la variable que se encuentra en los archivos "locale" para el multilenguaje.',
44
+ }),
23
45
  __metadata("design:type", String)
24
46
  ], Day.prototype, "name", void 0);
25
47
  __decorate([
26
- (0, typeorm_1.Column)({ default: 1 }),
48
+ (0, typeorm_1.Column)({
49
+ default: 1,
50
+ comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
51
+ }),
27
52
  __metadata("design:type", Number)
28
53
  ], Day.prototype, "status", void 0);
29
54
  Day = __decorate([
30
- (0, typeorm_1.Entity)()
55
+ (0, typeorm_1.Entity)({ comment: 'Días de la semana.' })
31
56
  ], Day);
32
57
  return Day;
33
- }());
58
+ }(typeorm_1.BaseEntity));
34
59
  exports.Day = Day;
@@ -1,6 +1,7 @@
1
+ import { BaseEntity } from 'typeorm';
1
2
  import { User } from './User';
2
3
  import { CodeRedemptionHistoryCompany } from './CodeRedemptionHistoryCompany';
3
- export declare class DiscountCodeCompany {
4
+ export declare class DiscountCodeCompany extends BaseEntity {
4
5
  id: number;
5
6
  code: string;
6
7
  discount: 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,19 +28,26 @@ exports.DiscountCodeCompany = void 0;
13
28
  var typeorm_1 = require("typeorm");
14
29
  var User_1 = require("./User");
15
30
  var CodeRedemptionHistoryCompany_1 = require("./CodeRedemptionHistoryCompany");
16
- var DiscountCodeCompany = /** @class */ (function () {
31
+ var DiscountCodeCompany = /** @class */ (function (_super) {
32
+ __extends(DiscountCodeCompany, _super);
17
33
  function DiscountCodeCompany() {
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
  ], DiscountCodeCompany.prototype, "id", void 0);
23
42
  __decorate([
24
- (0, typeorm_1.Column)({ length: 10 }),
43
+ (0, typeorm_1.Column)({
44
+ length: 10,
45
+ comment: 'Código de descuento para las empresas (company).',
46
+ }),
25
47
  __metadata("design:type", String)
26
48
  ], DiscountCodeCompany.prototype, "code", void 0);
27
49
  __decorate([
28
- (0, typeorm_1.Column)({ length: 10 }),
50
+ (0, typeorm_1.Column)({ length: 10, comment: 'Descuento que se aplica.' }),
29
51
  __metadata("design:type", String)
30
52
  ], DiscountCodeCompany.prototype, "discount", void 0);
31
53
  __decorate([
@@ -38,28 +60,34 @@ var DiscountCodeCompany = /** @class */ (function () {
38
60
  __decorate([
39
61
  (0, typeorm_1.Column)({
40
62
  default: 1,
41
- comment: 'Con esto validamos si la empresa puede usar el código una vez o varias veces:\r\n1. Una sola vez.\r\n0. Más de una vez.\r\n\r\nCon esto validamos sí tenemos qué ir a buscar a la tabla code_redemption_history_company',
63
+ comment: 'Con esto validamos si la empresa puede usar el código una vez o varias veces:\r\n1. Una sola vez.\r\n0. Más de una vez.\r\n\r\nCon esto validamos sí tenemos qué ir a buscar a la tabla code_redemption_history_company.',
42
64
  }),
43
65
  __metadata("design:type", Number)
44
66
  ], DiscountCodeCompany.prototype, "single_use", void 0);
45
67
  __decorate([
46
- (0, typeorm_1.Column)({ type: 'datetime' }),
68
+ (0, typeorm_1.Column)({ type: 'datetime', comment: 'Fecha de creación del registro.' }),
47
69
  __metadata("design:type", Date)
48
70
  ], DiscountCodeCompany.prototype, "created", void 0);
49
71
  __decorate([
50
- (0, typeorm_1.Column)({ type: 'date' }),
72
+ (0, typeorm_1.Column)({ type: 'date', comment: 'Fecha de expiración del registro.' }),
51
73
  __metadata("design:type", Date)
52
74
  ], DiscountCodeCompany.prototype, "expiration", void 0);
53
75
  __decorate([
54
- (0, typeorm_1.Column)({ type: 'datetime' }),
76
+ (0, typeorm_1.Column)({ type: 'datetime', comment: 'Fecha de expiración del registro.' }),
55
77
  __metadata("design:type", Date)
56
78
  ], DiscountCodeCompany.prototype, "updated", void 0);
57
79
  __decorate([
58
- (0, typeorm_1.Column)({ default: 1 }),
80
+ (0, typeorm_1.Column)({
81
+ default: 1,
82
+ comment: 'Estado del registro, es decir: \n 1. Activo: Es visible en la plataforma. \n 0. Inactivo: No será visible en la plataforma.',
83
+ }),
59
84
  __metadata("design:type", Number)
60
85
  ], DiscountCodeCompany.prototype, "status", void 0);
61
86
  __decorate([
62
- (0, typeorm_1.ManyToOne)(function () { return User_1.User; }, function (user) { return user.discount_code_companies; }),
87
+ (0, typeorm_1.ManyToOne)(function () { return User_1.User; }, function (user) { return user.discount_code_companies; }, {
88
+ onDelete: 'CASCADE',
89
+ onUpdate: 'NO ACTION',
90
+ }),
63
91
  (0, typeorm_1.JoinColumn)({ name: 'update_by' }),
64
92
  __metadata("design:type", User_1.User)
65
93
  ], DiscountCodeCompany.prototype, "updated_by", void 0);
@@ -70,8 +98,10 @@ var DiscountCodeCompany = /** @class */ (function () {
70
98
  __metadata("design:type", Array)
71
99
  ], DiscountCodeCompany.prototype, "code_redemptions_history_company", void 0);
72
100
  DiscountCodeCompany = __decorate([
73
- (0, typeorm_1.Entity)('discount_code_company')
101
+ (0, typeorm_1.Entity)('discount_code_company', {
102
+ comment: 'Códigos de descuento para las empresas.',
103
+ })
74
104
  ], DiscountCodeCompany);
75
105
  return DiscountCodeCompany;
76
- }());
106
+ }(typeorm_1.BaseEntity));
77
107
  exports.DiscountCodeCompany = DiscountCodeCompany;
@@ -18,20 +18,25 @@ var DiscountCodeUser = /** @class */ (function () {
18
18
  function DiscountCodeUser() {
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
  ], DiscountCodeUser.prototype, "id", void 0);
24
26
  __decorate([
25
- (0, typeorm_1.ManyToOne)(function () { return Company_1.Company; }, function (company) { return company.discount_code_users; }),
27
+ (0, typeorm_1.ManyToOne)(function () { return Company_1.Company; }, function (company) { return company.discount_code_users; }, {
28
+ onDelete: 'CASCADE',
29
+ onUpdate: 'NO ACTION',
30
+ }),
26
31
  (0, typeorm_1.JoinColumn)({ name: 'company' }),
27
32
  __metadata("design:type", Company_1.Company)
28
33
  ], DiscountCodeUser.prototype, "company", void 0);
29
34
  __decorate([
30
- (0, typeorm_1.Column)({ length: 10 }),
35
+ (0, typeorm_1.Column)({ length: 10, comment: 'Código del descuento para compartirlo.' }),
31
36
  __metadata("design:type", String)
32
37
  ], DiscountCodeUser.prototype, "code", void 0);
33
38
  __decorate([
34
- (0, typeorm_1.Column)({ length: 10 }),
39
+ (0, typeorm_1.Column)({ length: 10, comment: 'Descuento que se aplica.' }),
35
40
  __metadata("design:type", String)
36
41
  ], DiscountCodeUser.prototype, "discount", void 0);
37
42
  __decorate([
@@ -48,34 +53,40 @@ var DiscountCodeUser = /** @class */ (function () {
48
53
  __metadata("design:type", Number)
49
54
  ], DiscountCodeUser.prototype, "single_use", void 0);
50
55
  __decorate([
51
- (0, typeorm_1.Column)({ type: 'datetime' }),
56
+ (0, typeorm_1.Column)({ type: 'datetime', comment: 'Fecha de creación del registro.' }),
52
57
  __metadata("design:type", Date)
53
58
  ], DiscountCodeUser.prototype, "created", void 0);
54
59
  __decorate([
55
- (0, typeorm_1.Column)({ type: 'date' }),
60
+ (0, typeorm_1.Column)({ type: 'date', comment: 'Fecha de expiración del registro.' }),
56
61
  __metadata("design:type", Date)
57
62
  ], DiscountCodeUser.prototype, "expiration", void 0);
58
63
  __decorate([
59
- (0, typeorm_1.ManyToOne)(function () { return User_1.User; }, function (user) { return user.discount_code_users; }),
64
+ (0, typeorm_1.ManyToOne)(function () { return User_1.User; }, function (user) { return user.discount_code_users; }, {
65
+ onDelete: 'CASCADE',
66
+ onUpdate: 'NO ACTION',
67
+ }),
60
68
  (0, typeorm_1.JoinColumn)({ name: 'updated_by' }),
61
69
  __metadata("design:type", User_1.User)
62
70
  ], DiscountCodeUser.prototype, "updated_by", void 0);
63
71
  __decorate([
64
- (0, typeorm_1.Column)({ type: 'datetime' }),
72
+ (0, typeorm_1.Column)({ type: 'datetime', comment: 'Fecha de actualización.' }),
65
73
  __metadata("design:type", Date)
66
74
  ], DiscountCodeUser.prototype, "updated", void 0);
67
75
  __decorate([
68
- (0, typeorm_1.Column)({ default: 1 }),
76
+ (0, typeorm_1.Column)({
77
+ default: 1,
78
+ comment: 'Estado del registro, es decir: \n 1. Activo: Es visible en la plataforma. \n 0. Inactivo: No será visible en la plataforma.',
79
+ }),
69
80
  __metadata("design:type", Number)
70
81
  ], DiscountCodeUser.prototype, "status", void 0);
71
82
  __decorate([
72
- (0, typeorm_1.OneToMany)(function () { return CodeRedemptionHistoryUser_1.CodeRedemptionHistoryUser; }, function (codeRedemptionHistoryUser) {
73
- return codeRedemptionHistoryUser.discount_code_user;
74
- }),
83
+ (0, typeorm_1.OneToMany)(function () { return CodeRedemptionHistoryUser_1.CodeRedemptionHistoryUser; }, function (codeRedemptionHistoryUser) { return codeRedemptionHistoryUser.discount_code_user; }),
75
84
  __metadata("design:type", Array)
76
85
  ], DiscountCodeUser.prototype, "code_redemptions_history_users", void 0);
77
86
  DiscountCodeUser = __decorate([
78
- (0, typeorm_1.Entity)('discount_code_user')
87
+ (0, typeorm_1.Entity)('discount_code_user', {
88
+ comment: 'Códigos de descuento para los usuarios.',
89
+ })
79
90
  ], DiscountCodeUser);
80
91
  return DiscountCodeUser;
81
92
  }());
@@ -1,8 +1,15 @@
1
+ import { BaseEntity } from 'typeorm';
1
2
  import { Company } from './Company';
2
3
  import { City } from './City';
3
4
  import { User } from './User';
4
5
  import { Product } from './Product';
5
- export declare class Local {
6
+ import { Category } from './Category';
7
+ import { Square } from './Square';
8
+ import { PaymentMethod } from './PaymentMethod';
9
+ import { LocalQualification } from './LocalQualification';
10
+ import { Request } from './Request';
11
+ import { Terminal } from './Terminal';
12
+ export declare class Local extends BaseEntity {
6
13
  id: number;
7
14
  company: Company;
8
15
  name: string;
@@ -14,8 +21,13 @@ export declare class Local {
14
21
  created: Date;
15
22
  updated: Date;
16
23
  updated_by: User;
17
- square: number;
24
+ square: Square;
18
25
  status: number;
19
26
  users: User[];
20
27
  products: Product[];
28
+ categories: Category[];
29
+ payment_methods: PaymentMethod[];
30
+ qualifications: LocalQualification[];
31
+ requests: Request[];
32
+ terminals: Terminal[];
21
33
  }
@@ -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);
@@ -15,15 +30,28 @@ var Company_1 = require("./Company");
15
30
  var City_1 = require("./City");
16
31
  var User_1 = require("./User");
17
32
  var Product_1 = require("./Product");
18
- var Local = /** @class */ (function () {
33
+ var Category_1 = require("./Category");
34
+ var Square_1 = require("./Square");
35
+ var PaymentMethod_1 = require("./PaymentMethod");
36
+ var LocalQualification_1 = require("./LocalQualification");
37
+ var Request_1 = require("./Request");
38
+ var Terminal_1 = require("./Terminal");
39
+ var Local = /** @class */ (function (_super) {
40
+ __extends(Local, _super);
19
41
  function Local() {
42
+ return _super !== null && _super.apply(this, arguments) || this;
20
43
  }
21
44
  __decorate([
22
- (0, typeorm_1.PrimaryGeneratedColumn)(),
45
+ (0, typeorm_1.PrimaryGeneratedColumn)({
46
+ comment: 'Número de identificación (ID) único de cada registro.',
47
+ }),
23
48
  __metadata("design:type", Number)
24
49
  ], Local.prototype, "id", void 0);
25
50
  __decorate([
26
- (0, typeorm_1.ManyToOne)(function () { return Company_1.Company; }, function (company) { return company.locals; }),
51
+ (0, typeorm_1.ManyToOne)(function () { return Company_1.Company; }, function (company) { return company.locals; }, {
52
+ onDelete: 'CASCADE',
53
+ onUpdate: 'NO ACTION',
54
+ }),
27
55
  (0, typeorm_1.JoinColumn)({ name: 'company' }),
28
56
  __metadata("design:type", Company_1.Company)
29
57
  ], Local.prototype, "company", void 0);
@@ -32,7 +60,10 @@ var Local = /** @class */ (function () {
32
60
  __metadata("design:type", String)
33
61
  ], Local.prototype, "name", void 0);
34
62
  __decorate([
35
- (0, typeorm_1.ManyToOne)(function () { return City_1.City; }, function (city) { return city.locals; }),
63
+ (0, typeorm_1.ManyToOne)(function () { return City_1.City; }, function (city) { return city.locals; }, {
64
+ onDelete: 'RESTRICT',
65
+ onUpdate: 'NO ACTION',
66
+ }),
36
67
  (0, typeorm_1.JoinColumn)({ name: 'city' }),
37
68
  __metadata("design:type", City_1.City)
38
69
  ], Local.prototype, "city", void 0);
@@ -65,20 +96,26 @@ var Local = /** @class */ (function () {
65
96
  __metadata("design:type", Date)
66
97
  ], Local.prototype, "updated", void 0);
67
98
  __decorate([
68
- (0, typeorm_1.ManyToOne)(function () { return User_1.User; }, function (user) { return user.locals; }),
99
+ (0, typeorm_1.ManyToOne)(function () { return User_1.User; }, function (user) { return user.locals; }, {
100
+ onDelete: 'NO ACTION',
101
+ onUpdate: 'NO ACTION',
102
+ }),
69
103
  (0, typeorm_1.JoinColumn)({ name: 'update_by' }),
70
104
  __metadata("design:type", User_1.User)
71
105
  ], Local.prototype, "updated_by", void 0);
72
106
  __decorate([
73
- (0, typeorm_1.Column)({
74
- type: 'int',
75
- default: 0,
76
- comment: 'Me indica si el local está en una plazoleta o no:\r\n1. Plazoleta.\r\n0. No plazoleta.',
107
+ (0, typeorm_1.ManyToOne)(function () { return Square_1.Square; }, function (square) { return square.locals; }, {
108
+ onDelete: 'RESTRICT',
109
+ onUpdate: 'NO ACTION',
77
110
  }),
78
- __metadata("design:type", Number)
111
+ (0, typeorm_1.JoinColumn)({ name: 'square' }),
112
+ __metadata("design:type", Square_1.Square)
79
113
  ], Local.prototype, "square", void 0);
80
114
  __decorate([
81
- (0, typeorm_1.Column)({ default: 1 }),
115
+ (0, typeorm_1.Column)({
116
+ default: 1,
117
+ comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
118
+ }),
82
119
  __metadata("design:type", Number)
83
120
  ], Local.prototype, "status", void 0);
84
121
  __decorate([
@@ -100,9 +137,32 @@ var Local = /** @class */ (function () {
100
137
  (0, typeorm_1.OneToMany)(function () { return Product_1.Product; }, function (product) { return product.local; }),
101
138
  __metadata("design:type", Array)
102
139
  ], Local.prototype, "products", void 0);
140
+ __decorate([
141
+ (0, typeorm_1.OneToMany)(function () { return Category_1.Category; }, function (category) { return category.local; }),
142
+ __metadata("design:type", Array)
143
+ ], Local.prototype, "categories", void 0);
144
+ __decorate([
145
+ (0, typeorm_1.ManyToMany)(function () { return PaymentMethod_1.PaymentMethod; }),
146
+ (0, typeorm_1.JoinTable)({
147
+ name: 'local_payment_method',
148
+ }),
149
+ __metadata("design:type", Array)
150
+ ], Local.prototype, "payment_methods", void 0);
151
+ __decorate([
152
+ (0, typeorm_1.OneToMany)(function () { return LocalQualification_1.LocalQualification; }, function (localQualification) { return localQualification.local; }),
153
+ __metadata("design:type", Array)
154
+ ], Local.prototype, "qualifications", void 0);
155
+ __decorate([
156
+ (0, typeorm_1.OneToMany)(function () { return Request_1.Request; }, function (request) { return request.local; }),
157
+ __metadata("design:type", Array)
158
+ ], Local.prototype, "requests", void 0);
159
+ __decorate([
160
+ (0, typeorm_1.OneToMany)(function () { return Terminal_1.Terminal; }, function (terminal) { return terminal.local; }),
161
+ __metadata("design:type", Array)
162
+ ], Local.prototype, "terminals", void 0);
103
163
  Local = __decorate([
104
- (0, typeorm_1.Entity)()
164
+ (0, typeorm_1.Entity)({ comment: 'Locales disponibles de las empresas (company).' })
105
165
  ], Local);
106
166
  return Local;
107
- }());
167
+ }(typeorm_1.BaseEntity));
108
168
  exports.Local = Local;
@@ -0,0 +1,10 @@
1
+ import { BaseEntity } from 'typeorm';
2
+ import { User } from './User';
3
+ import { Local } from './Local';
4
+ export declare class LocalQualification extends BaseEntity {
5
+ id: number;
6
+ qualification: number;
7
+ local: Local;
8
+ user: User;
9
+ created: string;
10
+ }
@@ -0,0 +1,76 @@
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.LocalQualification = void 0;
28
+ var typeorm_1 = require("typeorm");
29
+ var User_1 = require("./User");
30
+ var Local_1 = require("./Local");
31
+ var LocalQualification = /** @class */ (function (_super) {
32
+ __extends(LocalQualification, _super);
33
+ function LocalQualification() {
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
+ ], LocalQualification.prototype, "id", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)({
44
+ comment: 'Calificación que tiene el local.\r\n1. Mínimo: Mal servicio.\r\n5. Máximo: Excelente servicio\r\n\r\nLa calificación se evalúa haciéndole 3 o 4 preguntas al usuario:\r\n1. Qué tal fue el servicio a la hora de realizar el pedido.\r\n......',
45
+ }),
46
+ __metadata("design:type", Number)
47
+ ], LocalQualification.prototype, "qualification", void 0);
48
+ __decorate([
49
+ (0, typeorm_1.ManyToOne)(function () { return Local_1.Local; }, function (local) { return local.qualifications; }, {
50
+ onDelete: 'CASCADE',
51
+ onUpdate: 'NO ACTION',
52
+ }),
53
+ (0, typeorm_1.JoinColumn)({ name: 'local' }),
54
+ __metadata("design:type", Local_1.Local)
55
+ ], LocalQualification.prototype, "local", void 0);
56
+ __decorate([
57
+ (0, typeorm_1.ManyToOne)(function () { return User_1.User; }, function (user) { return user.qualifications; }, {
58
+ nullable: true,
59
+ onDelete: 'SET NULL',
60
+ onUpdate: 'NO ACTION',
61
+ }),
62
+ (0, typeorm_1.JoinColumn)({ name: 'user' }),
63
+ __metadata("design:type", User_1.User)
64
+ ], LocalQualification.prototype, "user", void 0);
65
+ __decorate([
66
+ (0, typeorm_1.Column)({ type: 'datetime', comment: 'Fecha de creación del registro.' }),
67
+ __metadata("design:type", String)
68
+ ], LocalQualification.prototype, "created", void 0);
69
+ LocalQualification = __decorate([
70
+ (0, typeorm_1.Entity)('local_qualification', {
71
+ comment: 'Valoración que los usuarios le dan a los locales cada vez qué realicen una orden, no es obligatorio.\r\n\r\nTodos los locales cuando se crean y no tienen reseñas quedarán con puntaje de 5.',
72
+ })
73
+ ], LocalQualification);
74
+ return LocalQualification;
75
+ }(typeorm_1.BaseEntity));
76
+ exports.LocalQualification = LocalQualification;
@@ -1,5 +1,6 @@
1
+ import { BaseEntity } from 'typeorm';
1
2
  import { User } from './User';
2
- export declare class Master {
3
+ export declare class Master extends BaseEntity {
3
4
  id: number;
4
5
  user: User;
5
6
  status: number;