test-entity-library-asm 2.9.7 → 2.9.9

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.
@@ -1,9 +1,17 @@
1
- import { Local } from './Local';
2
- import { Product } from './Product';
1
+ import { Local } from "./Local";
2
+ import { Product } from "./Product";
3
+ import { Partner } from "..";
3
4
  export declare class Category {
4
5
  id: number;
5
6
  local: Local;
6
7
  name: string;
7
8
  position: number;
9
+ type_sales_hours: number;
10
+ created_by: Partner;
11
+ created: Date;
12
+ updated: Date;
13
+ updated_by: Partner;
14
+ status: number;
15
+ review_comment: string;
8
16
  products: Product[];
9
17
  }
@@ -13,38 +13,86 @@ exports.Category = void 0;
13
13
  var typeorm_1 = require("typeorm");
14
14
  var Local_1 = require("./Local");
15
15
  var Product_1 = require("./Product");
16
+ var __1 = require("..");
16
17
  var Category = /** @class */ (function () {
17
18
  function Category() {
18
19
  }
19
20
  __decorate([
20
21
  (0, typeorm_1.PrimaryGeneratedColumn)({
21
- comment: 'Número de identificación (ID) único de cada registro.',
22
+ comment: "Número de identificación (ID) único de cada registro.",
22
23
  }),
23
24
  __metadata("design:type", Number)
24
25
  ], Category.prototype, "id", void 0);
25
26
  __decorate([
26
27
  (0, typeorm_1.ManyToOne)(function () { return Local_1.Local; }, function (local) { return local.categories; }, {
27
- onDelete: 'CASCADE',
28
- onUpdate: 'NO ACTION',
28
+ onDelete: "CASCADE",
29
+ onUpdate: "NO ACTION",
29
30
  }),
30
- (0, typeorm_1.JoinColumn)({ name: 'local' }),
31
+ (0, typeorm_1.JoinColumn)({ name: "local" }),
31
32
  __metadata("design:type", Local_1.Local)
32
33
  ], Category.prototype, "local", void 0);
33
34
  __decorate([
34
- (0, typeorm_1.Column)({ length: 30, comment: 'Nombre de la categoría.' }),
35
+ (0, typeorm_1.Column)({ length: 30, comment: "Nombre de la categoría." }),
35
36
  __metadata("design:type", String)
36
37
  ], Category.prototype, "name", void 0);
37
38
  __decorate([
38
- (0, typeorm_1.Column)({ comment: '¿En qué posición se va a mostrar esta categoría?' }),
39
+ (0, typeorm_1.Column)({ comment: "¿En qué posición se va a mostrar esta categoría?" }),
39
40
  __metadata("design:type", Number)
40
41
  ], Category.prototype, "position", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.Column)({
44
+ nullable: true,
45
+ comment: "Campo para saber el tipo de horario que se va a mostrar en la aplicación:\n 1. Días. \n2. Fecha específica.",
46
+ default: null,
47
+ }),
48
+ __metadata("design:type", Number)
49
+ ], Category.prototype, "type_sales_hours", void 0);
50
+ __decorate([
51
+ (0, typeorm_1.ManyToOne)(function () { return __1.Partner; }, function (partner) { return partner.partners_category_created_by; }, {
52
+ onDelete: "RESTRICT",
53
+ onUpdate: "NO ACTION",
54
+ }),
55
+ (0, typeorm_1.JoinColumn)({ name: "created_by" }),
56
+ __metadata("design:type", __1.Partner)
57
+ ], Category.prototype, "created_by", void 0);
58
+ __decorate([
59
+ (0, typeorm_1.Column)({ type: "datetime", comment: "Fecha de creación del registro." }),
60
+ __metadata("design:type", Date)
61
+ ], Category.prototype, "created", void 0);
62
+ __decorate([
63
+ (0, typeorm_1.Column)({ type: "datetime", comment: "Fecha de actualización del registro." }),
64
+ __metadata("design:type", Date)
65
+ ], Category.prototype, "updated", void 0);
66
+ __decorate([
67
+ (0, typeorm_1.ManyToOne)(function () { return __1.Partner; }, function (partner) { return partner.partners_category_update_by; }, {
68
+ onDelete: "RESTRICT",
69
+ onUpdate: "NO ACTION",
70
+ }),
71
+ (0, typeorm_1.JoinColumn)({ name: "updated_by" }),
72
+ __metadata("design:type", __1.Partner)
73
+ ], Category.prototype, "updated_by", void 0);
74
+ __decorate([
75
+ (0, typeorm_1.Column)({
76
+ default: 3,
77
+ comment: "Estado en el que está el elemento: \n0. Inactivo. \n1. Activo. \n2. Rechazado. \n3. En revisión.",
78
+ }),
79
+ __metadata("design:type", Number)
80
+ ], Category.prototype, "status", void 0);
81
+ __decorate([
82
+ (0, typeorm_1.Column)({
83
+ nullable: true,
84
+ length: 600,
85
+ comment: "Comentario del revisor al rechazar una categoría (master).",
86
+ }),
87
+ __metadata("design:type", String)
88
+ ], Category.prototype, "review_comment", void 0);
41
89
  __decorate([
42
90
  (0, typeorm_1.OneToMany)(function () { return Product_1.Product; }, function (product) { return product.category; }),
43
91
  __metadata("design:type", Array)
44
92
  ], Category.prototype, "products", void 0);
