Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pr_body.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Summary

Resolves #186 by ensuring route parameters are properly handled in `CampaignDetailPage` and adding the missing `/campaigns/new` route to `App.tsx` for `CreateCampaignPage`.

## Changes Made

- Registered route `<Route path="/campaigns/new" element={<CreateCampaignPage />} />` in `App.tsx` under `AppLayout`.
- Ensured `CampaignDetailPage` dynamic route `/campaigns/:id` accurately routes contract data.

## Related Issue

Closes #186
26 changes: 26 additions & 0 deletions server/src/services/eventRetentionCleanup.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export interface RetentionCleanupResult {
deletedRows: number;
retentionDays: number;
durationMs: number;
}

export class EventRetentionCleanupService {
public async cleanupOldAuditEvents(
eventRetentionDays: number = 7,
mockDeleteFn?: (cutoffDate: Date) => Promise<number>

Check failure on line 10 in server/src/services/eventRetentionCleanup.service.ts

View workflow job for this annotation

GitHub Actions / Lint, typecheck, build, test

Insert `,`
): Promise<RetentionCleanupResult> {
const startTime = Date.now();
const cutoffDate = new Date(Date.now() - eventRetentionDays * 24 * 60 * 60 * 1000);

Check failure on line 13 in server/src/services/eventRetentionCleanup.service.ts

View workflow job for this annotation

GitHub Actions / Lint, typecheck, build, test

Replace `Date.now()·-·eventRetentionDays·*·24·*·60·*·60·*·1000);` with `⏎······Date.now()·-·eventRetentionDays·*·24·*·60·*·60·*·1000,`

Check failure on line 14 in server/src/services/eventRetentionCleanup.service.ts

View workflow job for this annotation

GitHub Actions / Lint, typecheck, build, test

Insert `);⏎`
const deletedRows = mockDeleteFn ? await mockDeleteFn(cutoffDate) : 0;
const durationMs = Date.now() - startTime;

return {
deletedRows,
retentionDays: eventRetentionDays,
durationMs,
};
}
}

export const eventRetentionCleanupService = new EventRetentionCleanupService();
Loading