feat: draft controller entry

chore: lint & format
This commit is contained in:
izzy
2025-11-27 17:23:54 +00:00
parent 8db6132669
commit 0fdc7b4448
9 changed files with 154 additions and 19 deletions
+2 -2
View File
@@ -382,11 +382,11 @@ export class AssetRepository {
return items.map((asset) => asset.deviceAssetId);
}
async getAllAssetPaths() {
getAllAssetPaths() {
return this.db.selectFrom('asset').select(['originalPath', 'encodedVideoPath']).stream();
}
async getAllAssetFilePaths() {
getAllAssetFilePaths() {
return this.db.selectFrom('asset_file').select(['path']).stream();
}
@@ -1,6 +1,7 @@
import { Injectable } from '@nestjs/common';
import { Insertable, Kysely } from 'kysely';
import { InjectKysely } from 'nestjs-kysely';
import { MaintenanceGetIntegrityReportDto, MaintenanceIntegrityReportResponseDto } from 'src/dtos/maintenance.dto';
import { DB } from 'src/schema';
import { IntegrityReportTable } from 'src/schema/tables/integrity-report.table';
@@ -17,6 +18,16 @@ export class IntegrityReportRepository {
.executeTakeFirst();
}
async getIntegrityReport(_dto: MaintenanceGetIntegrityReportDto): Promise<MaintenanceIntegrityReportResponseDto> {
return {
items: await this.db
.selectFrom('integrity_report')
.select(['type', 'path'])
.orderBy('createdAt', 'desc')
.execute(),
};
}
deleteById(id: string) {
return this.db.deleteFrom('integrity_report').where('id', '=', id).execute();
}