feat: Adds equipment info to database and api routes.

This commit is contained in:
2025-12-29 16:31:57 -05:00
parent 31930cd399
commit a2514853a6
4 changed files with 246 additions and 4 deletions

View File

@@ -15,20 +15,23 @@ public struct DatabaseClient: Sendable {
public var migrations: Migrations
public var projects: Projects
public var rooms: Rooms
public var equipment: Equipment
}
extension DatabaseClient: TestDependencyKey {
public static let testValue: DatabaseClient = Self(
migrations: .testValue,
projects: .testValue,
rooms: .testValue
rooms: .testValue,
equipment: .testValue
)
public static func live(database: any Database) -> Self {
.init(
migrations: .liveValue,
projects: .live(database: database),
rooms: .live(database: database)
rooms: .live(database: database),
equipment: .live(database: database)
)
}
}
@@ -48,6 +51,7 @@ extension DatabaseClient.Migrations: DependencyKey {
public static let liveValue = Self(
run: {
[
EquipmentInfo.Migrate(),
Project.Migrate(),
Room.Migrate(),
]