test-entity-library-asm 3.4.1 → 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, RequestPrint, 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";
@@ -40,4 +40,5 @@ export declare class Partner {
40
40
  updated_by_history: RequestLocalHistory[];
41
41
  requests_local_payment: RequestLocalPayment[];
42
42
  partner_prints: RequestPrint[];
43
+ partner_request_locals: RequestLocal[];
43
44
  }
@@ -262,9 +262,13 @@ var Partner = /** @class */ (function () {
262
262
  __metadata("design:type", Array)
263
263
  ], Partner.prototype, "requests_local_payment", void 0);
264
264
  __decorate([
265
- (0, typeorm_1.OneToMany)(function () { return __1.RequestPrint; }, function (requestPrint) { return requestPrint.request; }),
265
+ (0, typeorm_1.OneToMany)(function () { return __1.RequestPrint; }, function (requestPrint) { return requestPrint.partner; }),
266
266
  __metadata("design:type", Array)
267
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);
268
272
  Partner = __decorate([
269
273
  (0, typeorm_1.Entity)({
270
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 { 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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "3.4.1",
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,6 +13,7 @@ import {
13
13
  MasterNotification,
14
14
  PartnerSession,
15
15
  Product,
16
+ RequestLocal,
16
17
  RequestLocalHistory,
17
18
  RequestLocalPayment,
18
19
  RequestPrint,
@@ -258,9 +259,9 @@ export class Partner {
258
259
  )
259
260
  requests_local_payment: RequestLocalPayment[];
260
261
 
261
- @OneToMany(
262
- () => RequestPrint,
263
- (requestPrint) => requestPrint.request
264
- )
262
+ @OneToMany(() => RequestPrint, (requestPrint) => requestPrint.partner)
265
263
  partner_prints: RequestPrint[];
264
+
265
+ @OneToMany(() => RequestLocal, (requestLocal) => requestLocal.partner)
266
+ partner_request_locals: RequestLocal[];
266
267
  }
@@ -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",