test-entity-library-asm 3.9.17 → 3.9.19

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.
@@ -2,7 +2,7 @@ import { Category } from "./Category";
2
2
  export declare class CategoryDate {
3
3
  id: number;
4
4
  category: Category;
5
- date: Date;
5
+ date: string;
6
6
  start_time: string;
7
7
  end_time: string;
8
8
  }
@@ -35,7 +35,7 @@ __decorate([
35
35
  type: "date",
36
36
  comment: "Fecha en la que va a estar disponible la categoría.",
37
37
  }),
38
- __metadata("design:type", Date)
38
+ __metadata("design:type", String)
39
39
  ], CategoryDate.prototype, "date", void 0);
40
40
  __decorate([
41
41
  (0, typeorm_1.Column)({ type: "varchar", length: 5, comment: "Hora de inicio." }),
@@ -20,7 +20,7 @@ export declare class Company {
20
20
  legal_agent: any | null;
21
21
  settings: any | null;
22
22
  created: Date;
23
- expiration: Date | null;
23
+ expiration: string | null;
24
24
  updated: Date;
25
25
  status: number;
26
26
  locals: Local[];
@@ -9,8 +9,8 @@ export declare class DiscountCodeCompany {
9
9
  single_use: number;
10
10
  use_limit: number | null;
11
11
  created: Date;
12
- start: Date;
13
- expiration: Date | null;
12
+ start: string;
13
+ expiration: string | null;
14
14
  repeat_days: any | null;
15
15
  updated: Date | null;
16
16
  status: number;
@@ -76,7 +76,7 @@ __decorate([
76
76
  type: "date",
77
77
  comment: "Fecha inicial del descuento.",
78
78
  }),
79
- __metadata("design:type", Date)
79
+ __metadata("design:type", String)
80
80
  ], DiscountCodeCompany.prototype, "start", void 0);
81
81
  __decorate([
82
82
  (0, typeorm_1.Column)({
@@ -12,8 +12,8 @@ export declare class DiscountCodeUser {
12
12
  single_use: number;
13
13
  use_limit: number | null;
14
14
  created: Date;
15
- start: Date;
16
- expiration: Date | null;
15
+ start: string;
16
+ expiration: string | null;
17
17
  repeat_days: any | null;
18
18
  updated_by: Partner;
19
19
  updated: Date;
@@ -95,7 +95,7 @@ __decorate([
95
95
  type: "date",
96
96
  comment: "Fecha inicial del descuento.",
97
97
  }),
98
- __metadata("design:type", Date)
98
+ __metadata("design:type", String)
99
99
  ], DiscountCodeUser.prototype, "start", void 0);
100
100
  __decorate([
101
101
  (0, typeorm_1.Column)({
@@ -7,7 +7,7 @@ export declare class LocalReserve {
7
7
  user_phone: string | null;
8
8
  user_email: string | null;
9
9
  user: User | null;
10
- date: Date;
10
+ date: string;
11
11
  start_time: string;
12
12
  end_time: string;
13
13
  details: string | null;
@@ -84,7 +84,7 @@ __decorate([
84
84
  type: "date",
85
85
  comment: "Fecha de la reserva.",
86
86
  }),
87
- __metadata("design:type", Date)
87
+ __metadata("design:type", String)
88
88
  ], LocalReserve.prototype, "date", void 0);
89
89
  __decorate([
90
90
  (0, typeorm_1.Column)({
@@ -8,7 +8,7 @@ export declare class Plan {
8
8
  description: any | null;
9
9
  quantity_locals: number;
10
10
  created: Date;
11
- expiration: Date;
11
+ expiration: string;
12
12
  status: number;
13
13
  local_plans: LocalPlan[];
14
14
  }
@@ -77,7 +77,7 @@ __decorate([
77
77
  ], Plan.prototype, "created", void 0);
78
78
  __decorate([
79
79
  (0, typeorm_1.Column)({ type: "date", comment: "Fecha de expiración del registro." }),
80
- __metadata("design:type", Date)
80
+ __metadata("design:type", String)
81
81
  ], Plan.prototype, "expiration", void 0);
82
82
  __decorate([
83
83
  (0, typeorm_1.Column)({
@@ -2,7 +2,7 @@ import { Product } from "..";
2
2
  export declare class ProductDate {
3
3
  id: number;
4
4
  product: Product;
5
- date: Date;
5
+ date: string;
6
6
  start_time: string;
7
7
  end_time: string;
8
8
  }
@@ -35,7 +35,7 @@ __decorate([
35
35
  type: "date",
36
36
  comment: "Fecha en la que va a estar disponible el producto.",
37
37
  }),
38
- __metadata("design:type", Date)
38
+ __metadata("design:type", String)
39
39
  ], ProductDate.prototype, "date", void 0);
40
40
  __decorate([
41
41
  (0, typeorm_1.Column)({ type: "varchar", comment: "Hora de inicio." }),
@@ -8,14 +8,12 @@ const moment_timezone_1 = __importDefault(require("moment-timezone"));
8
8
  const __1 = require("..");
9
9
  class DateTransformer {
10
10
  to(value) {
11
- const result = (0, moment_timezone_1.default)(value).format("YYYY-MM-DD HH:mm:ss");
12
- return result;
11
+ return (0, moment_timezone_1.default)(value).utc().format("YYYY-MM-DD HH:mm:ss");
13
12
  }
14
13
  from(value) {
15
14
  if (value === null)
16
15
  return null;
17
- const result = moment_timezone_1.default.utc(value).tz((0, __1.getTimeZone)()).toDate();
18
- return result;
16
+ return moment_timezone_1.default.utc(value).tz((0, __1.getTimeZone)()).toDate();
19
17
  }
20
18
  }
21
19
  exports.DateTransformer = DateTransformer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "3.9.17",
3
+ "version": "3.9.19",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -137,7 +137,7 @@ export class Category {
137
137
 
138
138
  @OneToMany(
139
139
  () => ScheduleCategory,
140
- (scheduleCategory) => scheduleCategory.category
140
+ (scheduleCategory) => scheduleCategory.category,
141
141
  )
142
142
  category_schedules: ScheduleCategory[];
143
143
 
@@ -146,7 +146,7 @@ export class Category {
146
146
 
147
147
  @OneToMany(
148
148
  () => RequestInvoiceCategory,
149
- (requestInvoiceCategory) => requestInvoiceCategory.category
149
+ (requestInvoiceCategory) => requestInvoiceCategory.category,
150
150
  )
151
151
  request_invoice_categories: RequestInvoiceCategory[];
152
152
  }
@@ -28,7 +28,7 @@ export class CategoryDate {
28
28
  type: "date",
29
29
  comment: "Fecha en la que va a estar disponible la categoría.",
30
30
  })
31
- date: Date;
31
+ date: string;
32
32
 
33
33
  @Column({ type: "varchar", length: 5, comment: "Hora de inicio." })
34
34
  start_time: string;
@@ -117,7 +117,7 @@ export class Company {
117
117
  default: null,
118
118
  comment: "Cuándo expira el plan de la empresa.",
119
119
  })
120
- expiration: Date | null;
120
+ expiration: string | null;
121
121
 
122
122
  @Column({
123
123
  type: "datetime",
@@ -138,13 +138,13 @@ export class Company {
138
138
 
139
139
  @OneToMany(
140
140
  () => CodeRedemptionHistoryCompany,
141
- (codeRedemptionHistoryCompany) => codeRedemptionHistoryCompany.company
141
+ (codeRedemptionHistoryCompany) => codeRedemptionHistoryCompany.company,
142
142
  )
143
143
  code_redemption_history_company: CodeRedemptionHistoryCompany[];
144
144
 
145
145
  @OneToMany(
146
146
  () => DiscountCodeUser,
147
- (discountCodeUser) => discountCodeUser.company
147
+ (discountCodeUser) => discountCodeUser.company,
148
148
  )
149
149
  discount_code_users: DiscountCodeUser[];
150
150
 
@@ -68,7 +68,7 @@ export class DiscountCodeCompany {
68
68
  type: "date",
69
69
  comment: "Fecha inicial del descuento.",
70
70
  })
71
- start: Date;
71
+ start: string;
72
72
 
73
73
  @Column({
74
74
  type: "date",
@@ -76,7 +76,7 @@ export class DiscountCodeCompany {
76
76
  default: null,
77
77
  comment: "Fecha de expiración del registro.",
78
78
  })
79
- expiration: Date | null;
79
+ expiration: string | null;
80
80
 
81
81
  @Column({
82
82
  type: "text",
@@ -85,7 +85,7 @@ export class DiscountCodeUser {
85
85
  type: "date",
86
86
  comment: "Fecha inicial del descuento.",
87
87
  })
88
- start: Date;
88
+ start: string;
89
89
 
90
90
  @Column({
91
91
  type: "date",
@@ -93,7 +93,7 @@ export class DiscountCodeUser {
93
93
  default: null,
94
94
  comment: "Fecha de expiración del registro.",
95
95
  })
96
- expiration: Date | null;
96
+ expiration: string | null;
97
97
 
98
98
  @Column({
99
99
  type: "text",
@@ -86,7 +86,7 @@ export class LocalReserve {
86
86
  type: "date",
87
87
  comment: "Fecha de la reserva.",
88
88
  })
89
- date: Date;
89
+ date: string;
90
90
 
91
91
  @Column({
92
92
  type: "varchar",
@@ -68,7 +68,7 @@ export class Plan {
68
68
  created: Date;
69
69
 
70
70
  @Column({ type: "date", comment: "Fecha de expiración del registro." })
71
- expiration: Date;
71
+ expiration: string;
72
72
 
73
73
  @Column({
74
74
  default: 1,
@@ -28,7 +28,7 @@ export class ProductDate {
28
28
  type: "date",
29
29
  comment: "Fecha en la que va a estar disponible el producto.",
30
30
  })
31
- date: Date;
31
+ date: string;
32
32
 
33
33
  @Column({ type: "varchar", comment: "Hora de inicio." })
34
34
  start_time: string;
@@ -4,14 +4,12 @@ import { getTimeZone } from "..";
4
4
 
5
5
  export class DateTransformer implements ValueTransformer {
6
6
  to(value: Date | string): string {
7
- const result = moment(value).format("YYYY-MM-DD HH:mm:ss");
8
- return result;
7
+ return moment(value).utc().format("YYYY-MM-DD HH:mm:ss");
9
8
  }
10
9
 
11
10
  from(value: string): Date | null | string {
12
11
  if (value === null) return null;
13
12
 
14
- const result = moment.utc(value).tz(getTimeZone()).toDate();
15
- return result;
13
+ return moment.utc(value).tz(getTimeZone()).toDate();
16
14
  }
17
15
  }