test-entity-library-asm 2.3.9 → 2.4.1

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.
@@ -6,9 +6,9 @@ export declare class Country {
6
6
  currency: string;
7
7
  prefix: string;
8
8
  structure_phone: string;
9
- legal_information: string;
10
- legal_agent: string;
11
- details: string;
9
+ legal_information: any;
10
+ legal_agent: any;
11
+ details: any;
12
12
  status: number;
13
13
  regions: Region[];
14
14
  }
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Country = void 0;
13
13
  var typeorm_1 = require("typeorm");
14
14
  var Region_1 = require("./Region");
15
+ var jsonTransformer_1 = require("../transformers/jsonTransformer");
15
16
  var Country = /** @class */ (function () {
16
17
  function Country() {
17
18
  }
@@ -50,24 +51,27 @@ var Country = /** @class */ (function () {
50
51
  __decorate([
51
52
  (0, typeorm_1.Column)({
52
53
  type: 'longtext',
54
+ transformer: jsonTransformer_1.jsonTransformer,
53
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.',
54
56
  }),
55
- __metadata("design:type", String)
57
+ __metadata("design:type", Object)
56
58
  ], Country.prototype, "legal_information", void 0);
57
59
  __decorate([
58
60
  (0, typeorm_1.Column)({
59
61
  type: 'longtext',
62
+ transformer: jsonTransformer_1.jsonTransformer,
60
63
  comment: 'Columna de tipo JSON para almacenar la información que se necesita para la información del representante legal de la empresa.',
61
64
  }),
62
- __metadata("design:type", String)
65
+ __metadata("design:type", Object)
63
66
  ], Country.prototype, "legal_agent", void 0);
64
67
  __decorate([
65
68
  (0, typeorm_1.Column)({
66
69
  type: 'longtext',
67
70
  nullable: true,
71
+ transformer: jsonTransformer_1.jsonTransformer,
68
72
  comment: 'Columna de tipo JSON para almacenar información adicional sobre el país.',
69
73
  }),
70
- __metadata("design:type", String)
74
+ __metadata("design:type", Object)
71
75
  ], Country.prototype, "details", void 0);
72
76
  __decorate([
73
77
  (0, typeorm_1.Column)({
@@ -11,7 +11,7 @@ export declare class DiscountCodeUser {
11
11
  type: number;
12
12
  single_use: number;
13
13
  created: Date;
14
- expiration: Date;
14
+ expiration: string;
15
15
  updated_by: Partner;
16
16
  updated: Date;
17
17
  status: number;
@@ -15,6 +15,7 @@ var CodeRedemptionHistoryUser_1 = require("./CodeRedemptionHistoryUser");
15
15
  var Company_1 = require("./Company");
16
16
  var Partner_1 = require("./Partner");
17
17
  var __1 = require("..");
18
+ var dateTransformer_1 = require("../transformers/dateTransformer");
18
19
  var DiscountCodeUser = /** @class */ (function () {
19
20
  function DiscountCodeUser() {
20
21
  }
@@ -63,12 +64,16 @@ var DiscountCodeUser = /** @class */ (function () {
63
64
  __metadata("design:type", Number)
64
65
  ], DiscountCodeUser.prototype, "single_use", void 0);
65
66
  __decorate([
66
- (0, typeorm_1.Column)({ type: 'datetime', comment: 'Fecha de creación del registro.' }),
67
+ (0, typeorm_1.Column)({
68
+ type: 'datetime',
69
+ transformer: new dateTransformer_1.DateTransformer(),
70
+ comment: 'Fecha de creación del registro.',
71
+ }),
67
72
  __metadata("design:type", Date)
68
73
  ], DiscountCodeUser.prototype, "created", void 0);
69
74
  __decorate([
70
75
  (0, typeorm_1.Column)({ type: 'date', comment: 'Fecha de expiración del registro.' }),
71
- __metadata("design:type", Date)
76
+ __metadata("design:type", String)
72
77
  ], DiscountCodeUser.prototype, "expiration", void 0);
73
78
  __decorate([
74
79
  (0, typeorm_1.ManyToOne)(function () { return Partner_1.Partner; }, function (partner) { return partner.discount_code_partners; }, {
@@ -79,7 +84,11 @@ var DiscountCodeUser = /** @class */ (function () {
79
84
  __metadata("design:type", Partner_1.Partner)
80
85
  ], DiscountCodeUser.prototype, "updated_by", void 0);
81
86
  __decorate([
82
- (0, typeorm_1.Column)({ type: 'datetime', comment: 'Fecha de actualización.' }),
87
+ (0, typeorm_1.Column)({
88
+ type: 'datetime',
89
+ transformer: new dateTransformer_1.DateTransformer(),
90
+ comment: 'Fecha de actualización.',
91
+ }),
83
92
  __metadata("design:type", Date)
84
93
  ], DiscountCodeUser.prototype, "updated", void 0);
85
94
  __decorate([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "2.3.9",
3
+ "version": "2.4.1",
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,5 +1,6 @@
1
1
  import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm'
2
2
  import { Region } from './Region'
3
+ import { jsonTransformer } from '../transformers/jsonTransformer'
3
4
 
4
5
  @Entity({ comment: 'Países donde está disponible la plataforma.' })
5
6
  export class Country {
@@ -32,25 +33,28 @@ export class Country {
32
33
 
33
34
  @Column({
34
35
  type: 'longtext',
36
+ transformer: jsonTransformer,
35
37
  comment:
36
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.',
37
39
  })
38
- legal_information: string
40
+ legal_information: any
39
41
 
40
42
  @Column({
41
43
  type: 'longtext',
44
+ transformer: jsonTransformer,
42
45
  comment:
43
46
  'Columna de tipo JSON para almacenar la información que se necesita para la información del representante legal de la empresa.',
44
47
  })
45
- legal_agent: string
48
+ legal_agent: any
46
49
 
47
50
  @Column({
48
51
  type: 'longtext',
49
52
  nullable: true,
53
+ transformer: jsonTransformer,
50
54
  comment:
51
55
  'Columna de tipo JSON para almacenar información adicional sobre el país.',
52
56
  })
53
- details: string
57
+ details: any
54
58
 
55
59
  @Column({
56
60
  default: 1,
@@ -10,6 +10,7 @@ import { CodeRedemptionHistoryUser } from './CodeRedemptionHistoryUser'
10
10
  import { Company } from './Company'
11
11
  import { Partner } from './Partner'
12
12
  import { Local } from '..'
13
+ import { DateTransformer } from '../transformers/dateTransformer'
13
14
 
14
15
  @Entity('discount_code_user', {
15
16
  comment: 'Códigos de descuento para los usuarios.',
@@ -54,11 +55,15 @@ export class DiscountCodeUser {
54
55
  })
55
56
  single_use: number
56
57
 
57
- @Column({ type: 'datetime', comment: 'Fecha de creación del registro.' })
58
+ @Column({
59
+ type: 'datetime',
60
+ transformer: new DateTransformer(),
61
+ comment: 'Fecha de creación del registro.',
62
+ })
58
63
  created: Date
59
64
 
60
65
  @Column({ type: 'date', comment: 'Fecha de expiración del registro.' })
61
- expiration: Date
66
+ expiration: string
62
67
 
63
68
  @ManyToOne(() => Partner, (partner) => partner.discount_code_partners, {
64
69
  onDelete: 'CASCADE',
@@ -67,7 +72,11 @@ export class DiscountCodeUser {
67
72
  @JoinColumn({ name: 'updated_by' })
68
73
  updated_by: Partner
69
74
 
70
- @Column({ type: 'datetime', comment: 'Fecha de actualización.' })
75
+ @Column({
76
+ type: 'datetime',
77
+ transformer: new DateTransformer(),
78
+ comment: 'Fecha de actualización.',
79
+ })
71
80
  updated: Date
72
81
 
73
82
  @Column({