Add Revit return workbook export
This commit is contained in:
parent
77d775fde1
commit
1a4c8cad8c
17 changed files with 3783 additions and 6 deletions
18
src/db/repositories/external-export-batch.repository.ts
Normal file
18
src/db/repositories/external-export-batch.repository.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { desc, eq } from "drizzle-orm";
|
||||
import type { AppDatabase } from "../database-context.js";
|
||||
import { externalExportBatches } from "../schema/external-export-batches.js";
|
||||
|
||||
export class ExternalExportBatchRepository {
|
||||
constructor(private readonly database: AppDatabase) {}
|
||||
|
||||
append(batch: typeof externalExportBatches.$inferInsert) {
|
||||
this.database.insert(externalExportBatches).values(batch).run();
|
||||
return batch;
|
||||
}
|
||||
|
||||
listByProject(projectId: string) {
|
||||
return this.database.select().from(externalExportBatches)
|
||||
.where(eq(externalExportBatches.projectId, projectId))
|
||||
.orderBy(desc(externalExportBatches.exportedAtIso), desc(externalExportBatches.id)).all();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue