echadospalante-core 12.0.0 → 12.1.0

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.
@@ -1,8 +1,8 @@
1
+ import { Point } from "geojson";
1
2
  import { VentureEvent } from "./event";
2
3
  export interface EventLocation {
3
4
  id: string;
4
- lat?: number;
5
- lng?: number;
5
+ location?: Point;
6
6
  description?: string;
7
7
  event?: VentureEvent;
8
8
  }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PublicationType = void 0;
4
+ var publication_1 = require("./publication");
5
+ Object.defineProperty(exports, "PublicationType", { enumerable: true, get: function () { return publication_1.PublicationType; } });
@@ -1,8 +1,8 @@
1
+ import { Point } from "typeorm";
1
2
  import { VentureEventData } from "./venture-event.data";
2
3
  export declare class EventLocationData {
3
4
  id: string;
4
- lat?: number;
5
- lng?: number;
5
+ location: Point;
6
6
  description?: string;
7
7
  event?: VentureEventData;
8
8
  }
@@ -9,32 +9,33 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.EventContactData = void 0;
12
+ exports.EventLocationData = void 0;
13
13
  const typeorm_1 = require("typeorm");
14
14
  const venture_event_data_1 = require("./venture-event.data");
15
- let EventContactData = class EventContactData {
15
+ let EventLocationData = class EventLocationData {
16
16
  id;
17
- phoneNumber;
18
- email;
17
+ location;
18
+ description;
19
19
  event;
20
20
  };
21
- exports.EventContactData = EventContactData;
21
+ exports.EventLocationData = EventLocationData;
22
22
  __decorate([
23
23
  (0, typeorm_1.PrimaryGeneratedColumn)("uuid"),
24
24
  __metadata("design:type", String)
25
- ], EventContactData.prototype, "id", void 0);
25
+ ], EventLocationData.prototype, "id", void 0);
26
26
  __decorate([
27
- (0, typeorm_1.Column)("varchar", { nullable: true }),
28
- __metadata("design:type", String)
29
- ], EventContactData.prototype, "phoneNumber", void 0);
27
+ (0, typeorm_1.Column)("geometry", { spatialFeatureType: "Point", srid: 4326 }),
28
+ (0, typeorm_1.Index)({ spatial: true }),
29
+ __metadata("design:type", Object)
30
+ ], EventLocationData.prototype, "location", void 0);
30
31
  __decorate([
31
- (0, typeorm_1.Column)("varchar", { nullable: true }),
32
+ (0, typeorm_1.Column)({ nullable: true }),
32
33
  __metadata("design:type", String)
33
- ], EventContactData.prototype, "email", void 0);
34
+ ], EventLocationData.prototype, "description", void 0);
34
35
  __decorate([
35
- (0, typeorm_1.OneToOne)(() => venture_event_data_1.VentureEventData, (ventureEvent) => ventureEvent.contact),
36
+ (0, typeorm_1.OneToOne)(() => venture_event_data_1.VentureEventData, (ventureEvent) => ventureEvent.location),
36
37
  __metadata("design:type", venture_event_data_1.VentureEventData)
37
- ], EventContactData.prototype, "event", void 0);
38
- exports.EventContactData = EventContactData = __decorate([
39
- (0, typeorm_1.Entity)({ name: "event_contact" })
40
- ], EventContactData);
38
+ ], EventLocationData.prototype, "event", void 0);
39
+ exports.EventLocationData = EventLocationData = __decorate([
40
+ (0, typeorm_1.Entity)({ name: "event_location" })
41
+ ], EventLocationData);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "echadospalante-core",
3
- "version": "12.0.0",
3
+ "version": "12.1.0",
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",
@@ -1,9 +1,10 @@
1
+ import { Point } from "geojson";
2
+
1
3
  import { VentureEvent } from "./event";
2
4
 
3
5
  export interface EventLocation {
4
6
  id: string;
5
- lat?: number;
6
- lng?: number;
7
+ location?: Point;
7
8
  description?: string;
8
9
  event?: VentureEvent;
9
10
  }
@@ -1,4 +1,11 @@
1
- import { Entity, PrimaryGeneratedColumn, Column, OneToOne } from "typeorm";
1
+ import {
2
+ Entity,
3
+ PrimaryGeneratedColumn,
4
+ Column,
5
+ OneToOne,
6
+ Point,
7
+ Index,
8
+ } from "typeorm";
2
9
  import { VentureEventData } from "./venture-event.data";
3
10
 
4
11
  @Entity({ name: "event_location" })
@@ -6,11 +13,9 @@ export class EventLocationData {
6
13
  @PrimaryGeneratedColumn("uuid")
7
14
  id: string;
8
15
 
9
- @Column("float", { nullable: true })
10
- lat?: number;
11
-
12
- @Column("float", { nullable: true })
13
- lng?: number;
16
+ @Column("geometry", { spatialFeatureType: "Point", srid: 4326 })
17
+ @Index({ spatial: true })
18
+ public location: Point;
14
19
 
15
20
  @Column({ nullable: true })
16
21
  description?: string;