feat: Adds createMany for rooms, in prep for parsing / uploading a csv file of room loads.
All checks were successful
CI / Linux Tests (push) Successful in 7m0s

This commit is contained in:
2026-02-04 21:06:05 -05:00
parent 10dd0dac82
commit 5f03056534
6 changed files with 87 additions and 70 deletions

View File

@@ -15,6 +15,13 @@ extension DatabaseClient.Rooms: TestDependencyKey {
try await model.validateAndSave(on: database)
return try model.toDTO()
},
createMany: { rooms in
try await rooms.asyncMap { request in
let model = try request.toModel()
try await model.validateAndSave(on: database)
return try model.toDTO()
}
},
delete: { id in
guard let model = try await RoomModel.find(id, on: database) else {
throw NotFoundError()