test-entity-library-asm 3.0.0 → 3.0.2

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.
@@ -56,7 +56,11 @@ var Category = /** @class */ (function () {
56
56
  __metadata("design:type", __1.Partner)
57
57
  ], Category.prototype, "created_by", void 0);
58
58
  __decorate([
59
- (0, typeorm_1.Column)({ type: "datetime", comment: "Fecha de creación del registro." }),
59
+ (0, typeorm_1.Column)({
60
+ type: "datetime",
61
+ nullable: true,
62
+ comment: "Fecha de creación del registro.",
63
+ }),
60
64
  __metadata("design:type", Date)
61
65
  ], Category.prototype, "created", void 0);
62
66
  __decorate([
@@ -67,6 +71,7 @@ var Category = /** @class */ (function () {
67
71
  (0, typeorm_1.ManyToOne)(function () { return __1.Partner; }, function (partner) { return partner.partners_category_update_by; }, {
68
72
  onDelete: "RESTRICT",
69
73
  onUpdate: "NO ACTION",
74
+ nullable: true,
70
75
  }),
71
76
  (0, typeorm_1.JoinColumn)({ name: "updated_by" }),
72
77
  __metadata("design:type", __1.Partner)
@@ -13,7 +13,7 @@ export declare class Product {
13
13
  age_restriction: number;
14
14
  combo: number;
15
15
  position: number;
16
- photo: string;
16
+ photo: any;
17
17
  additional_information: string;
18
18
  type_sales_hours: number;
19
19
  created_by: Partner;
@@ -17,6 +17,7 @@ var ProductIngredient_1 = require("./ProductIngredient");
17
17
  var RequestProduct_1 = require("./RequestProduct");
18
18
  var User_1 = require("./User");
19
19
  var __1 = require("..");
20
+ var jsonTransformer_1 = require("../transformers/jsonTransformer");
20
21
  var Product = /** @class */ (function () {
21
22
  function Product() {
22
23
  }
@@ -71,9 +72,10 @@ var Product = /** @class */ (function () {
71
72
  (0, typeorm_1.Column)({
72
73
  type: "text",
73
74
  nullable: true,
75
+ transformer: jsonTransformer_1.jsonTransformer,
74
76
  comment: "Campo de tipo json para guardar el id y la url de la foto",
75
77
  }),
76
- __metadata("design:type", String)
78
+ __metadata("design:type", Object)
77
79
  ], Product.prototype, "photo", void 0);
78
80
  __decorate([
79
81
  (0, typeorm_1.Column)({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "test-entity-library-asm",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Entidades de ejemplo para una base de datos",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -48,7 +48,11 @@ export class Category {
48
48
  @JoinColumn({ name: "created_by" })
49
49
  created_by: Partner;
50
50
 
51
- @Column({ type: "datetime", comment: "Fecha de creación del registro." })
51
+ @Column({
52
+ type: "datetime",
53
+ nullable: true,
54
+ comment: "Fecha de creación del registro.",
55
+ })
52
56
  created: Date;
53
57
 
54
58
  @Column({ type: "datetime", comment: "Fecha de actualización del registro." })
@@ -57,6 +61,7 @@ export class Category {
57
61
  @ManyToOne(() => Partner, (partner) => partner.partners_category_update_by, {
58
62
  onDelete: "RESTRICT",
59
63
  onUpdate: "NO ACTION",
64
+ nullable: true,
60
65
  })
61
66
  @JoinColumn({ name: "updated_by" })
62
67
  updated_by: Partner;
@@ -14,6 +14,7 @@ import { ProductIngredient } from "./ProductIngredient";
14
14
  import { RequestProduct } from "./RequestProduct";
15
15
  import { User } from "./User";
16
16
  import { Partner, ProductDate, ProductSchedule } from "..";
17
+ import { jsonTransformer } from "../transformers/jsonTransformer";
17
18
 
18
19
  @Entity({
19
20
  comment:
@@ -63,9 +64,10 @@ export class Product {
63
64
  @Column({
64
65
  type: "text",
65
66
  nullable: true,
67
+ transformer: jsonTransformer,
66
68
  comment: "Campo de tipo json para guardar el id y la url de la foto",
67
69
  })
68
- photo: string;
70
+ photo: any;
69
71
 
70
72
  @Column({
71
73
  type: "mediumtext",