Add 'Mark as Cleaned Up' functionality

- Add cleaned_at and cleaned_by_user_id fields to reports table
- Create database migration for cleanup tracking
- Add markAsCleaned backend endpoint and service method
- Add Mark as Cleaned Up button to ReportDetailModal
- Update types to include cleaned fields
- Add frontend handler to mark reports as cleaned
This commit is contained in:
2025-11-16 22:26:59 +00:00
parent beb5d8e7d8
commit 17e3e85781
9 changed files with 168 additions and 21 deletions

View File

@@ -330,6 +330,29 @@ export class ReportService {
data: { verificationStatus: status },
});
}
async markAsCleaned(reportId: string, userId: string) {
// Check if report exists
const report = await prisma.report.findUnique({
where: { id: reportId },
});
if (!report) {
throw new Error('Report not found');
}
// Mark as cleaned
await prisma.report.update({
where: { id: reportId },
data: {
cleanedAt: new Date(),
cleanedByUserId: userId,
},
});
// Return updated report
return this.getReportById(reportId);
}
}
export const reportService = new ReportService();