-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocationAddress.ts
More file actions
57 lines (41 loc) · 1.32 KB
/
LocationAddress.ts
File metadata and controls
57 lines (41 loc) · 1.32 KB
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
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
import { Company } from "./Company.js";
import { DisasterNotification } from "./DisasterNotification.js";
import { ClaimLocation } from "./ClaimLocation.js";
//Represents an address for a location of a company
@Entity("location_address")
export class LocationAddress {
@PrimaryGeneratedColumn("uuid")
id!: string;
@Column()
alias!: string;
@Column()
country!: string;
@Column()
stateProvince!: string;
@Column()
city!: string;
@Column()
streetAddress!: string;
@Column()
postalCode!: string;
@Column({ nullable: true })
county?: string;
@Column()
companyId!: string;
@ManyToOne(() => Company)
@JoinColumn({ name: "companyId" })
company?: Company;
@Column()
fipsStateCode!: number;
@Column()
fipsCountyCode!: number;
@Column({ type: "float", default: 0 })
lat!: number;
@Column({ type: "float", default: 0 })
long!: number;
@OneToMany(() => DisasterNotification, (notification: { locationAddress: any }) => notification.locationAddress)
disasterNotifications?: DisasterNotification[];
@OneToMany(() => ClaimLocation, (claimLocation) => claimLocation.locationAddress)
claimLocations?: ClaimLocation[];
}