test-entity-library-asm 2.0.6 → 2.0.8

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,5 +1,5 @@
1
- import { Company } from './Company';
2
1
  import { CodeRedemptionHistoryUser } from './CodeRedemptionHistoryUser';
2
+ import { Company } from './Company';
3
3
  import { Partner } from './Partner';
4
4
  export declare class DiscountCodeUser {
5
5
  id: number;
@@ -11,8 +11,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.DiscountCodeUser = void 0;
13
13
  var typeorm_1 = require("typeorm");
14
- var Company_1 = require("./Company");
15
14
  var CodeRedemptionHistoryUser_1 = require("./CodeRedemptionHistoryUser");
15
+ var Company_1 = require("./Company");
16
16
  var Partner_1 = require("./Partner");
17
17
  var DiscountCodeUser = /** @class */ (function () {
18
18
  function DiscountCodeUser() {
@@ -5,6 +5,7 @@ import { Local } from './Local';
5
5
  import { PartnerRole } from './PartnerRole';
6
6
  import { Terminal } from './Terminal';
7
7
  import { TerminalSession } from './TerminalSession';
8
+ import { PartnerNotification } from './PartnerNotification';
8
9
  export declare class Partner {
9
10
  id: number;
10
11
  company: Company;
@@ -29,4 +30,5 @@ export declare class Partner {
29
30
  partners_roles: PartnerRole[];
30
31
  terminals: Terminal[];
31
32
  sessions: TerminalSession[];
33
+ partners_notification: PartnerNotification[];
32
34
  }
@@ -20,6 +20,7 @@ var PartnerRole_1 = require("./PartnerRole");
20
20
  var Terminal_1 = require("./Terminal");
21
21
  var TerminalSession_1 = require("./TerminalSession");
22
22
  var dateTransformer_1 = require("../transformers/dateTransformer");
23
+ var PartnerNotification_1 = require("./PartnerNotification");
23
24
  var Partner = /** @class */ (function () {
24
25
  function Partner() {
25
26
  }
@@ -194,6 +195,10 @@ var Partner = /** @class */ (function () {
194
195
  (0, typeorm_1.OneToMany)(function () { return TerminalSession_1.TerminalSession; }, function (terminalSession) { return terminalSession.partner; }),
195
196
  __metadata("design:type", Array)
196
197
  ], Partner.prototype, "sessions", void 0);
198
+ __decorate([
199
+ (0, typeorm_1.OneToMany)(function () { return PartnerNotification_1.PartnerNotification; }, function (partnerNotification) { return partnerNotification.partner; }),
200
+ __metadata("design:type", Array)
201
+ ], Partner.prototype, "partners_notification", void 0);
197
202
  Partner = __decorate([
198
203
  (0, typeorm_1.Entity)({
199
204
  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.',
@@ -0,0 +1,12 @@
1
+ import { Partner } from './Partner';
2
+ export declare class PartnerNotification {
3
+ id: number;
4
+ code: string;
5
+ partner: Partner;
6
+ name: string;
7
+ description: string;
8
+ settings: string;
9
+ type: number;
10
+ status: number;
11
+ created: Date;
12
+ }
@@ -0,0 +1,89 @@
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.PartnerNotification = void 0;
13
+ var typeorm_1 = require("typeorm");
14
+ var Partner_1 = require("./Partner");
15
+ var dateTransformer_1 = require("../transformers/dateTransformer");
16
+ var PartnerNotification = /** @class */ (function () {
17
+ function PartnerNotification() {
18
+ }
19
+ __decorate([
20
+ (0, typeorm_1.PrimaryGeneratedColumn)({
21
+ comment: 'ID único para cada notificación',
22
+ }),
23
+ __metadata("design:type", Number)
24
+ ], PartnerNotification.prototype, "id", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.Column)({ length: 10, unique: true, comment: 'Código único del rol.' }),
27
+ __metadata("design:type", String)
28
+ ], PartnerNotification.prototype, "code", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.ManyToOne)(function () { return Partner_1.Partner; }, function (partner) { return partner.partners_notification; }, {
31
+ onDelete: 'CASCADE',
32
+ onUpdate: 'NO ACTION',
33
+ }),
34
+ (0, typeorm_1.JoinColumn)({ name: 'partner' }),
35
+ __metadata("design:type", Partner_1.Partner)
36
+ ], PartnerNotification.prototype, "partner", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)({
39
+ length: 50,
40
+ comment: 'Nombre de la notificación.',
41
+ }),
42
+ __metadata("design:type", String)
43
+ ], PartnerNotification.prototype, "name", void 0);
44
+ __decorate([
45
+ (0, typeorm_1.Column)({
46
+ length: 40,
47
+ nullable: true,
48
+ comment: 'Descripción de la notificación.',
49
+ }),
50
+ __metadata("design:type", String)
51
+ ], PartnerNotification.prototype, "description", void 0);
52
+ __decorate([
53
+ (0, typeorm_1.Column)({
54
+ type: 'json',
55
+ nullable: true,
56
+ comment: 'Configuración adicional de la notificación, como enlaces, qué hace después de darle click...',
57
+ }),
58
+ __metadata("design:type", String)
59
+ ], PartnerNotification.prototype, "settings", void 0);
60
+ __decorate([
61
+ (0, typeorm_1.Column)({
62
+ default: 1,
63
+ comment: 'Si la notificación está pendiente o leída:\r\n1. Pendiente.\r\n2. Leída.',
64
+ }),
65
+ __metadata("design:type", Number)
66
+ ], PartnerNotification.prototype, "type", void 0);
67
+ __decorate([
68
+ (0, typeorm_1.Column)({
69
+ default: 1,
70
+ comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
71
+ }),
72
+ __metadata("design:type", Number)
73
+ ], PartnerNotification.prototype, "status", void 0);
74
+ __decorate([
75
+ (0, typeorm_1.Column)({
76
+ type: 'datetime',
77
+ comment: 'Fecha de creación de la notificación.',
78
+ transformer: new dateTransformer_1.DateTransformer(),
79
+ }),
80
+ __metadata("design:type", Date)
81
+ ], PartnerNotification.prototype, "created", void 0);
82
+ PartnerNotification = __decorate([
83
+ (0, typeorm_1.Entity)('partner_notification', {
84
+ comment: 'Tabla creada para almacenar las notificaciones del usuario.',
85
+ })
86
+ ], PartnerNotification);
87
+ return PartnerNotification;
88
+ }());
89
+ exports.PartnerNotification = PartnerNotification;
@@ -2,6 +2,7 @@ import { Company } from './Company';
2
2
  export declare class TypeFood {
3
3
  id: number;
4
4
  name: string;
5
+ photo: string;
5
6
  status: number;
6
7
  companies: Company[];
7
8
  }
@@ -28,6 +28,14 @@ var TypeFood = /** @class */ (function () {
28
28
  }),
29
29
  __metadata("design:type", String)
30
30
  ], TypeFood.prototype, "name", void 0);
31
+ __decorate([
32
+ (0, typeorm_1.Column)({
33
+ length: 500,
34
+ nullable: true,
35
+ comment: 'Imagen para el tipo de comida.',
36
+ }),
37
+ __metadata("design:type", String)
38
+ ], TypeFood.prototype, "photo", void 0);
31
39
  __decorate([
32
40
  (0, typeorm_1.Column)({
33
41
  default: 1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
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,14 +1,13 @@
1
1
  import {
2
- Entity,
3
2
  Column,
4
- PrimaryGeneratedColumn,
5
- ManyToOne,
3
+ Entity,
6
4
  JoinColumn,
5
+ ManyToOne,
7
6
  OneToMany,
7
+ PrimaryGeneratedColumn,
8
8
  } from 'typeorm'
9
- import { User } from './User'
10
- import { Company } from './Company'
11
9
  import { CodeRedemptionHistoryUser } from './CodeRedemptionHistoryUser'
10
+ import { Company } from './Company'
12
11
  import { Partner } from './Partner'
13
12
 
14
13
  @Entity('discount_code_user', {
@@ -18,6 +18,7 @@ import { PartnerRole } from './PartnerRole'
18
18
  import { Terminal } from './Terminal'
19
19
  import { TerminalSession } from './TerminalSession'
20
20
  import { DateTransformer } from '../transformers/dateTransformer'
21
+ import { PartnerNotification } from './PartnerNotification'
21
22
 
22
23
  @Entity({
23
24
  comment:
@@ -180,4 +181,10 @@ export class Partner {
180
181
  (terminalSession) => terminalSession.partner
181
182
  )
182
183
  sessions: TerminalSession[]
184
+
185
+ @OneToMany(
186
+ () => PartnerNotification,
187
+ (partnerNotification) => partnerNotification.partner
188
+ )
189
+ partners_notification: PartnerNotification[]
183
190
  }
@@ -0,0 +1,71 @@
1
+ import {
2
+ Column,
3
+ Entity,
4
+ JoinColumn,
5
+ ManyToOne,
6
+ PrimaryGeneratedColumn,
7
+ } from 'typeorm'
8
+ import { Partner } from './Partner'
9
+ import { DateTransformer } from '../transformers/dateTransformer'
10
+
11
+ @Entity('partner_notification', {
12
+ comment: 'Tabla creada para almacenar las notificaciones del usuario.',
13
+ })
14
+ export class PartnerNotification {
15
+ @PrimaryGeneratedColumn({
16
+ comment: 'ID único para cada notificación',
17
+ })
18
+ id: number
19
+
20
+ @Column({ length: 10, unique: true, comment: 'Código único del rol.' })
21
+ code: string
22
+
23
+ @ManyToOne(() => Partner, (partner) => partner.partners_notification, {
24
+ onDelete: 'CASCADE',
25
+ onUpdate: 'NO ACTION',
26
+ })
27
+ @JoinColumn({ name: 'partner' })
28
+ partner: Partner
29
+
30
+ @Column({
31
+ length: 50,
32
+ comment: 'Nombre de la notificación.',
33
+ })
34
+ name: string
35
+
36
+ @Column({
37
+ length: 40,
38
+ nullable: true,
39
+ comment: 'Descripción de la notificación.',
40
+ })
41
+ description: string
42
+
43
+ @Column({
44
+ type: 'json',
45
+ nullable: true,
46
+ comment:
47
+ 'Configuración adicional de la notificación, como enlaces, qué hace después de darle click...',
48
+ })
49
+ settings: string
50
+
51
+ @Column({
52
+ default: 1,
53
+ comment:
54
+ 'Si la notificación está pendiente o leída:\r\n1. Pendiente.\r\n2. Leída.',
55
+ })
56
+ type: number
57
+
58
+ @Column({
59
+ default: 1,
60
+ comment:
61
+ 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
62
+ })
63
+ status: number
64
+
65
+ @Column({
66
+ type: 'datetime',
67
+ comment: 'Fecha de creación de la notificación.',
68
+ transformer: new DateTransformer(),
69
+ })
70
+ created: Date
71
+ }
@@ -3,7 +3,7 @@ import {
3
3
  Entity,
4
4
  JoinTable,
5
5
  ManyToMany,
6
- PrimaryGeneratedColumn
6
+ PrimaryGeneratedColumn,
7
7
  } from 'typeorm'
8
8
  import { Company } from './Company'
9
9
 
@@ -23,6 +23,13 @@ export class TypeFood {
23
23
  })
24
24
  name: string
25
25
 
26
+ @Column({
27
+ length: 500,
28
+ nullable: true,
29
+ comment: 'Imagen para el tipo de comida.',
30
+ })
31
+ photo: string
32
+
26
33
  @Column({
27
34
  default: 1,
28
35
  comment: