refactor: update MikroORM entities definition
[e-mobility-charging-stations-simulator.git] / src / types / orm / entities / PerformanceRecord.ts
1 import { Collection, Entity, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'
2
3 import { PerformanceData } from './PerformanceData.js'
4
5 @Entity()
6 export class PerformanceRecord {
7 @PrimaryKey()
8 id!: string
9
10 @Property()
11 name!: string
12
13 @Property()
14 uri!: string
15
16 @Property()
17 createdAt!: Date
18
19 @Property()
20 updatedAt?: Date
21
22 @OneToMany(() => PerformanceData, performanceData => performanceData.performanceRecord)
23 performanceData? = new Collection<PerformanceData>(this)
24 }