refactor: update MikroORM entities definition
[e-mobility-charging-stations-simulator.git] / src / types / orm / entities / PerformanceRecord.ts
index 36db5c5bc1b2f19235afac093074c3db4aabe310..a0ee77e756f4f2d9e628c002963ec16c8c8588fc 100644 (file)
@@ -1,21 +1,24 @@
-// eslint-disable-next-line @typescript-eslint/no-unused-vars
 import { Collection, Entity, OneToMany, PrimaryKey, Property } from '@mikro-orm/core'
 
-// eslint-disable-next-line @typescript-eslint/no-unused-vars
-import type { PerformanceData } from './PerformanceData.js'
+import { PerformanceData } from './PerformanceData.js'
 
 @Entity()
 export class PerformanceRecord {
-  // @PrimaryKey()
-  //   pk!: number
-  // @Property()
-  //   id!: string
-  // @Property()
-  //   URI!: string
-  // @Property()
-  //   createdAt!: Date
-  // @Property()
-  //   updatedAt?: Date
-  // @OneToMany('PerformanceData', 'performanceRecord')
-  //   performanceData? = new Collection<PerformanceData>(this)
+  @PrimaryKey()
+    id!: string
+
+  @Property()
+    name!: string
+
+  @Property()
+    uri!: string
+
+  @Property()
+    createdAt!: Date
+
+  @Property()
+    updatedAt?: Date
+
+  @OneToMany(() => PerformanceData, performanceData => performanceData.performanceRecord)
+    performanceData? = new Collection<PerformanceData>(this)
 }