45
93
  Category = __decorate([
46
94
  (0, typeorm_1.Entity)({
47
- comment: 'Lista de categorías que tiene un local en su menú: promos, de la semana, completo...\r\n\r\nEsas categorías será visibles a nivel app como un menu horizontal donde cada categoría tendrá sus productos.',
95
+ comment: "Lista de categorías que tiene un local en su menú: promos, de la semana, completo...\r\n\r\nEsas categorías será visibles a nivel app como un menu horizontal donde cada categoría tendrá sus productos.",
48
96
  })
49
97
  ], Category);
50
98
  return Category;
@@ -3,7 +3,6 @@ import { City } from './City';
3
3
  import { Company } from './Company';
4
4
  import { LocalQualification } from './LocalQualification';
5
5
  import { PaymentMethod } from './PaymentMethod';
6
- import { Product } from './Product';
7
6
  import { Request } from './Request';
8
7
  import { Square } from './Square';
9
8
  import { Terminal } from './Terminal';
@@ -29,7 +28,6 @@ export declare class Local {
29
28
  status: number;
30
29
  visible: number;
31
30
  locals_partners: Partner[];
32
- products: Product[];
33
31
  categories: Category[];
34
32
  payment_methods: PaymentMethod[];
35
33
  qualifications: LocalQualification[];
@@ -16,7 +16,6 @@ var City_1 = require("./City");
16
16
  var Company_1 = require("./Company");
17
17
  var LocalQualification_1 = require("./LocalQualification");
18
18
  var PaymentMethod_1 = require("./PaymentMethod");
19
- var Product_1 = require("./Product");
20
19
  var Request_1 = require("./Request");
21
20
  var Square_1 = require("./Square");
22
21
  var Terminal_1 = require("./Terminal");
@@ -145,10 +144,6 @@ var Local = /** @class */ (function () {
145
144
  }),
146
145
  __metadata("design:type", Array)
147
146
  ], Local.prototype, "locals_partners", void 0);
