Add editable project floors and rooms

This commit is contained in:
Julian Appel 2026-07-31 14:46:06 +02:00
parent 1e3c721cfa
commit 1eed19ef6b
15 changed files with 743 additions and 80 deletions

View file

@ -1,4 +1,4 @@
import { asc, eq } from "drizzle-orm";
import { and, asc, eq } from "drizzle-orm";
import type { AppDatabase } from "../database-context.js";
import { floors } from "../schema/floors.js";
@ -13,4 +13,12 @@ export class FloorRepository {
.where(eq(floors.projectId, projectId))
.orderBy(asc(floors.sortOrder), asc(floors.name));
}
async findById(projectId: string, floorId: string) {
return this.database
.select()
.from(floors)
.where(and(eq(floors.projectId, projectId), eq(floors.id, floorId)))
.get() ?? null;
}
}