Skip to content

Commit 36f0a41

Browse files
committed
Fix bugs preventing run start
1 parent 0f8372c commit 36f0a41

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

backend/src/reports/models/report.model.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
export 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
}

backend/src/reports/reports.controller.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
ApiBody,
2727
} from '@nestjs/swagger';
2828
import { ReportsService } from './reports.service';
29-
import { Report } from './models/report.model';
29+
import type { Report } from './models/report.model';
3030
import { GetReportsQueryDto } from './dto/get-reports.dto';
3131
import { UpdateReportStatusDto } from './dto/update-report-status.dto';
3232
import { 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,

backend/src/reports/reports.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
DynamoDBServiceException,
1717
} from '@aws-sdk/client-dynamodb';
1818
import { marshall, unmarshall } from '@aws-sdk/util-dynamodb';
19-
import { Report } from './models/report.model';
19+
import { Report, ReportStatus } from './models/report.model';
2020
import { GetReportsQueryDto } from './dto/get-reports.dto';
2121
import { UpdateReportStatusDto } from './dto/update-report-status.dto';
2222
import { 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
};

0 commit comments

Comments
 (0)