-
Notifications
You must be signed in to change notification settings - Fork 0
/
Geo.ts
81 lines (68 loc) · 1.35 KB
/
Geo.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import { Field, Int, ObjectType } from "type-graphql";
import {
BaseEntity,
Column,
CreateDateColumn,
Entity,
Generated,
OneToMany,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from "typeorm";
import { Place } from "../place/Place";
import { ModelsRecords } from "../_records/ModelsRecords";
/**
* * Dig It Documentation
*
* @created 01 03 2023
* @collection models ref
* @notes [ ]
*
*/
@ObjectType()
@Entity()
export class Geo extends BaseEntity {
@Field(() => Int)
@PrimaryGeneratedColumn()
id!: number;
@Field(() => String)
@CreateDateColumn()
created!: Date;
@Field(() => String)
@UpdateDateColumn()
updated!: Date;
@Field(() => String)
@Column()
@Generated("uuid")
key!: string;
//
//
// model fields
//
@Field(() => String)
@Column({ type: `char`, length: 2 })
gh2!: string;
@Field(() => String)
@Column({ type: `char`, length: 9 })
gh9!: string;
@Field(() => String)
@Column({ type: `varchar` })
lat!: string;
@Field(() => String)
@Column({ type: `varchar` })
lng!: string;
//
//
// model records
//
@Field(() => ModelsRecords, { nullable: true })
@Column({ type: "json", nullable: true, default: null })
records!: ModelsRecords | null;
//
//
// model relations
//
@Field(() => [Place])
@OneToMany(() => Place, (place) => place.geo)
places!: Place[];
}