test-entity-library-asm 2.9.8 → 3.0.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.
@@ -1,9 +1,19 @@
1
- import { Local } from './Local';
2
- import { Product } from './Product';
1
+ import { Local } from "./Local";
2
+ import { Product } from "./Product";
3
+ import { CategoryDate, Partner, ScheduleCategory } 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[];
17
+ category_schedules: ScheduleCategory[];
18
+ category_dates: CategoryDate[];
9
19
  }
@@ -13,38 +13,94 @@ 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);
93
+ __decorate([
94
+ (0, typeorm_1.OneToMany)(function () { return __1.ScheduleCategory; }, function (scheduleCategory) { return scheduleCategory.category; }),
95
+ __metadata("design:type", Array)
96
+ ], Category.prototype, "category_schedules", void 0);
97
+ __decorate([
98
+ (0, typeorm_1.OneToMany)(function () { return __1.CategoryDate; }, function (categoryDate) { return categoryDate.category; }),
99
+ __metadata("design:type", Array)
100
+ ], Category.prototype, "category_dates", void 0);
45
101
  Category = __decorate([
46
102
  (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.',
103
+ 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
104
  })
49
105
  ], Category);
50
106
  return Category;
@@ -0,0 +1,8 @@
1
+ import { Category } from "./Category";
2
+ export declare class CategoryDate {
3
+ id: number;
4
+ category: Category;
5
+ date: Date;
6
+ start_time: string;
7
+ end_time: string;
8
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CategoryDate = void 0;
13
+ var typeorm_1 = require("typeorm");
14
+ var Category_1 = require("./Category");
15
+ var CategoryDate = /** @class */ (function () {
16
+ function CategoryDate() {
17
+ }
18
+ __decorate([
19
+ (0, typeorm_1.PrimaryGeneratedColumn)({
20
+ comment: "Número de identificación (ID) único de cada registro.",
21
+ }),
22
+ __metadata("design:type", Number)
23
+ ], CategoryDate.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.ManyToOne)(function () { return Category_1.Category; }, function (category) { return category.category_dates; }, {
26
+ onDelete: "CASCADE",
27
+ onUpdate: "NO ACTION",
28
+ }),
29
+ (0, typeorm_1.JoinColumn)({ name: "category" }),
30
+ __metadata("design:type", Category_1.Category)
31
+ ], CategoryDate.prototype, "category", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)({
34
+ type: "date",
35
+ comment: "Fecha en la que va a estar disponible la categoría.",
36
+ }),
37
+ __metadata("design:type", Date)
38
+ ], CategoryDate.prototype, "date", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.Column)({ comment: "Hora de inicio." }),
41
+ __metadata("design:type", String)
42
+ ], CategoryDate.prototype, "start_time", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.Column)({ comment: "Hora de finalización." }),
45
+ __metadata("design:type", String)
46
+ ], CategoryDate.prototype, "end_time", void 0);
47
+ CategoryDate = __decorate([
48
+ (0, typeorm_1.Entity)("category_date", {
49
+ comment: "Fechas específicas donde se pueden agregar horarios.",
50
+ })
51
+ ], CategoryDate);
52
+ return CategoryDate;
53
+ }());
54
+ exports.CategoryDate = CategoryDate;
@@ -1,5 +1,5 @@
1
- import { Category } from './Category';
2
- import { Day } from './Day';
1
+ import { Category } from "./Category";
2
+ import { Day } from "./Day";
3
3
  export declare class ScheduleCategory {
4
4
  id: number;
5
5
  category: Category;
@@ -18,31 +18,37 @@ var ScheduleCategory = /** @class */ (function () {
18
18
  }
19
19
  __decorate([
20
20
  (0, typeorm_1.PrimaryGeneratedColumn)({
21
- comment: 'Número de identificación (ID) único de cada registro.',
21
+ comment: "Número de identificación (ID) único de cada registro.",
22
22
  }),
23
23
  __metadata("design:type", Number)
24
24
  ], ScheduleCategory.prototype, "id", void 0);
25
25
  __decorate([
26
- (0, typeorm_1.ManyToOne)(function () { return Category_1.Category; }, { onDelete: 'CASCADE', onUpdate: 'NO ACTION' }),
27
- (0, typeorm_1.JoinColumn)({ name: 'category' }),
26
+ (0, typeorm_1.ManyToOne)(function () { return Category_1.Category; }, function (category) { return category.category_schedules; }, {
27
+ onDelete: "CASCADE",
28
+ onUpdate: "NO ACTION",
29
+ }),
30
+ (0, typeorm_1.JoinColumn)({ name: "category" }),
28
31
  __metadata("design:type", Category_1.Category)
29
32
  ], ScheduleCategory.prototype, "category", void 0);
30
33
  __decorate([
31
- (0, typeorm_1.ManyToOne)(function () { return Day_1.Day; }, { onDelete: 'RESTRICT', onUpdate: 'NO ACTION' }),
32
- (0, typeorm_1.JoinColumn)({ name: 'day' }),
34
+ (0, typeorm_1.ManyToOne)(function () { return Day_1.Day; }, function (day) { return day.category_schedules_day; }, {
35
+ onDelete: "RESTRICT",
36
+ onUpdate: "NO ACTION",
37
+ }),
38
+ (0, typeorm_1.JoinColumn)({ name: "day" }),
33
39
  __metadata("design:type", Day_1.Day)
34
40
  ], ScheduleCategory.prototype, "day", void 0);
35
41
  __decorate([
36
- (0, typeorm_1.Column)({ comment: 'Hora de inicio.' }),
42
+ (0, typeorm_1.Column)({ comment: "Hora de inicio." }),
37
43
  __metadata("design:type", String)
38
44
  ], ScheduleCategory.prototype, "start_time", void 0);
39
45
  __decorate([
40
- (0, typeorm_1.Column)({ comment: 'Hora de finalización.' }),
46
+ (0, typeorm_1.Column)({ comment: "Hora de finalización." }),
41
47
  __metadata("design:type", String)
42
48
  ], ScheduleCategory.prototype, "end_time", void 0);
43
49
  ScheduleCategory = __decorate([
44
- (0, typeorm_1.Entity)('category_schedule', {
45
- comment: 'Horarios en que se puede ver una categoría, si se desea que una categoría esté los lunes de 7 am a 5 pm se puede hacer.',
50
+ (0, typeorm_1.Entity)("category_schedule", {
51
+ comment: "Horarios en que se puede ver una categoría, si se desea que una categoría esté los lunes de 7 am a 5 pm se puede hacer.",
46
52
  })
47
53
  ], ScheduleCategory);
48
54
  return ScheduleCategory;
@@ -1,5 +1,8 @@
1
+ import { ProductSchedule, ScheduleCategory } from "..";
1
2
  export declare class Day {
2
3
  id: number;
3
4
  name: string;
4
5
  status: number;
6
+ category_schedules_day: ScheduleCategory[];
7
+ product_schedules_day: ProductSchedule[];
5
8
  }
@@ -11,12 +11,13 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Day = void 0;
13
13
  var typeorm_1 = require("typeorm");
14
+ var __1 = require("..");
14
15
  var Day = /** @class */ (function () {
15
16
  function Day() {
16
17
  }
17
18
  __decorate([
18
19
  (0, typeorm_1.PrimaryGeneratedColumn)({
19
- comment: 'Número de identificación (ID) único de cada registro.',
20
+ comment: "Número de identificación (ID) único de cada registro.",
20
21
  }),
21
22
  __metadata("design:type", Number)
22
23
  ], Day.prototype, "id", void 0);
@@ -30,12 +31,20 @@ var Day = /** @class */ (function () {
30
31
  __decorate([
31
32
  (0, typeorm_1.Column)({
32
33
  default: 1,
33
- comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
34
+ comment: "Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
34
35
  }),
35
36
  __metadata("design:type", Number)
36
37
  ], Day.prototype, "status", void 0);
38
+ __decorate([
39
+ (0, typeorm_1.OneToMany)(function () { return __1.ScheduleCategory; }, function (scheduleCategory) { return scheduleCategory.day; }),
40
+ __metadata("design:type", Array)
41
+ ], Day.prototype, "category_schedules_day", void 0);
42
+ __decorate([
43
+ (0, typeorm_1.OneToMany)(function () { return __1.ProductSchedule; }, function (productSchedule) { return productSchedule.day; }),
44
+ __metadata("design:type", Array)
45
+ ], Day.prototype, "product_schedules_day", void 0);
37
46
  Day = __decorate([
38
- (0, typeorm_1.Entity)({ comment: 'Días de la semana.' })
47
+ (0, typeorm_1.Entity)({ comment: "Días de la semana." })
39
48
  ], Day);
40
49
  return Day;
41
50
  }());
@@ -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, ProductDate, ProductSchedule } 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,10 +15,17 @@ 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[];
24
28
  users_favorite_product: User[];
29
+ product_schedules: ProductSchedule[];
30
+ product_dates: ProductDate[];
25
31
  }
@@ -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,21 @@ 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);
152
+ __decorate([
153
+ (0, typeorm_1.OneToMany)(function () { return __1.ProductSchedule; }, function (productSchedule) { return productSchedule.product; }),
154
+ __metadata("design:type", Array)
155
+ ], Product.prototype, "product_schedules", void 0);
156
+ __decorate([
157
+ (0, typeorm_1.OneToMany)(function () { return __1.ProductDate; }, function (productDate) { return productDate.product; }),
158
+ __metadata("design:type", Array)
159
+ ], Product.prototype, "product_dates", void 0);
121
160
  Product = __decorate([
122
161
  (0, typeorm_1.Entity)({
123
- comment: 'Productos qué serán visibles a los usuarios, estos están asociados a un local.',
162
+ comment: "Productos qué serán visibles a los usuarios, estos están asociados a un local.",
124
163
  })
125
164
  ], Product);
126
165
  return Product;
@@ -0,0 +1,8 @@
1
+ import { Product } from "..";
2
+ export declare class ProductDate {
3
+ id: number;
4
+ product: Product;
5
+ date: Date;
6
+ start_time: string;
7
+ end_time: string;
8
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ProductDate = void 0;
13
+ var typeorm_1 = require("typeorm");
14
+ var __1 = require("..");
15
+ var ProductDate = /** @class */ (function () {
16
+ function ProductDate() {
17
+ }
18
+ __decorate([
19
+ (0, typeorm_1.PrimaryGeneratedColumn)({
20
+ comment: "Número de identificación (ID) único de cada registro.",
21
+ }),
22
+ __metadata("design:type", Number)
23
+ ], ProductDate.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.ManyToOne)(function () { return __1.Product; }, function (product) { return product.product_dates; }, {
26
+ onDelete: "CASCADE",
27
+ onUpdate: "NO ACTION",
28
+ }),
29
+ (0, typeorm_1.JoinColumn)({ name: "product" }),
30
+ __metadata("design:type", __1.Product)
31
+ ], ProductDate.prototype, "product", void 0);
32
+ __decorate([
33
+ (0, typeorm_1.Column)({
34
+ type: "date",
35
+ comment: "Fecha en la que va a estar disponible el producto.",
36
+ }),
37
+ __metadata("design:type", Date)
38
+ ], ProductDate.prototype, "date", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.Column)({ comment: "Hora de inicio." }),
41
+ __metadata("design:type", String)
42
+ ], ProductDate.prototype, "start_time", void 0);
43
+ __decorate([
44
+ (0, typeorm_1.Column)({ comment: "Hora de finalización." }),
45
+ __metadata("design:type", String)
46
+ ], ProductDate.prototype, "end_time", void 0);
47
+ ProductDate = __decorate([
48
+ (0, typeorm_1.Entity)("product_date", {
49
+ comment: "Fechas específicas donde se pueden agregar horarios",
50
+ })
51
+ ], ProductDate);
52
+ return ProductDate;
53
+ }());
54
+ exports.ProductDate = ProductDate;