148
- __decorate([
149
- (0, typeorm_1.OneToMany)(function () { return Product_1.Product; }, function (product) { return product.local; }),
150
- __metadata("design:type", Array)
151
- ], Local.prototype, "products", void 0);
152
147
  __decorate([
153
148
  (0, typeorm_1.OneToMany)(function () { return Category_1.Category; }, function (category) { return category.local; }),
154
149
  __metadata("design:type", Array)
@@ -6,7 +6,7 @@ import { PartnerRole } from "./PartnerRole";
6
6
  import { Terminal } from "./Terminal";
7
7
  import { TerminalSession } from "./TerminalSession";
8
8
  import { PartnerNotification } from "./PartnerNotification";
9
- import { MasterNotification, VerifyLocal } from "..";
9
+ import { Category, MasterNotification, Product, VerifyLocal } from "..";
10
10
  export declare class Partner {
11
11
  id: number;
12
12
  company: Company;
@@ -36,4 +36,8 @@ export declare class Partner {
36
36
  verifyLocals: VerifyLocal[];
37
37
  partners_to_notification: PartnerNotification[];
38
38
  partner_notifications: MasterNotification[];
39
+ partners_update_by: Product[];
40
+ partners_created_by: Product[];
41
+ partners_category_update_by: Category[];
42
+ partners_category_created_by: Category[];
39
43
  }
@@ -230,6 +230,22 @@ var Partner = /** @class */ (function () {
230
230
  (0, typeorm_1.OneToMany)(function () { return __1.MasterNotification; }, function (master_notification) { return master_notification.master; }),
231
231
  __metadata("design:type", Array)
232
232
  ], Partner.prototype, "partner_notifications", void 0);
233
+ __decorate([
234
+ (0, typeorm_1.OneToMany)(function () { return __1.Product; }, function (product) { return product.updated_by; }),
235
+ __metadata("design:type", Array)
236
+ ], Partner.prototype, "partners_update_by", void 0);
237
+ __decorate([
238
+ (0, typeorm_1.OneToMany)(function () { return __1.Product; }, function (product) { return product.created_by; }),
239
+ __metadata("design:type", Array)
240
+ ], Partner.prototype, "partners_created_by", void 0);
241
+ __decorate([
242
+ (0, typeorm_1.OneToMany)(function () { return __1.Category; }, function (category) { return category.updated_by; }),
243
+ __metadata("design:type", Array)
244
+ ], Partner.prototype, "partners_category_update_by", void 0);
245
+ __decorate([
246
+ (0, typeorm_1.OneToMany)(function () { return __1.Category; }, function (category) { return category.created_by; }),
247
+ __metadata("design:type", Array)
248
+ ], Partner.prototype, "partners_category_created_by", void 0);
233
249
  Partner = __decorate([
234
250
  (0, typeorm_1.Entity)({
235
251
  comment: "Tabla agregada para los usuarios qué quieran registrar su local o empresa de comida rápida en la plataforma.\r\n\r\nEste usuario es independiente a los usuarios de la tabla `user` ya que tiene diferentes plataformas.\r\n\r\nTambién van a estar los usuarios qué el administrador/dueño desee agregar como empleados/colaboradores.",
@@ -1,12 +1,11 @@
1
- import { Category } from './Category';
2
- import { Local } from './Local';
3
- import { ProductGroup } from './ProductGroup';
4
- import { ProductIngredient } from './ProductIngredient';
5
- import { RequestProduct } from './RequestProduct';
6
- import { User } from './User';
1
+ import { Category } from "./Category";
2
+ import { ProductGroup } from "./ProductGroup";
3
+ import { ProductIngredient } from "./ProductIngredient";
4
+ import { RequestProduct } from "./RequestProduct";
5
+ import { User } from "./User";
6
+ import { Partner } from "..";
7
7
  export declare class Product {
8
8
  id: number;
9
- local: Local;
10
9
  category: Category;
11
10
  name: string;
12
11
  details: string;
@@ -16,8 +15,13 @@ export declare class Product {
16
15
  position: number;
17
16
  photo: string;
18
17
  additional_information: string;
18
+ type_sales_hours: number;
19
+ created_by: Partner;
19
20
  created: Date;
20
21
  updated: Date;
22
+ updated_by: Partner;
23
+ status: number;
24
+ review_comment: string;
21
25
  product_groups: ProductGroup[];
22
26
  product_ingredients: ProductIngredient[];
23
27
  request_products: RequestProduct[];
@@ -12,93 +12,124 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Product = void 0;
13
13
  var typeorm_1 = require("typeorm");
14
14
  var Category_1 = require("./Category");
15
- var Local_1 = require("./Local");
16
15
  var ProductGroup_1 = require("./ProductGroup");
17
16
  var ProductIngredient_1 = require("./ProductIngredient");
18
17
  var RequestProduct_1 = require("./RequestProduct");
19
18
  var User_1 = require("./User");
19
+ var __1 = require("..");
20
20
  var Product = /** @class */ (function () {
21
21
  function Product() {
22
22
  }
23
23
  __decorate([
24
24
  (0, typeorm_1.PrimaryGeneratedColumn)({
25
- comment: 'Número de identificación (ID) único de cada registro.',
25
+ comment: "Número de identificación (ID) único de cada registro.",
26
26
  }),
27
27
  __metadata("design:type", Number)
28
28
  ], Product.prototype, "id", void 0);
29
- __decorate([
30
- (0, typeorm_1.ManyToOne)(function () { return Local_1.Local; }, function (local) { return local.products; }, {
31
- onDelete: 'CASCADE',
32
- onUpdate: 'NO ACTION',
33
- }),
34
- (0, typeorm_1.JoinColumn)({ name: 'local' }),
35
- __metadata("design:type", Local_1.Local)
36
- ], Product.prototype, "local", void 0);
37
29
  __decorate([
38
30
  (0, typeorm_1.ManyToOne)(function () { return Category_1.Category; }, function (category) { return category.products; }, {
39
- onDelete: 'CASCADE',
40
- onUpdate: 'NO ACTION',
31
+ onDelete: "CASCADE",
32
+ onUpdate: "NO ACTION",
41
33
  }),
42
- (0, typeorm_1.JoinColumn)({ name: 'category' }),
34
+ (0, typeorm_1.JoinColumn)({ name: "category" }),
43
35
  __metadata("design:type", Category_1.Category)
44
36
  ], Product.prototype, "category", void 0);
45
37
  __decorate([
46
- (0, typeorm_1.Column)({ length: 50, comment: 'Nombre del producto.' }),
38
+ (0, typeorm_1.Column)({ length: 50, comment: "Nombre del producto." }),
47
39
  __metadata("design:type", String)
48
40
  ], Product.prototype, "name", void 0);
49
41
  __decorate([
50
42
  (0, typeorm_1.Column)({
51
43
  length: 400,
52
- comment: 'Detalles del producto. \n\n ¿Qué contiene?',
44
+ comment: "Detalles del producto. \n\n ¿Qué contiene?",
53
45
  }),
54
46
  __metadata("design:type", String)
55
47
  ], Product.prototype, "details", void 0);
56
48
  __decorate([
57
- (0, typeorm_1.Column)({ length: 20, comment: 'Precio del producto.' }),
49
+ (0, typeorm_1.Column)({ length: 20, comment: "Precio del producto." }),
58
50
  __metadata("design:type", String)
59
51
  ], Product.prototype, "price", void 0);
60
52
  __decorate([
61
53
  (0, typeorm_1.Column)({
62
54
  default: 0,
63
- comment: '¿El producto cuenta con restricción de edad?\r\n1. Cuenta con restricción.\r\n0. No cuenta con restricción.',
55
+ comment: "¿El producto cuenta con restricción de edad?\r\n1. Cuenta con restricción.\r\n0. No cuenta con restricción.",
64
56
  }),
65
57
  __metadata("design:type", Number)
66
58
  ], Product.prototype, "age_restriction", void 0);
67
59
  __decorate([
68
60
  (0, typeorm_1.Column)({
69
61
  default: 0,
70
- comment: '¿El producto es un combo?\r\n1. Combo.\r\n0. No es un combo.',
62
+ comment: "¿El producto es un combo?\r\n1. Combo.\r\n0. No es un combo.",
71
63
  }),
72
64
  __metadata("design:type", Number)
73
65
  ], Product.prototype, "combo", void 0);
74
66
  __decorate([
75
- (0, typeorm_1.Column)({ comment: 'En qué posición se va a mostrar el producto.' }),
67
+ (0, typeorm_1.Column)({ comment: "En qué posición se va a mostrar el producto." }),
76
68
  __metadata("design:type", Number)
77
69
  ], Product.prototype, "position", void 0);
78
70
  __decorate([
79
71
  (0, typeorm_1.Column)({
80
- type: 'text',
72
+ type: "text",
81
73
  nullable: true,
82
- comment: 'Campo de tipo json para guardar el id y la url de la foto',
74
+ comment: "Campo de tipo json para guardar el id y la url de la foto",
83
75
  }),
84
76
  __metadata("design:type", String)
85
77
  ], Product.prototype, "photo", void 0);
86
78
  __decorate([
87
79
  (0, typeorm_1.Column)({
88
- type: 'mediumtext',
80
+ type: "mediumtext",
89
81
  nullable: true,
90
- comment: 'Campo de tipo JSON donde se guarda información necesaria para el registro.',
82
+ comment: "Campo de tipo JSON donde se guarda información necesaria para el registro.",
91
83
  }),
92
84
  __metadata("design:type", String)
93
85
  ], Product.prototype, "additional_information", void 0);
94
86
  __decorate([
95
- (0, typeorm_1.Column)({ type: 'datetime', comment: 'Fecha de creación del registro.' }),
87
+ (0, typeorm_1.Column)({
88
+ nullable: true,
89
+ comment: "Campo para saber el tipo de horario que se va a mostrar en la aplicación:\n 1. Días. \n2. Fecha específica.",
90
+ default: null,
91
+ }),
92
+ __metadata("design:type", Number)
93
+ ], Product.prototype, "type_sales_hours", void 0);
94
+ __decorate([
95
+ (0, typeorm_1.ManyToOne)(function () { return __1.Partner; }, function (partner) { return partner.partners_created_by; }, {
96
+ onDelete: "RESTRICT",
97
+ onUpdate: "NO ACTION",
98
+ }),
99
+ (0, typeorm_1.JoinColumn)({ name: "created_by" }),
100
+ __metadata("design:type", __1.Partner)
101
+ ], Product.prototype, "created_by", void 0);
102
+ __decorate([
103
+ (0, typeorm_1.Column)({ type: "datetime", comment: "Fecha de creación del registro." }),
96
104
  __metadata("design:type", Date)
97
105
  ], Product.prototype, "created", void 0);
98
106
  __decorate([
99
- (0, typeorm_1.Column)({ type: 'datetime', comment: 'Fecha de actualización del registro.' }),
107
+ (0, typeorm_1.Column)({ type: "datetime", comment: "Fecha de actualización del registro." }),
100
108
  __metadata("design:type", Date)
101
109
  ], Product.prototype, "updated", void 0);
110
+ __decorate([
111
+ (0, typeorm_1.ManyToOne)(function () { return __1.Partner; }, function (partner) { return partner.partners_update_by; }, {
112
+ onDelete: "RESTRICT",
113
+ onUpdate: "NO ACTION",
114
+ }),
115
+ (0, typeorm_1.JoinColumn)({ name: "updated_by" }),
116
+ __metadata("design:type", __1.Partner)
117
+ ], Product.prototype, "updated_by", void 0);
118
+ __decorate([
119
+ (0, typeorm_1.Column)({
120
+ default: 3,
121
+ comment: "Estado en el que está el elemento: \n0. Inactivo. \n1. Activo. \n2. Rechazado. \n3. En revisión.",
122
+ }),
123
+ __metadata("design:type", Number)
124
+ ], Product.prototype, "status", void 0);
125
+ __decorate([
126
+ (0, typeorm_1.Column)({
127
+ nullable: true,
128
+ length: 600,
129
+ comment: "Comentario del revisor al rechazar un producto (master).",
130
+ }),
131
+ __metadata("design:type", String)
132
+ ], Product.prototype, "review_comment", void 0);
102
133
  __decorate([
103
134
  (0, typeorm_1.OneToMany)(function () { return ProductGroup_1.ProductGroup; }, function (productGroup) { return productGroup.product; }),
104
135
  __metadata("design:type", Array)
@@ -114,13 +145,13 @@ var Product = /** @class */ (function () {
114
145
  __decorate([
115
146
  (0, typeorm_1.ManyToMany)(function () { return User_1.User; }),
116
147
  (0, typeorm_1.JoinTable)({
117
- name: 'user_favorite_product',
148
+ name: "user_favorite_product",
118
149
  }),
119
150
  __metadata("design:type", Array)
120
151
  ], Product.prototype, "users_favorite_product", void 0);
121
152
  Product = __decorate([
122
153
  (0, typeorm_1.Entity)({
123
- comment: 'Productos qué serán visibles a los usuarios, estos están asociados a un local.',
154
+ comment: "Productos qué serán visibles a los usuarios, estos están asociados a un local.",
124
155
  })
125
156
  ], Product);
126
157
  return Product;
@@ -5,7 +5,7 @@ export declare class ViewLocalsCompanies {
5
5
  updated_local: string;
6
6
  status: number;
7
7
  has_square: number;
8
- details_local: object;
8
+ details_local: any;
9
9
  pos_system_name: string;
10
10
  city_name: string;
11
11
  region_name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "2.9.7",
3
+ "version": "2.9.9",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -5,33 +5,76 @@ import {
5
5
  ManyToOne,
6
6
  OneToMany,
7
7
  PrimaryGeneratedColumn,
8
- } from 'typeorm'
9
- import { Local } from './Local'
10
- import { Product } from './Product'
8
+ } from "typeorm";
9
+ import { Local } from "./Local";
10
+ import { Product } from "./Product";
11
+ import { Partner } from "..";
11
12
 
12
13
  @Entity({
13
14
  comment:
14
- 'Lista de categorías que tiene un local en su menú: promos, de la semana, completo...\r\n\r\nEsas categorías será visibles a nivel app como un menu horizontal donde cada categoría tendrá sus productos.',
15
+ "Lista de categorías que tiene un local en su menú: promos, de la semana, completo...\r\n\r\nEsas categorías será visibles a nivel app como un menu horizontal donde cada categoría tendrá sus productos.",
15
16
  })
16
17
  export class Category {
17
18
  @PrimaryGeneratedColumn({
18
- comment: 'Número de identificación (ID) único de cada registro.',
19
+ comment: "Número de identificación (ID) único de cada registro.",
19
20
  })
20
- id: number
21
+ id: number;
21
22
 
22
23
  @ManyToOne(() => Local, (local) => local.categories, {
23
- onDelete: 'CASCADE',
24
- onUpdate: 'NO ACTION',
24
+ onDelete: "CASCADE",
25
+ onUpdate: "NO ACTION",
25
26
  })
26
- @JoinColumn({ name: 'local' })
27
- local: Local
27
+ @JoinColumn({ name: "local" })
28
+ local: Local;
28
29
 
29
- @Column({ length: 30, comment: 'Nombre de la categoría.' })
30
- name: string
30
+ @Column({ length: 30, comment: "Nombre de la categoría." })
31
+ name: string;
31
32
 
32
- @Column({ comment: '¿En qué posición se va a mostrar esta categoría?' })
33
- position: number
33
+ @Column({ comment: "¿En qué posición se va a mostrar esta categoría?" })
34
+ position: number;
35
+
36
+ @Column({
37
+ nullable: true,
38
+ comment:
39
+ "Campo para saber el tipo de horario que se va a mostrar en la aplicación:\n 1. Días. \n2. Fecha específica.",
40
+ default: null,
41
+ })
42
+ type_sales_hours: number;
43
+
44
+ @ManyToOne(() => Partner, (partner) => partner.partners_category_created_by, {
45
+ onDelete: "RESTRICT",
46
+ onUpdate: "NO ACTION",
47
+ })
48
+ @JoinColumn({ name: "created_by" })
49
+ created_by: Partner;
50
+
51
+ @Column({ type: "datetime", comment: "Fecha de creación del registro." })
52
+ created: Date;
53
+
54
+ @Column({ type: "datetime", comment: "Fecha de actualización del registro." })
55
+ updated: Date;
56
+
57
+ @ManyToOne(() => Partner, (partner) => partner.partners_category_update_by, {
58
+ onDelete: "RESTRICT",
59
+ onUpdate: "NO ACTION",
60
+ })
61
+ @JoinColumn({ name: "updated_by" })
62
+ updated_by: Partner;
63
+
64
+ @Column({
65
+ default: 3,
66
+ comment:
67
+ "Estado en el que está el elemento: \n0. Inactivo. \n1. Activo. \n2. Rechazado. \n3. En revisión.",
68
+ })
69
+ status: number;
70
+
71
+ @Column({
72
+ nullable: true,
73
+ length: 600,
74
+ comment: "Comentario del revisor al rechazar una categoría (master).",
75
+ })
76
+ review_comment: string;
34
77
 
35
78
  @OneToMany(() => Product, (product) => product.category)
36
- products: Product[]
79
+ products: Product[];
37
80
  }
@@ -127,10 +127,7 @@ export class Local {
127
127
  },
128
128
  })
129
129
  locals_partners: Partner[]
130
-
131
- @OneToMany(() => Product, (product) => product.local)
132
- products: Product[]
133
-
130
+
134
131
  @OneToMany(() => Category, (category) => category.local)
135
132
  categories: Category[]
136
133
 
@@ -19,7 +19,7 @@ import { Terminal } from "./Terminal";
19
19
  import { TerminalSession } from "./TerminalSession";
20
20
  import { DateTransformer } from "../transformers/dateTransformer";
21
21
  import { PartnerNotification } from "./PartnerNotification";
22
- import { MasterNotification, VerifyLocal } from "..";
22
+ import { Category, MasterNotification, Product, VerifyLocal } from "..";
23
23
 
24
24
  @Entity({
25
25
  comment:
@@ -217,4 +217,16 @@ export class Partner {
217
217
  (master_notification) => master_notification.master
218
218
  )
219
219
  partner_notifications: MasterNotification[];
220
+
221
+ @OneToMany(() => Product, (product) => product.updated_by)
222
+ partners_update_by: Product[];
223
+
224
+ @OneToMany(() => Product, (product) => product.created_by)
225
+ partners_created_by: Product[];
226
+
227
+ @OneToMany(() => Category, (category) => category.updated_by)
228
+ partners_category_update_by: Category[];
229
+
230
+ @OneToMany(() => Category, (category) => category.created_by)
231
+ partners_category_created_by: Category[];
220
232
  }
@@ -7,102 +7,131 @@ import {
7
7
  ManyToOne,
8
8
  OneToMany,
9
9
  PrimaryGeneratedColumn,
10
- } from 'typeorm'
11
- import { Category } from './Category'
12
- import { Local } from './Local'
13
- import { ProductGroup } from './ProductGroup'
14
- import { ProductIngredient } from './ProductIngredient'
15
- import { RequestProduct } from './RequestProduct'
16
- import { User } from './User'
10
+ } from "typeorm";
11
+ import { Category } from "./Category";
12
+ import { ProductGroup } from "./ProductGroup";
13
+ import { ProductIngredient } from "./ProductIngredient";
14
+ import { RequestProduct } from "./RequestProduct";
15
+ import { User } from "./User";
16
+ import { Partner } from "..";
17
17
 
18
18
  @Entity({
19
19
  comment:
20
- 'Productos qué serán visibles a los usuarios, estos están asociados a un local.',
20
+ "Productos qué serán visibles a los usuarios, estos están asociados a un local.",
21
21
  })
22
22
  export class Product {
23
23
  @PrimaryGeneratedColumn({
24
- comment: 'Número de identificación (ID) único de cada registro.',
24
+ comment: "Número de identificación (ID) único de cada registro.",
25
25
  })
26
- id: number
27
-
28
- @ManyToOne(() => Local, (local) => local.products, {
29
- onDelete: 'CASCADE',
30
- onUpdate: 'NO ACTION',
31
- })
32
- @JoinColumn({ name: 'local' })
33
- local: Local
26
+ id: number;
34
27
 
35
28
  @ManyToOne(() => Category, (category) => category.products, {
36
- onDelete: 'CASCADE',
37
- onUpdate: 'NO ACTION',
29
+ onDelete: "CASCADE",
30
+ onUpdate: "NO ACTION",
38
31
  })
39
- @JoinColumn({ name: 'category' })
40
- category: Category
32
+ @JoinColumn({ name: "category" })
33
+ category: Category;
41
34
 
42
- @Column({ length: 50, comment: 'Nombre del producto.' })
43
- name: string
35
+ @Column({ length: 50, comment: "Nombre del producto." })
36
+ name: string;
44
37
 
45
38
  @Column({
46
39
  length: 400,
47
- comment: 'Detalles del producto. \n\n ¿Qué contiene?',
40
+ comment: "Detalles del producto. \n\n ¿Qué contiene?",
48
41
  })
49
- details: string
42
+ details: string;
50
43
 
51
- @Column({ length: 20, comment: 'Precio del producto.' })
52
- price: string
44
+ @Column({ length: 20, comment: "Precio del producto." })
45
+ price: string;
53
46
 
54
47
  @Column({
55
48
  default: 0,
56
49
  comment:
57
- '¿El producto cuenta con restricción de edad?\r\n1. Cuenta con restricción.\r\n0. No cuenta con restricción.',
50
+ "¿El producto cuenta con restricción de edad?\r\n1. Cuenta con restricción.\r\n0. No cuenta con restricción.",
58
51
  })
59
- age_restriction: number
52
+ age_restriction: number;
60
53
 
61
54
  @Column({
62
55
  default: 0,
63
- comment: '¿El producto es un combo?\r\n1. Combo.\r\n0. No es un combo.',
56
+ comment: "¿El producto es un combo?\r\n1. Combo.\r\n0. No es un combo.",
64
57
  })
65
- combo: number
58
+ combo: number;
59
+
60
+ @Column({ comment: "En qué posición se va a mostrar el producto." })
61
+ position: number;
66
62
 
67
- @Column({ comment: 'En qué posición se va a mostrar el producto.' })
68
- position: number
63
+ @Column({
64
+ type: "text",
65
+ nullable: true,
66
+ comment: "Campo de tipo json para guardar el id y la url de la foto",
67
+ })
68
+ photo: string;
69
69
 
70
70
  @Column({
71
- type: 'text',
71
+ type: "mediumtext",
72
72
  nullable: true,
73
- comment: 'Campo de tipo json para guardar el id y la url de la foto',
73
+ comment:
74
+ "Campo de tipo JSON donde se guarda información necesaria para el registro.",
74
75
  })
75
- photo: string
76
+ additional_information: string;
76
77
 
77
78
  @Column({
78
- type: 'mediumtext',
79
79
  nullable: true,
80
80
  comment:
81
- 'Campo de tipo JSON donde se guarda información necesaria para el registro.',
81
+ "Campo para saber el tipo de horario que se va a mostrar en la aplicación:\n 1. Días. \n2. Fecha específica.",
82
+ default: null,
82
83
  })
83
- additional_information: string
84
+ type_sales_hours: number;
85
+
86
+ @ManyToOne(() => Partner, (partner) => partner.partners_created_by, {
87
+ onDelete: "RESTRICT",
88
+ onUpdate: "NO ACTION",
89
+ })
90
+ @JoinColumn({ name: "created_by" })
91
+ created_by: Partner;
92
+
93
+ @Column({ type: "datetime", comment: "Fecha de creación del registro." })
94
+ created: Date;
84
95
 
85
- @Column({ type: 'datetime', comment: 'Fecha de creación del registro.' })
86
- created: Date
96
+ @Column({ type: "datetime", comment: "Fecha de actualización del registro." })
97
+ updated: Date;
87
98
 
88
- @Column({ type: 'datetime', comment: 'Fecha de actualización del registro.' })
89
- updated: Date
99
+ @ManyToOne(() => Partner, (partner) => partner.partners_update_by, {
100
+ onDelete: "RESTRICT",
101
+ onUpdate: "NO ACTION",
102
+ })
103
+ @JoinColumn({ name: "updated_by" })
104
+ updated_by: Partner;
105
+
106
+ @Column({
107
+ default: 3,
108
+ comment:
109
+ "Estado en el que está el elemento: \n0. Inactivo. \n1. Activo. \n2. Rechazado. \n3. En revisión.",
110
+ })
111
+ status: number;
112
+
113
+ @Column({
114
+ nullable: true,
115
+ length: 600,
116
+ comment: "Comentario del revisor al rechazar un producto (master).",
117
+ })
118
+ review_comment: string;
90
119
 
91
120
  @OneToMany(() => ProductGroup, (productGroup) => productGroup.product)
92
- product_groups: ProductGroup[]
121
+ product_groups: ProductGroup[];
93
122
 
94
123
  @OneToMany(
95
124
  () => ProductIngredient,
96
125
  (productIngredient) => productIngredient.product
97
126
  )
98
- product_ingredients: ProductIngredient[]
127
+ product_ingredients: ProductIngredient[];
99
128
 
100
129
  @OneToMany(() => RequestProduct, (requestProduct) => requestProduct.product)
101
- request_products: RequestProduct[]
130
+ request_products: RequestProduct[];
102
131
 
103
132
  @ManyToMany(() => User)
104
133
  @JoinTable({
105
- name: 'user_favorite_product',
134
+ name: "user_favorite_product",
106
135
  })
107
- users_favorite_product: User[]
136
+ users_favorite_product: User[];
108
137
  }
@@ -40,7 +40,7 @@ export class ViewLocalsCompanies {
40
40
  has_square: number;
41
41
 
42
42
  @ViewColumn({ transformer: jsonTransformer })
43
- details_local: object;
43
+ details_local: any;
44
44
 
45
45
  @ViewColumn()
46
46
  pos_system_name: string;