|
| 1 | +import { DbBaseEntity } from "@entities/base.entity"; |
| 2 | +import { DataTarget } from "@entities/data-target.entity"; |
| 3 | +import { IoTDevice } from "@entities/iot-device.entity"; |
| 4 | +import { OrganizationApplicationPermission } from "@entities/organization-application-permission.entity"; |
| 5 | +import { Organization } from "@entities/organization.entity"; |
| 6 | +import { ApplicationStatus } from "@enum/application-status.enum"; |
1 | 7 | import { |
2 | 8 | Column, |
| 9 | + CreateDateColumn, |
3 | 10 | Entity, |
4 | 11 | JoinTable, |
5 | 12 | ManyToMany, |
6 | 13 | ManyToOne, |
7 | 14 | OneToMany, |
8 | 15 | Unique, |
9 | 16 | } from "typeorm"; |
10 | | - |
11 | | -import { DbBaseEntity } from "@entities/base.entity"; |
12 | | -import { DataTarget } from "@entities/data-target.entity"; |
13 | | -import { IoTDevice } from "@entities/iot-device.entity"; |
14 | | -import { OrganizationApplicationPermission } from "@entities/organization-application-permission.entity"; |
15 | | -import { Organization } from "@entities/organization.entity"; |
| 17 | +import { ApplicationDeviceType } from "./application-device-type.entity"; |
| 18 | +import { ControlledProperty } from "./controlled-property.entity"; |
16 | 19 | import { Multicast } from "./multicast.entity"; |
17 | 20 |
|
18 | | - |
19 | 21 | @Entity("application") |
20 | 22 | @Unique(["name"]) |
21 | 23 | export class Application extends DbBaseEntity { |
@@ -64,4 +66,46 @@ export class Application extends DbBaseEntity { |
64 | 66 | ) |
65 | 67 | @JoinTable() |
66 | 68 | permissions: OrganizationApplicationPermission[]; |
| 69 | + |
| 70 | + @Column({ nullable: true }) |
| 71 | + status?: ApplicationStatus; |
| 72 | + |
| 73 | + @CreateDateColumn({ nullable: true }) |
| 74 | + startDate?: Date; |
| 75 | + |
| 76 | + @CreateDateColumn({ nullable: true }) |
| 77 | + endDate?: Date; |
| 78 | + |
| 79 | + @Column({ nullable: true }) |
| 80 | + category?: string; |
| 81 | + |
| 82 | + @Column({ nullable: true }) |
| 83 | + owner?: string; |
| 84 | + |
| 85 | + @Column({ nullable: true }) |
| 86 | + contactPerson?: string; |
| 87 | + |
| 88 | + @Column({ nullable: true }) |
| 89 | + contactEmail?: string; |
| 90 | + |
| 91 | + @Column({ nullable: true }) |
| 92 | + contactPhone?: string; |
| 93 | + |
| 94 | + @Column({ nullable: true }) |
| 95 | + personalData?: boolean; |
| 96 | + |
| 97 | + @Column({ nullable: true }) |
| 98 | + hardware?: string; |
| 99 | + |
| 100 | + @OneToMany(() => ControlledProperty, entity => entity.application, { |
| 101 | + nullable: true, |
| 102 | + cascade: true, |
| 103 | + }) |
| 104 | + controlledProperties?: ControlledProperty[]; |
| 105 | + |
| 106 | + @OneToMany(() => ApplicationDeviceType, entity => entity.application, { |
| 107 | + nullable: true, |
| 108 | + cascade: true, |
| 109 | + }) |
| 110 | + deviceTypes?: ApplicationDeviceType[]; |
67 | 111 | } |
0 commit comments