UNPKG

echadospalante-core

Version:

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.

35 lines (27 loc) 687 B
import { Entity, PrimaryGeneratedColumn, Column, CreateDateColumn, UpdateDateColumn, OneToOne, Index, } from "typeorm"; import { Point } from "geojson"; import { VentureData } from "./venture.data"; @Entity({ name: "venture_location" }) export class VentureLocationData { @PrimaryGeneratedColumn("uuid") id: string; @Column("geometry", { spatialFeatureType: "Point", srid: 4326 }) @Index({ spatial: true }) public location: Point; @Column({ nullable: true }) description?: string; @CreateDateColumn() createdAt: Date; @UpdateDateColumn() updatedAt: Date; @OneToOne(() => VentureData, (venture) => venture.location) Venture?: VentureData; }