test-entity-library-asm 2.6.25 → 2.6.26

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,7 +1,9 @@
1
1
  import { PartnerRole } from './PartnerRole';
2
+ import { PartnerPermissionSection } from '..';
2
3
  export declare class PartnerPermission {
3
4
  id: number;
4
5
  code: string;
6
+ section: PartnerPermissionSection;
5
7
  name: string;
6
8
  description: string;
7
9
  icon: string;
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.PartnerPermission = void 0;
13
13
  var typeorm_1 = require("typeorm");
14
14
  var PartnerRole_1 = require("./PartnerRole");
15
+ var __1 = require("..");
15
16
  var PartnerPermission = /** @class */ (function () {
16
17
  function PartnerPermission() {
17
18
  }
@@ -25,6 +26,16 @@ var PartnerPermission = /** @class */ (function () {
25
26
  (0, typeorm_1.Column)({ length: 10, unique: true, comment: 'Código del permiso.' }),
26
27
  __metadata("design:type", String)
27
28
  ], PartnerPermission.prototype, "code", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.ManyToOne)(function () { return __1.PartnerPermissionSection; }, function (partnerPermissionSection) {
31
+ return partnerPermissionSection.partner_permissions_sections;
32
+ }, {
33
+ onDelete: 'RESTRICT',
34
+ onUpdate: 'NO ACTION',
35
+ }),
36
+ (0, typeorm_1.JoinColumn)({ name: 'section' }),
37
+ __metadata("design:type", __1.PartnerPermissionSection)
38
+ ], PartnerPermission.prototype, "section", void 0);
28
39
  __decorate([
29
40
  (0, typeorm_1.Column)({
30
41
  length: 40,
@@ -1,4 +1,4 @@
1
- import { PartnerPlatform } from '..';
1
+ import { PartnerPermission, PartnerPlatform } from '..';
2
2
  export declare class PartnerPermissionSection {
3
3
  id: number;
4
4
  code: string;
@@ -7,4 +7,5 @@ export declare class PartnerPermissionSection {
7
7
  description: string;
8
8
  icon: string;
9
9
  status: number;
10
+ partner_permissions_sections: PartnerPermission[];
10
11
  }
@@ -30,7 +30,7 @@ var PartnerPermissionSection = /** @class */ (function () {
30
30
  onDelete: 'RESTRICT',
31
31
  onUpdate: 'NO ACTION',
32
32
  }),
33
- (0, typeorm_1.JoinColumn)({ name: 'company' }),
33
+ (0, typeorm_1.JoinColumn)({ name: 'platform' }),
34
34
  __metadata("design:type", __1.PartnerPlatform)
35
35
  ], PartnerPermissionSection.prototype, "platform", void 0);
36
36
  __decorate([
@@ -63,6 +63,10 @@ var PartnerPermissionSection = /** @class */ (function () {
63
63
  }),
64
64
  __metadata("design:type", Number)
65
65
  ], PartnerPermissionSection.prototype, "status", void 0);
66
+ __decorate([
67
+ (0, typeorm_1.OneToMany)(function () { return __1.PartnerPermission; }, function (partnerPermissionSection) { return partnerPermissionSection.section; }),
68
+ __metadata("design:type", Array)
69
+ ], PartnerPermissionSection.prototype, "partner_permissions_sections", void 0);
66
70
  PartnerPermissionSection = __decorate([
67
71
  (0, typeorm_1.Entity)('partner_permission_section', {
68
72
  comment: 'Tabla creada para agregar las secciones para lo permisos del partner.',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "2.6.25",
3
+ "version": "2.6.26",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,11 +1,14 @@
1
1
  import {
2
2
  Column,
3
3
  Entity,
4
+ JoinColumn,
4
5
  JoinTable,
5
6
  ManyToMany,
7
+ ManyToOne,
6
8
  PrimaryGeneratedColumn,
7
9
  } from 'typeorm'
8
10
  import { PartnerRole } from './PartnerRole'
11
+ import { PartnerPermissionSection } from '..'
9
12
 
10
13
  @Entity('partner_permission', {
11
14
  comment:
@@ -20,6 +23,18 @@ export class PartnerPermission {
20
23
  @Column({ length: 10, unique: true, comment: 'Código del permiso.' })
21
24
  code: string
22
25
 
26
+ @ManyToOne(
27
+ () => PartnerPermissionSection,
28
+ (partnerPermissionSection) =>
29
+ partnerPermissionSection.partner_permissions_sections,
30
+ {
31
+ onDelete: 'RESTRICT',
32
+ onUpdate: 'NO ACTION',
33
+ }
34
+ )
35
+ @JoinColumn({ name: 'section' })
36
+ section: PartnerPermissionSection
37
+
23
38
  @Column({
24
39
  length: 40,
25
40
  comment:
@@ -3,9 +3,10 @@ import {
3
3
  Entity,
4
4
  JoinColumn,
5
5
  ManyToOne,
6
+ OneToMany,
6
7
  PrimaryGeneratedColumn,
7
8
  } from 'typeorm'
8
- import { PartnerPlatform } from '..'
9
+ import { PartnerPermission, PartnerPlatform } from '..'
9
10
 
10
11
  @Entity('partner_permission_section', {
11
12
  comment:
@@ -28,7 +29,7 @@ export class PartnerPermissionSection {
28
29
  onUpdate: 'NO ACTION',
29
30
  }
30
31
  )
31
- @JoinColumn({ name: 'company' })
32
+ @JoinColumn({ name: 'platform' })
32
33
  platform: PartnerPlatform
33
34
 
34
35
  @Column({
@@ -59,4 +60,10 @@ export class PartnerPermissionSection {
59
60
  'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
60
61
  })
61
62
  status: number
63
+
64
+ @OneToMany(
65
+ () => PartnerPermission,
66
+ (partnerPermissionSection) => partnerPermissionSection.section
67
+ )
68
+ partner_permissions_sections: PartnerPermission[]
62
69
  }