test-entity-library-asm 3.3.8 → 3.4.1

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, 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,5 @@ 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[];
42
43
  }
@@ -261,6 +261,10 @@ 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.request; }),
266
+ __metadata("design:type", Array)
267
+ ], Partner.prototype, "partner_prints", void 0);
264
268
  Partner = __decorate([
265
269
  (0, typeorm_1.Entity)({
266
270
  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.",
@@ -8,6 +8,10 @@ export declare class ReceiptConfig {
8
8
  is_address: number;
9
9
  is_phone: number;
10
10
  format_date: string;
11
+ ticket_width_mm: string;
12
+ is_show_user_box: number;
13
+ is_show_unit_price: number;
14
+ is_divide_name_and_quantity: number;
11
15
  custom_message_below: any | null;
12
16
  custom_message_top: any | null;
13
17
  details: any | null;
@@ -88,6 +88,42 @@ var ReceiptConfig = /** @class */ (function () {
88
88
  }),
89
89
  __metadata("design:type", String)
90
90
  ], ReceiptConfig.prototype, "format_date", void 0);
91
+ __decorate([
92
+ (0, typeorm_1.Column)({
93
+ length: 4,
94
+ type: "varchar",
95
+ default: "80mm",
96
+ comment: "Tamaño que va a tener la impresión de facturas:\r\n1: 80mm.\r\n2: 58mm.",
97
+ }),
98
+ __metadata("design:type", String)
99
+ ], ReceiptConfig.prototype, "ticket_width_mm", void 0);
100
+ __decorate([
101
+ (0, typeorm_1.Column)({
102
+ default: 1,
103
+ type: "int",
104
+ width: 1,
105
+ comment: "Mostrar información del usuario que recibe el pago y entrega las cuentas:\r\n1: Sí.\r\n0: No.",
106
+ }),
107
+ __metadata("design:type", Number)
108
+ ], ReceiptConfig.prototype, "is_show_user_box", void 0);
109
+ __decorate([
110
+ (0, typeorm_1.Column)({
111
+ default: 1,
112
+ type: "int",
113
+ width: 1,
114
+ comment: "Mostrar el precio unitario de los productos:\r\n1: Sí.\r\n0: No.",
115
+ }),
116
+ __metadata("design:type", Number)
117
+ ], ReceiptConfig.prototype, "is_show_unit_price", void 0);
118
+ __decorate([
119
+ (0, typeorm_1.Column)({
120
+ default: 1,
121
+ type: "int",
122
+ width: 1,
123
+ comment: "Dividir en columnas separadas el nombre y la cantidad del producto:\r\n1: Sí.\r\n0: No.",
124
+ }),
125
+ __metadata("design:type", Number)
126
+ ], ReceiptConfig.prototype, "is_divide_name_and_quantity", void 0);
91
127
  __decorate([
92
128
  (0, typeorm_1.Column)({
93
129
  type: "text",
@@ -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.",
@@ -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.3.8",
3
+ "version": "3.4.1",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -15,6 +15,7 @@ import {
15
15
  Product,
16
16
  RequestLocalHistory,
17
17
  RequestLocalPayment,
18
+ RequestPrint,
18
19
  VerifyLocal,
19
20
  } from "..";
20
21
  import { DateTransformer } from "../transformers/dateTransformer";
@@ -256,4 +257,10 @@ export class Partner {
256
257
  (requestLocalPayment) => requestLocalPayment.partner
257
258
  )
258
259
  requests_local_payment: RequestLocalPayment[];
260
+
261
+ @OneToMany(
262
+ () => RequestPrint,
263
+ (requestPrint) => requestPrint.request
264
+ )
265
+ partner_prints: RequestPrint[];
259
266
  }
@@ -83,6 +83,41 @@ export class ReceiptConfig {
83
83
  })
84
84
  format_date: string;
85
85
 
86
+ @Column({
87
+ length: 4,
88
+ type: "varchar",
89
+ default: "80mm",
90
+ comment:
91
+ "Tamaño que va a tener la impresión de facturas:\r\n1: 80mm.\r\n2: 58mm.",
92
+ })
93
+ ticket_width_mm: string;
94
+
95
+ @Column({
96
+ default: 1,
97
+ type: "int",
98
+ width: 1,
99
+ comment:
100
+ "Mostrar información del usuario que recibe el pago y entrega las cuentas:\r\n1: Sí.\r\n0: No.",
101
+ })
102
+ is_show_user_box: number;
103
+
104
+ @Column({
105
+ default: 1,
106
+ type: "int",
107
+ width: 1,
108
+ comment: "Mostrar el precio unitario de los productos:\r\n1: Sí.\r\n0: No.",
109
+ })
110
+ is_show_unit_price: number;
111
+
112
+ @Column({
113
+ default: 1,
114
+ type: "int",
115
+ width: 1,
116
+ comment:
117
+ "Dividir en columnas separadas el nombre y la cantidad del producto:\r\n1: Sí.\r\n0: No.",
118
+ })
119
+ is_divide_name_and_quantity: number;
120
+
86
121
  @Column({
87
122
  type: "text",
88
123
  nullable: true,
@@ -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
  }
@@ -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";