echadospalante-core 13.0.0 → 13.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.
@@ -23,7 +23,11 @@ export interface EventCreate {
23
23
  title: string;
24
24
  description: string;
25
25
  coverPhoto: string;
26
- location: EventLocation;
26
+ location?: {
27
+ lat?: number;
28
+ lng?: number;
29
+ description?: string;
30
+ };
27
31
  categoriesIds: string[];
28
32
  startDate: Date;
29
33
  contactEmail?: string;
@@ -2,7 +2,7 @@ import { Point } from "typeorm";
2
2
  import { VentureEventData } from "./venture-event.data";
3
3
  export declare class EventLocationData {
4
4
  id: string;
5
- location: Point;
5
+ location?: Point;
6
6
  description?: string;
7
7
  event?: VentureEventData;
8
8
  }
@@ -24,7 +24,11 @@ __decorate([
24
24
  __metadata("design:type", String)
25
25
  ], EventLocationData.prototype, "id", void 0);
26
26
  __decorate([
27
- (0, typeorm_1.Column)("geometry", { spatialFeatureType: "Point", srid: 4326 }),
27
+ (0, typeorm_1.Column)("geometry", {
28
+ spatialFeatureType: "Point",
29
+ srid: 4326,
30
+ nullable: true,
31
+ }),
28
32
  (0, typeorm_1.Index)({ spatial: true }),
29
33
  __metadata("design:type", Object)
30
34
  ], EventLocationData.prototype, "location", void 0);
@@ -62,6 +62,7 @@ __decorate([
62
62
  (0, typeorm_1.JoinColumn)({ name: "locationId" }),
63
63
  (0, typeorm_1.OneToOne)(() => event_location_data_1.EventLocationData, (eventLocation) => eventLocation.event, {
64
64
  cascade: true,
65
+ eager: true,
65
66
  }),
66
67
  __metadata("design:type", event_location_data_1.EventLocationData)
67
68
  ], VentureEventData.prototype, "location", void 0);
@@ -73,7 +74,7 @@ __decorate([
73
74
  __metadata("design:type", event_contact_data_1.EventContactData)
74
75
  ], VentureEventData.prototype, "contact", void 0);
75
76
  __decorate([
76
- (0, typeorm_1.ManyToMany)(() => event_category_data_1.EventCategoryData, (eventCategory) => eventCategory.events),
77
+ (0, typeorm_1.ManyToMany)(() => event_category_data_1.EventCategoryData, (eventCategory) => eventCategory.events, { eager: true }),
77
78
  __metadata("design:type", Array)
78
79
  ], VentureEventData.prototype, "categories", void 0);
79
80
  __decorate([
@@ -77,7 +77,7 @@ __decorate([
77
77
  __metadata("design:type", venture_detail_data_1.VentureDetailData)
78
78
  ], VentureData.prototype, "detail", void 0);
79
79
  __decorate([
80
- (0, typeorm_1.OneToOne)(() => venture_location_data_1.VentureLocationData, (ventureLocation) => ventureLocation.Venture, { cascade: true }),
80
+ (0, typeorm_1.OneToOne)(() => venture_location_data_1.VentureLocationData, (ventureLocation) => ventureLocation.Venture, { cascade: true, eager: true }),
81
81
  (0, typeorm_1.JoinColumn)({ name: "locationId" }),
82
82
  __metadata("design:type", venture_location_data_1.VentureLocationData)
83
83
  ], VentureData.prototype, "location", void 0);
@@ -92,7 +92,7 @@ __decorate([
92
92
  __metadata("design:type", venture_contact_data_1.VentureContactData)
93
93
  ], VentureData.prototype, "contact", void 0);
94
94
  __decorate([
95
- (0, typeorm_1.ManyToMany)(() => venture_category_data_1.VentureCategoryData, (ventureCategory) => ventureCategory.ventures),
95
+ (0, typeorm_1.ManyToMany)(() => venture_category_data_1.VentureCategoryData, (ventureCategory) => ventureCategory.ventures, { eager: true }),
96
96
  (0, typeorm_1.JoinTable)({
97
97
  name: "x_venture_venture_category",
98
98
  joinColumn: { name: "ventureId", referencedColumnName: "id" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "echadospalante-core",
3
- "version": "13.0.0",
3
+ "version": "13.0.2",
4
4
  "description": "This package contains the core of the echadospalante project, it contains the domain entities, helpers, and other utilities that are shared between the different services.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,7 +25,11 @@ export interface EventCreate {
25
25
  title: string;
26
26
  description: string;
27
27
  coverPhoto: string;
28
- location: EventLocation;
28
+ location?: {
29
+ lat?: number;
30
+ lng?: number;
31
+ description?: string;
32
+ };
29
33
  categoriesIds: string[];
30
34
  startDate: Date;
31
35
  contactEmail?: string;
@@ -6,6 +6,7 @@ import {
6
6
  Point,
7
7
  Index,
8
8
  } from "typeorm";
9
+
9
10
  import { VentureEventData } from "./venture-event.data";
10
11
 
11
12
  @Entity({ name: "event_location" })
@@ -13,9 +14,13 @@ export class EventLocationData {
13
14
  @PrimaryGeneratedColumn("uuid")
14
15
  id: string;
15
16
 
16
- @Column("geometry", { spatialFeatureType: "Point", srid: 4326 })
17
+ @Column("geometry", {
18
+ spatialFeatureType: "Point",
19
+ srid: 4326,
20
+ nullable: true,
21
+ })
17
22
  @Index({ spatial: true })
18
- public location: Point;
23
+ public location?: Point;
19
24
 
20
25
  @Column({ nullable: true })
21
26
  description?: string;
@@ -40,6 +40,7 @@ export class VentureEventData {
40
40
  @JoinColumn({ name: "locationId" })
41
41
  @OneToOne(() => EventLocationData, (eventLocation) => eventLocation.event, {
42
42
  cascade: true,
43
+ eager: true,
43
44
  })
44
45
  location: EventLocationData;
45
46
 
@@ -49,7 +50,11 @@ export class VentureEventData {
49
50
  })
50
51
  contact: EventContactData;
51
52
 
52
- @ManyToMany(() => EventCategoryData, (eventCategory) => eventCategory.events)
53
+ @ManyToMany(
54
+ () => EventCategoryData,
55
+ (eventCategory) => eventCategory.events,
56
+ { eager: true }
57
+ )
53
58
  categories: EventCategoryData[];
54
59
 
55
60
  @OneToMany(() => EventDonationData, (eventDonation) => eventDonation.event)
@@ -55,7 +55,7 @@ export class VentureData {
55
55
  @OneToOne(
56
56
  () => VentureLocationData,
57
57
  (ventureLocation) => ventureLocation.Venture,
58
- { cascade: true }
58
+ { cascade: true, eager: true }
59
59
  )
60
60
  @JoinColumn({ name: "locationId" })
61
61
  location?: VentureLocationData;
@@ -74,7 +74,8 @@ export class VentureData {
74
74
 
75
75
  @ManyToMany(
76
76
  () => VentureCategoryData,
77
- (ventureCategory) => ventureCategory.ventures
77
+ (ventureCategory) => ventureCategory.ventures,
78
+ { eager: true }
78
79
  )
79
80
  @JoinTable({
80
81
  name: "x_venture_venture_category",