test-entity-library-asm 2.9.4 → 2.9.6

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.
@@ -0,0 +1,8 @@
1
+ import { Country } from "./Country";
2
+ export declare class Bank {
3
+ id: number;
4
+ code: string;
5
+ country: Country;
6
+ name: string;
7
+ status: number;
8
+ }
@@ -0,0 +1,61 @@
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.Bank = void 0;
13
+ var typeorm_1 = require("typeorm");
14
+ var Country_1 = require("./Country");
15
+ var Bank = /** @class */ (function () {
16
+ function Bank() {
17
+ }
18
+ __decorate([
19
+ (0, typeorm_1.PrimaryGeneratedColumn)({
20
+ comment: "Número de identificación (ID) único de cada registro.",
21
+ }),
22
+ __metadata("design:type", Number)
23
+ ], Bank.prototype, "id", void 0);
24
+ __decorate([
25
+ (0, typeorm_1.Column)({
26
+ length: 20,
27
+ comment: "Código identificador de la entidad bancaria.\r\n\r\nEste código es único y no se puede repetir por país.",
28
+ }),
29
+ __metadata("design:type", String)
30
+ ], Bank.prototype, "code", void 0);
31
+ __decorate([
32
+ (0, typeorm_1.ManyToOne)(function () { return Country_1.Country; }, function (country) { return country.banks; }, {
33
+ onDelete: "RESTRICT",
34
+ onUpdate: "NO ACTION",
35
+ }),
36
+ (0, typeorm_1.JoinColumn)({ name: "country" }),
37
+ __metadata("design:type", Country_1.Country)
38
+ ], Bank.prototype, "country", void 0);
39
+ __decorate([
40
+ (0, typeorm_1.Column)({
41
+ length: 50,
42
+ comment: "Nombre de la entidad bancaria.\r\n\r\nEste nombre es el que se mostrará en la plataforma.",
43
+ }),
44
+ __metadata("design:type", String)
45
+ ], Bank.prototype, "name", void 0);
46
+ __decorate([
47
+ (0, typeorm_1.Column)({
48
+ default: 1,
49
+ comment: "Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
50
+ }),
51
+ __metadata("design:type", Number)
52
+ ], Bank.prototype, "status", void 0);
53
+ Bank = __decorate([
54
+ (0, typeorm_1.Entity)({
55
+ comment: "Tabla creada para guardar los tipos de bancos que hay en la plataforma por país.",
56
+ }),
57
+ (0, typeorm_1.Unique)("unique_code_per_country", ["code", "country"])
58
+ ], Bank);
59
+ return Bank;
60
+ }());
61
+ exports.Bank = Bank;
@@ -1,4 +1,5 @@
1
- import { Region } from './Region';
1
+ import { Region } from "./Region";
2
+ import { Bank } from "..";
2
3
  export declare class Country {
3
4
  id: number;
4
5
  code: string;
@@ -11,4 +12,5 @@ export declare class Country {
11
12
  details: any;
12
13
  status: number;
13
14
  regions: Region[];
15
+ banks: Bank[];
14
16
  }
@@ -13,70 +13,71 @@ exports.Country = void 0;
13
13
  var typeorm_1 = require("typeorm");
14
14
  var Region_1 = require("./Region");
15
15
  var jsonTransformer_1 = require("../transformers/jsonTransformer");
16
+ var __1 = require("..");
16
17
  var Country = /** @class */ (function () {
17
18
  function Country() {
18
19
  }
19
20
  __decorate([
20
21
  (0, typeorm_1.PrimaryGeneratedColumn)({
21
- comment: 'Número de identificación (ID) único de cada registro.',
22
+ comment: "Número de identificación (ID) único de cada registro.",
22
23
  }),
23
24
  __metadata("design:type", Number)
24
25
  ], Country.prototype, "id", void 0);
25
26
  __decorate([
26
- (0, typeorm_1.Column)({ length: 10, comment: 'Código del país.' }),
27
+ (0, typeorm_1.Column)({ length: 10, comment: "Código del país." }),
27
28
  __metadata("design:type", String)
28
29
  ], Country.prototype, "code", void 0);
29
30
  __decorate([
30
- (0, typeorm_1.Column)({ length: 50, comment: 'Nombre del país.' }),
31
+ (0, typeorm_1.Column)({ length: 50, comment: "Nombre del país." }),
31
32
  __metadata("design:type", String)
32
33
  ], Country.prototype, "name", void 0);
33
34
  __decorate([
34
35
  (0, typeorm_1.Column)({
35
36
  length: 10,
36
- comment: 'Usamos esta columna para saber la moneda del país y sugerírsela al usuario o al local.',
37
+ comment: "Usamos esta columna para saber la moneda del país y sugerírsela al usuario o al local.",
37
38
  }),
38
39
  __metadata("design:type", String)
39
40
  ], Country.prototype, "currency", void 0);
40
41
  __decorate([
41
- (0, typeorm_1.Column)({ length: 10, comment: 'Prefijo para los números de teléfono.' }),
42
+ (0, typeorm_1.Column)({ length: 10, comment: "Prefijo para los números de teléfono." }),
42
43
  __metadata("design:type", String)
43
44
  ], Country.prototype, "prefix", void 0);
44
45
  __decorate([
45
46
  (0, typeorm_1.Column)({
46
47
  length: 15,
47
- comment: 'Estructura que tiene el teléfono en ese país.',
48
+ comment: "Estructura que tiene el teléfono en ese país.",
48
49
  }),
49
50
  __metadata("design:type", String)
50
51
  ], Country.prototype, "structure_phone", void 0);
51
52
  __decorate([
52
53
  (0, typeorm_1.Column)({
53
- type: 'longtext',
54
+ type: "longtext",
54
55
  transformer: jsonTransformer_1.jsonTransformer,
55
- comment: 'Esta columna de tipo JSON nos sirve para agregar toda la información que se necesita a nivel de información legal de la empresa que se registre, ya que para cada país cambia la información.',
56
+ comment: "Esta columna de tipo JSON nos sirve para agregar toda la información que se necesita a nivel de información legal de la empresa que se registre, ya que para cada país cambia la información.",
56
57
  }),
57
58
  __metadata("design:type", Object)
58
59
  ], Country.prototype, "legal_information", void 0);
59
60
  __decorate([
60
61
  (0, typeorm_1.Column)({
61
- type: 'longtext',
62
+ type: "longtext",
62
63
  transformer: jsonTransformer_1.jsonTransformer,
63
- comment: 'Columna de tipo JSON para almacenar la información que se necesita para la información del representante legal de la empresa.',
64
+ comment: "Columna de tipo JSON para almacenar la información que se necesita para la información del representante legal de la empresa.",
64
65
  }),
65
66
  __metadata("design:type", Object)
66
67
  ], Country.prototype, "legal_agent", void 0);
67
68
  __decorate([
68
69
  (0, typeorm_1.Column)({
69
- type: 'longtext',
70
+ type: "longtext",
70
71
  nullable: true,
71
72
  transformer: jsonTransformer_1.jsonTransformer,
72
- comment: 'Columna de tipo JSON para almacenar información adicional sobre el país.',
73
+ comment: "Columna de tipo JSON para almacenar información adicional sobre el país.",
73
74
  }),
74
75
  __metadata("design:type", Object)
75
76
  ], Country.prototype, "details", void 0);
76
77
  __decorate([
77
78
  (0, typeorm_1.Column)({
78
79
  default: 1,
79
- comment: 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
80
+ comment: "Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
80
81
  }),
81
82
  __metadata("design:type", Number)
82
83
  ], Country.prototype, "status", void 0);
@@ -84,8 +85,12 @@ var Country = /** @class */ (function () {
84
85
  (0, typeorm_1.OneToMany)(function () { return Region_1.Region; }, function (region) { return region.country; }),
85
86
  __metadata("design:type", Array)
86
87
  ], Country.prototype, "regions", void 0);
88
+ __decorate([
89
+ (0, typeorm_1.OneToMany)(function () { return __1.Bank; }, function (bank) { return bank.country; }),
90
+ __metadata("design:type", Array)
91
+ ], Country.prototype, "banks", void 0);
87
92
  Country = __decorate([
88
- (0, typeorm_1.Entity)({ comment: 'Países donde está disponible la plataforma.' })
93
+ (0, typeorm_1.Entity)({ comment: "Países donde está disponible la plataforma." })
89
94
  ], Country);
90
95
  return Country;
91
96
  }());
@@ -46,6 +46,7 @@ export { LocalPlan } from "./entities/LocalPlan";
46
46
  export { PartnerPermissionSection } from "./entities/PartnerPermissionSection";
47
47
  export { PartnerPlatform } from "./entities/PartnerPlatform";
48
48
  export { ServicePlan } from "./entities/ServicePlan";
49
+ export { Bank } from "./entities/Bank";
49
50
  export { LocalsCompany } from "./views/LocalsCompany";
50
51
  export { VerifyLocals } from "./views/VerifyLocals";
51
52
  export { MasterNotifications } from "./views/MasterNotifications";
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.VerifyLocals = exports.LocalsCompany = 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.TerminalSession = exports.Terminal = exports.Square = exports.RequestStatus = 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 = void 0;
17
+ exports.LocalsCompany = 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.TerminalSession = exports.Terminal = exports.Square = exports.RequestStatus = 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 = 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");
@@ -112,6 +112,8 @@ var PartnerPlatform_1 = require("./entities/PartnerPlatform");
112
112
  Object.defineProperty(exports, "PartnerPlatform", { enumerable: true, get: function () { return PartnerPlatform_1.PartnerPlatform; } });
113
113
  var ServicePlan_1 = require("./entities/ServicePlan");
114
114
  Object.defineProperty(exports, "ServicePlan", { enumerable: true, get: function () { return ServicePlan_1.ServicePlan; } });
115
+ var Bank_1 = require("./entities/Bank");
116
+ Object.defineProperty(exports, "Bank", { enumerable: true, get: function () { return Bank_1.Bank; } });
115
117
  var LocalsCompany_1 = require("./views/LocalsCompany");
116
118
  Object.defineProperty(exports, "LocalsCompany", { enumerable: true, get: function () { return LocalsCompany_1.LocalsCompany; } });
117
119
  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": "2.9.4",
3
+ "version": "2.9.6",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,52 @@
1
+ import {
2
+ Entity,
3
+ Column,
4
+ PrimaryGeneratedColumn,
5
+ ManyToOne,
6
+ JoinColumn,
7
+ OneToMany,
8
+ BaseEntity,
9
+ Unique,
10
+ } from "typeorm";
11
+ import { Country } from "./Country";
12
+ import { City } from "./City";
13
+
14
+ @Entity({
15
+ comment:
16
+ "Tabla creada para guardar los tipos de bancos que hay en la plataforma por país.",
17
+ })
18
+ @Unique("unique_code_per_country", ["code", "country"])
19
+ export class Bank {
20
+ @PrimaryGeneratedColumn({
21
+ comment: "Número de identificación (ID) único de cada registro.",
22
+ })
23
+ id: number;
24
+
25
+ @Column({
26
+ length: 20,
27
+ comment:
28
+ "Código identificador de la entidad bancaria.\r\n\r\nEste código es único y no se puede repetir por país.",
29
+ })
30
+ code: string;
31
+
32
+ @ManyToOne(() => Country, (country) => country.banks, {
33
+ onDelete: "RESTRICT",
34
+ onUpdate: "NO ACTION",
35
+ })
36
+ @JoinColumn({ name: "country" })
37
+ country: Country;
38
+
39
+ @Column({
40
+ length: 50,
41
+ comment:
42
+ "Nombre de la entidad bancaria.\r\n\r\nEste nombre es el que se mostrará en la plataforma.",
43
+ })
44
+ name: string;
45
+
46
+ @Column({
47
+ default: 1,
48
+ comment:
49
+ "Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
50
+ })
51
+ status: number;
52
+ }
@@ -1,68 +1,72 @@
1
- import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'
2
- import { Region } from './Region'
3
- import { jsonTransformer } from '../transformers/jsonTransformer'
1
+ import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
2
+ import { Region } from "./Region";
3
+ import { jsonTransformer } from "../transformers/jsonTransformer";
4
+ import { Bank } from "..";
4
5
 
5
- @Entity({ comment: 'Países donde está disponible la plataforma.' })
6
+ @Entity({ comment: "Países donde está disponible la plataforma." })
6
7
  export class Country {
7
8
  @PrimaryGeneratedColumn({
8
- comment: 'Número de identificación (ID) único de cada registro.',
9
+ comment: "Número de identificación (ID) único de cada registro.",
9
10
  })
10
- id: number
11
+ id: number;
11
12
 
12
- @Column({ length: 10, comment: 'Código del país.' })
13
- code: string
13
+ @Column({ length: 10, comment: "Código del país." })
14
+ code: string;
14
15
 
15
- @Column({ length: 50, comment: 'Nombre del país.' })
16
- name: string
16
+ @Column({ length: 50, comment: "Nombre del país." })
17
+ name: string;
17
18
 
18
19
  @Column({
19
20
  length: 10,
20
21
  comment:
21
- 'Usamos esta columna para saber la moneda del país y sugerírsela al usuario o al local.',
22
+ "Usamos esta columna para saber la moneda del país y sugerírsela al usuario o al local.",
22
23
  })
23
- currency: string
24
+ currency: string;
24
25
 
25
- @Column({ length: 10, comment: 'Prefijo para los números de teléfono.' })
26
- prefix: string
26
+ @Column({ length: 10, comment: "Prefijo para los números de teléfono." })
27
+ prefix: string;
27
28
 
28
29
  @Column({
29
30
  length: 15,
30
- comment: 'Estructura que tiene el teléfono en ese país.',
31
+ comment: "Estructura que tiene el teléfono en ese país.",
31
32
  })
32
- structure_phone: string
33
+ structure_phone: string;
33
34
 
34
35
  @Column({
35
- type: 'longtext',
36
+ type: "longtext",
36
37
  transformer: jsonTransformer,
37
38
  comment:
38
- 'Esta columna de tipo JSON nos sirve para agregar toda la información que se necesita a nivel de información legal de la empresa que se registre, ya que para cada país cambia la información.',
39
+ "Esta columna de tipo JSON nos sirve para agregar toda la información que se necesita a nivel de información legal de la empresa que se registre, ya que para cada país cambia la información.",
39
40
  })
40
- legal_information: any
41
+ legal_information: any;
41
42
 
42
43
  @Column({
43
- type: 'longtext',
44
+ type: "longtext",
44
45
  transformer: jsonTransformer,
45
46
  comment:
46
- 'Columna de tipo JSON para almacenar la información que se necesita para la información del representante legal de la empresa.',
47
+ "Columna de tipo JSON para almacenar la información que se necesita para la información del representante legal de la empresa.",
47
48
  })
48
- legal_agent: any
49
+ legal_agent: any;
49
50
 
50
51
  @Column({
51
- type: 'longtext',
52
+ type: "longtext",
52
53
  nullable: true,
53
54
  transformer: jsonTransformer,
54
55
  comment:
55
- 'Columna de tipo JSON para almacenar información adicional sobre el país.',
56
+ "Columna de tipo JSON para almacenar información adicional sobre el país.",
56
57
  })
57
- details: any
58
+ details: any;
58
59
 
59
60
  @Column({
60
61
  default: 1,
61
62
  comment:
62
- 'Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.',
63
+ "Estado del registro, es decir:\r\n1. Activo: Es visible en la plataforma.\r\n0. Inactivo: No será visible en la plataforma.",
63
64
  })
64
- status: number
65
+ status: number;
65
66
 
66
67
  @OneToMany(() => Region, (region) => region.country)
67
- regions: Region[]
68
+ regions: Region[];
69
+
70
+ @OneToMany(() => Bank, (bank) => bank.country)
71
+ banks: Bank[];
68
72
  }
@@ -46,6 +46,7 @@ export { LocalPlan } from "./entities/LocalPlan";
46
46
  export { PartnerPermissionSection } from "./entities/PartnerPermissionSection";
47
47
  export { PartnerPlatform } from "./entities/PartnerPlatform";
48
48
  export { ServicePlan } from "./entities/ServicePlan";
49
+ export { Bank } from "./entities/Bank";
49
50
 
50
51
  export { LocalsCompany } from "./views/LocalsCompany";
51
52
  export { VerifyLocals } from "./views/VerifyLocals";