test-entity-library-asm 1.4.2 → 1.4.3

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.
@@ -26,4 +26,5 @@ export declare class Company {
26
26
  code_redemption_history_company: CodeRedemptionHistoryCompany[];
27
27
  discount_code_users: DiscountCodeUser[];
28
28
  product_toppings: ProductTopping[];
29
+ partners_company: Partner[];
29
30
  }
@@ -143,6 +143,10 @@ var Company = /** @class */ (function () {
143
143
  (0, typeorm_1.OneToMany)(function () { return ProductTopping_1.ProductTopping; }, function (productTopping) { return productTopping.company; }),
144
144
  __metadata("design:type", Array)
145
145
  ], Company.prototype, "product_toppings", void 0);
146
+ __decorate([
147
+ (0, typeorm_1.OneToMany)(function () { return Partner_1.Partner; }, function (partner) { return partner.company; }),
148
+ __metadata("design:type", Array)
149
+ ], Company.prototype, "partners_company", void 0);
146
150
  Company = __decorate([
147
151
  (0, typeorm_1.Entity)({
148
152
  comment: 'Tabla creada para las empresas de comida rápida que deseen registrarse en la plataforma.',
@@ -7,6 +7,7 @@ import { Terminal } from './Terminal';
7
7
  import { TerminalSession } from './TerminalSession';
8
8
  export declare class Partner {
9
9
  id: number;
10
+ company: Company;
10
11
  code: string;
11
12
  document: string;
12
13
  name: string;
@@ -27,6 +27,15 @@ var Partner = /** @class */ (function () {
27
27
  }),
28
28
  __metadata("design:type", Number)
29
29
  ], Partner.prototype, "id", void 0);
30
+ __decorate([
31
+ (0, typeorm_1.ManyToOne)(function () { return Company_1.Company; }, function (company) { return company.partners_company; }, {
32
+ onDelete: 'CASCADE',
33
+ onUpdate: 'NO ACTION',
34
+ nullable: true
35
+ }),
36
+ (0, typeorm_1.JoinColumn)({ name: 'company' }),
37
+ __metadata("design:type", Company_1.Company)
38
+ ], Partner.prototype, "company", void 0);
30
39
  __decorate([
31
40
  (0, typeorm_1.Column)({ length: 30, unique: true, comment: 'Código único del partner.' }),
32
41
  __metadata("design:type", String)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -136,4 +136,7 @@ export class Company {
136
136
 
137
137
  @OneToMany(() => ProductTopping, (productTopping) => productTopping.company)
138
138
  product_toppings: ProductTopping[]
139
+
140
+ @OneToMany(() => Partner, (partner) => partner.company)
141
+ partners_company: Partner[]
139
142
  }
@@ -26,6 +26,14 @@ export class Partner {
26
26
  })
27
27
  id: number
28
28
 
29
+ @ManyToOne(() => Company, (company) => company.partners_company, {
30
+ onDelete: 'CASCADE',
31
+ onUpdate: 'NO ACTION',
32
+ nullable: true
33
+ })
34
+ @JoinColumn({ name: 'company' })
35
+ company: Company
36
+
29
37
  @Column({ length: 30, unique: true, comment: 'Código único del partner.' })
30
38
  code: string
31
39