import { Body, Controller, Get, Post, Query } from '@nestjs/common'; import { ApiTags } from '@nestjs/swagger'; import { AuditDeletesDto, AuditDeletesResponseDto, FileChecksumDto, FileChecksumResponseDto, FileReportDto, FileReportFixDto, } from 'src/domain/audit/audit.dto'; import { AuditService } from 'src/domain/audit/audit.service'; import { AuthDto } from 'src/domain/auth/auth.dto'; import { AdminRoute, Auth, Authenticated } from 'src/middleware/auth.guard'; @ApiTags('Audit') @Controller('audit') @Authenticated() export class AuditController { constructor(private service: AuditService) {} @Get('deletes') getAuditDeletes(@Auth() auth: AuthDto, @Query() dto: AuditDeletesDto): Promise { return this.service.getDeletes(auth, dto); } @AdminRoute() @Get('file-report') getAuditFiles(): Promise { return this.service.getFileReport(); } @AdminRoute() @Post('file-report/checksum') getFileChecksums(@Body() dto: FileChecksumDto): Promise { return this.service.getChecksums(dto); } @AdminRoute() @Post('file-report/fix') fixAuditFiles(@Body() dto: FileReportFixDto): Promise { return this.service.fixItems(dto.items); } }