File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 11export enum ReportStatus {
2+ PENDING = 'PENDING' ,
3+ PROCESSING = 'PROCESSING' ,
4+ COMPLETED = 'COMPLETED' ,
5+ REJECTED = 'REJECTED' ,
26 UNREAD = 'UNREAD' ,
37 READ = 'READ' ,
48}
@@ -12,7 +16,7 @@ export interface Report {
1216 mimeType ?: string ;
1317 size ?: number ;
1418 description ?: string ;
15- status : 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'REJECTED' ;
19+ status : ReportStatus ;
1620 createdAt : string ;
1721 updatedAt : string ;
1822}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ import {
2626 ApiBody ,
2727} from '@nestjs/swagger' ;
2828import { ReportsService } from './reports.service' ;
29- import { Report } from './models/report.model' ;
29+ import type { Report } from './models/report.model' ;
3030import { GetReportsQueryDto } from './dto/get-reports.dto' ;
3131import { UpdateReportStatusDto } from './dto/update-report-status.dto' ;
3232import { RequestWithUser } from '../auth/auth.middleware' ;
@@ -43,7 +43,6 @@ export class ReportsController {
4343 @ApiResponse ( {
4444 status : 200 ,
4545 description : 'Returns all reports for the authenticated user' ,
46- type : [ Report ] ,
4746 } )
4847 @Get ( )
4948 async findAll ( @Req ( ) request : RequestWithUser ) : Promise < Report [ ] > {
@@ -55,7 +54,6 @@ export class ReportsController {
5554 @ApiResponse ( {
5655 status : 200 ,
5756 description : 'Returns the latest reports for the authenticated user' ,
58- type : [ Report ] ,
5957 } )
6058 @ApiQuery ( {
6159 name : 'limit' ,
@@ -75,7 +73,6 @@ export class ReportsController {
7573 @ApiResponse ( {
7674 status : 200 ,
7775 description : 'Report details' ,
78- type : Report ,
7976 } )
8077 @ApiResponse ( {
8178 status : 404 ,
@@ -95,7 +92,6 @@ export class ReportsController {
9592 @ApiResponse ( {
9693 status : 200 ,
9794 description : 'Report status updated successfully' ,
98- type : Report ,
9995 } )
10096 @ApiResponse ( {
10197 status : 404 ,
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import {
1616 DynamoDBServiceException ,
1717} from '@aws-sdk/client-dynamodb' ;
1818import { marshall , unmarshall } from '@aws-sdk/util-dynamodb' ;
19- import { Report } from './models/report.model' ;
19+ import { Report , ReportStatus } from './models/report.model' ;
2020import { GetReportsQueryDto } from './dto/get-reports.dto' ;
2121import { UpdateReportStatusDto } from './dto/update-report-status.dto' ;
2222import { S3Service } from '../common/services/s3.service' ;
@@ -291,7 +291,7 @@ export class ReportsService {
291291 mimeType : uploadResult . mimeType ,
292292 size : uploadResult . size ,
293293 description : description || '' ,
294- status : ' PENDING' , // Initial status
294+ status : ReportStatus . PENDING , // Use enum value instead of string
295295 createdAt : now ,
296296 updatedAt : now ,
297297 } ;
You can’t perform that action at this time.
0 commit comments