test-entity-library-asm 3.4.0 → 3.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { Category, MasterNotification, PartnerSession, Product, RequestLocalHistory, RequestLocalPayment, VerifyLocal } from "..";
1
+ import { Category, MasterNotification, PartnerSession, Product, RequestLocal, RequestLocalHistory, RequestLocalPayment, RequestPrint, VerifyLocal } from "..";
2
2
  import { City } from "./City";
3
3
  import { Company } from "./Company";
4
4
  import { DiscountCodeUser } from "./DiscountCodeUser";
@@ -39,4 +39,6 @@ export declare class Partner {
39
39
  partners_session: PartnerSession[];
40
40
  updated_by_history: RequestLocalHistory[];
41
41
  requests_local_payment: RequestLocalPayment[];
42
+ partner_prints: RequestPrint[];
43
+ partner_request_locals: RequestLocal[];
42
44
  }
@@ -261,6 +261,14 @@ var Partner = /** @class */ (function () {
261
261
  (0, typeorm_1.OneToMany)(function () { return __1.RequestLocalPayment; }, function (requestLocalPayment) { return requestLocalPayment.partner; }),
262
262
  __metadata("design:type", Array)
263
263
  ], Partner.prototype, "requests_local_payment", void 0);
264
+ __decorate([
265
+ (0, typeorm_1.OneToMany)(function () { return __1.RequestPrint; }, function (requestPrint) { return requestPrint.partner; }),
266
+ __metadata("design:type", Array)
267
+ ], Partner.prototype, "partner_prints", void 0);
268
+ __decorate([
269
+ (0, typeorm_1.OneToMany)(function () { return __1.RequestLocal; }, function (requestLocal) { return requestLocal.partner; }),
270
+ __metadata("design:type", Array)
271
+ ], Partner.prototype, "partner_request_locals", void 0);
264
272
  Partner = __decorate([
265
273
  (0, typeorm_1.Entity)({
266
274
  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,4 +1,4 @@
1
- import { RequestLocal, UserAddress } from "..";
1
+ import { RequestLocal, RequestPrint, UserAddress } from "..";
2
2
  import { RequestProduct } from "./RequestProduct";
3
3
  import { RequestProductGroupComplement } from "./RequestProductGroupComplement";
4
4
  import { User } from "./User";
@@ -19,4 +19,5 @@ export declare class Request {
19
19
  requests_group: User[];
20
20
  request_products: RequestProduct[];
21
21
  request_product_group_complements: RequestProductGroupComplement[];
22
+ request_prints: RequestPrint[];
22
23
  }
@@ -150,6 +150,10 @@ var Request = /** @class */ (function () {
150
150
  (0, typeorm_1.OneToMany)(function () { return RequestProductGroupComplement_1.RequestProductGroupComplement; }, function (requestProduct) { return requestProduct.request; }),
151
151
  __metadata("design:type", Array)
152
152
  ], Request.prototype, "request_product_group_complements", void 0);
153
+ __decorate([
154
+ (0, typeorm_1.OneToMany)(function () { return __1.RequestPrint; }, function (requestPrint) { return requestPrint.request; }),
155
+ __metadata("design:type", Array)
156
+ ], Request.prototype, "request_prints", void 0);
153
157
  Request = __decorate([
154
158
  (0, typeorm_1.Entity)({
155
159
  comment: "Tabla para agregar los pedidos realizados através de la plataforma.",
@@ -1,4 +1,4 @@
1
- import { Local, Request, RequestLocalHistory, RequestLocalPayment } from "..";
1
+ import { Local, Partner, Request, RequestLocalHistory, RequestLocalPayment } from "..";
2
2
  export declare class RequestLocal {
3
3
  id: number;
4
4
  request: Request;
@@ -8,6 +8,8 @@ export declare class RequestLocal {
8
8
  status: number;
9
9
  preparation_time: string | null;
10
10
  updated: Date | null;
11
+ order_number: number;
12
+ partner: Partner | null;
11
13
  is_notified: number;
12
14
  requests_local_history: RequestLocalHistory[];
13
15
  payments_made: RequestLocalPayment[];
@@ -88,6 +88,22 @@ var RequestLocal = /** @class */ (function () {
88
88
  }),
89
89
  __metadata("design:type", Object)
90
90
  ], RequestLocal.prototype, "updated", void 0);
91
+ __decorate([
92
+ (0, typeorm_1.Column)({
93
+ type: "int",
94
+ comment: "Número del pedido.",
95
+ }),
96
+ __metadata("design:type", Number)
97
+ ], RequestLocal.prototype, "order_number", void 0);
98
+ __decorate([
99
+ (0, typeorm_1.ManyToOne)(function () { return __1.Partner; }, function (partner) { return partner.partner_request_locals; }, {
100
+ onDelete: "CASCADE",
101
+ onUpdate: "NO ACTION",
102
+ nullable: true,
103
+ }),
104
+ (0, typeorm_1.JoinColumn)({ name: "partner" }),
105
+ __metadata("design:type", Object)
106
+ ], RequestLocal.prototype, "partner", void 0);
91
107
  __decorate([
92
108
  (0, typeorm_1.Column)({
93
109
  default: 1,
@@ -0,0 +1,10 @@
1
+ import { Partner } from "..";
2
+ import { Request } from "./Request";
3
+ export declare class RequestPrint {
4
+ id: number;
5
+ code: string;
6
+ request: Request;
7
+ type: number;
8
+ created: Date;
9
+ partner: Partner;
10
+ }
@@ -0,0 +1,76 @@
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.RequestPrint = void 0;
13
+ var typeorm_1 = require("typeorm");
14
+ var __1 = require("..");
15
+ var dateTransformer_1 = require("../transformers/dateTransformer");
16
+ var Request_1 = require("./Request");
17
+ var RequestPrint = /** @class */ (function () {
18
+ function RequestPrint() {
19
+ }
20
+ __decorate([
21
+ (0, typeorm_1.PrimaryGeneratedColumn)({
22
+ type: "int",
23
+ comment: "ID único de cada registro.",
24
+ }),
25
+ __metadata("design:type", Number)
26
+ ], RequestPrint.prototype, "id", void 0);
27
+ __decorate([
28
+ (0, typeorm_1.Column)({
29
+ length: 20,
30
+ unique: true,
31
+ type: "varchar",
32
+ comment: "Código único de cada registro.",
33
+ }),
34
+ __metadata("design:type", String)
35
+ ], RequestPrint.prototype, "code", void 0);
36
+ __decorate([
37
+ (0, typeorm_1.ManyToOne)(function () { return Request_1.Request; }, function (request) { return request.request_prints; }, {
38
+ onDelete: "CASCADE",
39
+ onUpdate: "NO ACTION",
40
+ }),
41
+ (0, typeorm_1.JoinColumn)({ name: "request" }),
42
+ __metadata("design:type", Request_1.Request)
43
+ ], RequestPrint.prototype, "request", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({
46
+ type: "int",
47
+ default: 1,
48
+ width: 1,
49
+ comment: "Tipo de impresión para el pedido:\r\n1. Comanda productos.\r\n2. Comando bebidas.\r\n3. Impresión general del pedido.",
50
+ }),
51
+ __metadata("design:type", Number)
52
+ ], RequestPrint.prototype, "type", void 0);
53
+ __decorate([
54
+ (0, typeorm_1.Column)({
55
+ type: "datetime",
56
+ transformer: new dateTransformer_1.DateTransformer(),
57
+ comment: "Fecha creación de la impresión.",
58
+ }),
59
+ __metadata("design:type", Date)
60
+ ], RequestPrint.prototype, "created", void 0);
61
+ __decorate([
62
+ (0, typeorm_1.ManyToOne)(function () { return __1.Partner; }, function (partner) { return partner.partner_prints; }, {
63
+ onDelete: "CASCADE",
64
+ onUpdate: "NO ACTION",
65
+ }),
66
+ (0, typeorm_1.JoinColumn)({ name: "partner" }),
67
+ __metadata("design:type", __1.Partner)
68
+ ], RequestPrint.prototype, "partner", void 0);
69
+ RequestPrint = __decorate([
70
+ (0, typeorm_1.Entity)("request_print", {
71
+ comment: "Registro y control de las impresiones de los pedidos.",
72
+ })
73
+ ], RequestPrint);
74
+ return RequestPrint;
75
+ }());
76
+ exports.RequestPrint = RequestPrint;
@@ -54,6 +54,7 @@ export { RequestLocalHistory } from "./entities/RequestLocalHistory";
54
54
  export { UserPaymentMethod } from "./entities/UserPaymentMethod";
55
55
  export { RequestLocalPayment } from "./entities/RequestLocalPayment";
56
56
  export { ReceiptConfig } from "./entities/ReceiptConfig";
57
+ export { RequestPrint } from "./entities/RequestPrint";
57
58
  export { LocalsCompany } from "./views/LocalsCompany";
58
59
  export { VerifyLocals } from "./views/VerifyLocals";
59
60
  export { MasterNotifications } from "./views/MasterNotifications";
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.ToppingImage = exports.ProductDate = exports.ProductSchedule = exports.CategoryDate = exports.Bank = exports.ServicePlan = exports.PartnerPlatform = exports.PartnerPermissionSection = exports.LocalPlan = exports.MasterNotification = exports.VerifyLocal = exports.PosSystem = exports.AuthenticationCredential = exports.BusinessType = exports.UserAddress = exports.User = exports.TypeMeasureIngredient = exports.Square = exports.RequestProductGroupComplement = exports.RequestProduct = exports.Request = exports.Region = exports.ProductTopping = exports.ProductIngredient = exports.ProductGroupComplement = exports.ProductGroup = exports.Product = exports.Plan = exports.PaymentMethod = exports.PartnerRole = exports.PartnerPermission = exports.PartnerNotification = exports.Partner = exports.MasterRole = exports.MasterPermission = exports.Master = exports.LocalQualification = exports.Local = exports.DiscountCodeUser = exports.DiscountCodeCompany = exports.Day = exports.Country = exports.Configuration = exports.Company = exports.CodeRedemptionHistoryUser = exports.CodeRedemptionHistoryCompany = exports.City = exports.ScheduleCategory = exports.Category = exports.BusinessTypeProduct = void 0;
18
- exports.CustomRepository = exports.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.ReceiptConfig = exports.RequestLocalPayment = exports.UserPaymentMethod = exports.RequestLocalHistory = exports.RequestLocal = exports.PartnerSession = void 0;
18
+ exports.CustomRepository = exports.PartnerNotifications = exports.DiscountsCodeUser = exports.Partners = exports.ViewLocalsCompanies = exports.MasterNotifications = exports.VerifyLocals = exports.LocalsCompany = exports.RequestPrint = exports.ReceiptConfig = exports.RequestLocalPayment = exports.UserPaymentMethod = exports.RequestLocalHistory = exports.RequestLocal = exports.PartnerSession = void 0;
19
19
  var BusinessTypeProduct_1 = require("./entities/BusinessTypeProduct");
20
20
  Object.defineProperty(exports, "BusinessTypeProduct", { enumerable: true, get: function () { return BusinessTypeProduct_1.BusinessTypeProduct; } });
21
21
  var Category_1 = require("./entities/Category");
@@ -128,6 +128,8 @@ var RequestLocalPayment_1 = require("./entities/RequestLocalPayment");
128
128
  Object.defineProperty(exports, "RequestLocalPayment", { enumerable: true, get: function () { return RequestLocalPayment_1.RequestLocalPayment; } });
129
129
  var ReceiptConfig_1 = require("./entities/ReceiptConfig");
130
130
  Object.defineProperty(exports, "ReceiptConfig", { enumerable: true, get: function () { return ReceiptConfig_1.ReceiptConfig; } });
131
+ var RequestPrint_1 = require("./entities/RequestPrint");
132
+ Object.defineProperty(exports, "RequestPrint", { enumerable: true, get: function () { return RequestPrint_1.RequestPrint; } });
131
133
  var LocalsCompany_1 = require("./views/LocalsCompany");
132
134
  Object.defineProperty(exports, "LocalsCompany", { enumerable: true, get: function () { return LocalsCompany_1.LocalsCompany; } });
133
135
  var VerifyLocals_1 = require("./views/VerifyLocals");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "3.4.0",
3
+ "version": "3.4.2",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,8 +13,10 @@ import {
13
13
  MasterNotification,
14
14
  PartnerSession,
15
15
  Product,
16
+ RequestLocal,
16
17
  RequestLocalHistory,
17
18
  RequestLocalPayment,
19
+ RequestPrint,
18
20
  VerifyLocal,
19
21
  } from "..";
20
22
  import { DateTransformer } from "../transformers/dateTransformer";
@@ -256,4 +258,10 @@ export class Partner {
256
258
  (requestLocalPayment) => requestLocalPayment.partner
257
259
  )
258
260
  requests_local_payment: RequestLocalPayment[];
261
+
262
+ @OneToMany(() => RequestPrint, (requestPrint) => requestPrint.partner)
263
+ partner_prints: RequestPrint[];
264
+
265
+ @OneToMany(() => RequestLocal, (requestLocal) => requestLocal.partner)
266
+ partner_request_locals: RequestLocal[];
259
267
  }
@@ -8,7 +8,7 @@ import {
8
8
  OneToMany,
9
9
  PrimaryGeneratedColumn,
10
10
  } from "typeorm";
11
- import { RequestLocal, UserAddress } from "..";
11
+ import { RequestLocal, RequestPrint, UserAddress } from "..";
12
12
  import { DateTransformer } from "../transformers/dateTransformer";
13
13
  import { RequestProduct } from "./RequestProduct";
14
14
  import { RequestProductGroupComplement } from "./RequestProductGroupComplement";
@@ -143,4 +143,7 @@ export class Request {
143
143
  (requestProduct) => requestProduct.request
144
144
  )
145
145
  request_product_group_complements: RequestProductGroupComplement[];
146
+
147
+ @OneToMany(() => RequestPrint, (requestPrint) => requestPrint.request)
148
+ request_prints: RequestPrint[];
146
149
  }
@@ -6,7 +6,13 @@ import {
6
6
  OneToMany,
7
7
  PrimaryGeneratedColumn,
8
8
  } from "typeorm";
9
- import { Local, Request, RequestLocalHistory, RequestLocalPayment } from "..";
9
+ import {
10
+ Local,
11
+ Partner,
12
+ Request,
13
+ RequestLocalHistory,
14
+ RequestLocalPayment,
15
+ } from "..";
10
16
  import { DateTransformer } from "../transformers/dateTransformer";
11
17
 
12
18
  @Entity({
@@ -82,6 +88,20 @@ export class RequestLocal {
82
88
  })
83
89
  updated: Date | null;
84
90
 
91
+ @Column({
92
+ type: "int",
93
+ comment: "Número del pedido.",
94
+ })
95
+ order_number: number;
96
+
97
+ @ManyToOne(() => Partner, (partner) => partner.partner_request_locals, {
98
+ onDelete: "CASCADE",
99
+ onUpdate: "NO ACTION",
100
+ nullable: true,
101
+ })
102
+ @JoinColumn({ name: "partner" })
103
+ partner: Partner | null;
104
+
85
105
  @Column({
86
106
  default: 1,
87
107
  type: "int",
@@ -0,0 +1,59 @@
1
+ import {
2
+ Column,
3
+ Entity,
4
+ JoinColumn,
5
+ ManyToOne,
6
+ PrimaryGeneratedColumn,
7
+ } from "typeorm";
8
+ import { Partner } from "..";
9
+ import { DateTransformer } from "../transformers/dateTransformer";
10
+ import { Request } from "./Request";
11
+
12
+ @Entity("request_print", {
13
+ comment: "Registro y control de las impresiones de los pedidos.",
14
+ })
15
+ export class RequestPrint {
16
+ @PrimaryGeneratedColumn({
17
+ type: "int",
18
+ comment: "ID único de cada registro.",
19
+ })
20
+ id: number;
21
+
22
+ @Column({
23
+ length: 20,
24
+ unique: true,
25
+ type: "varchar",
26
+ comment: "Código único de cada registro.",
27
+ })
28
+ code: string;
29
+
30
+ @ManyToOne(() => Request, (request) => request.request_prints, {
31
+ onDelete: "CASCADE",
32
+ onUpdate: "NO ACTION",
33
+ })
34
+ @JoinColumn({ name: "request" })
35
+ request: Request;
36
+
37
+ @Column({
38
+ type: "int",
39
+ default: 1,
40
+ width: 1,
41
+ comment:
42
+ "Tipo de impresión para el pedido:\r\n1. Comanda productos.\r\n2. Comando bebidas.\r\n3. Impresión general del pedido.",
43
+ })
44
+ type: number;
45
+
46
+ @Column({
47
+ type: "datetime",
48
+ transformer: new DateTransformer(),
49
+ comment: "Fecha creación de la impresión.",
50
+ })
51
+ created: Date;
52
+
53
+ @ManyToOne(() => Partner, (partner) => partner.partner_prints, {
54
+ onDelete: "CASCADE",
55
+ onUpdate: "NO ACTION",
56
+ })
57
+ @JoinColumn({ name: "partner" })
58
+ partner: Partner;
59
+ }
@@ -54,6 +54,7 @@ export { RequestLocalHistory } from "./entities/RequestLocalHistory";
54
54
  export { UserPaymentMethod } from "./entities/UserPaymentMethod";
55
55
  export { RequestLocalPayment } from "./entities/RequestLocalPayment";
56
56
  export { ReceiptConfig } from "./entities/ReceiptConfig";
57
+ export { RequestPrint } from "./entities/RequestPrint";
57
58
 
58
59
  export { LocalsCompany } from "./views/LocalsCompany";
59
60
  export { VerifyLocals } from "./views/VerifyLocals";