Skip to content

Feat: audit log for status changes - #185

Open
mozsarmate wants to merge 2 commits into
mainfrom
feat/audit-log
Open

Feat: audit log for status changes#185
mozsarmate wants to merge 2 commits into
mainfrom
feat/audit-log

Conversation

@mozsarmate

Copy link
Copy Markdown
Contributor

Added audit logs to make application status changes traceble. See more info in the git log of the commits.

image

@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
schbody-frontend Ready Ready Preview Sep 7, 2026 8:04pm UTC

Request Review

@mozsarmate mozsarmate changed the title Feat/audit log Feat: audit log for status changes Sep 7, 2026
Add an ApplicationStatusLog table that records every application status
transition: timestamp, acting user and previous/new status. All status
changes now go through a single helper that writes the log entry and
refreshes the application's updatedAt.

- new ApplicationStatusLog model + migration
- applyStatusChange() centralises the status update and audit write
- thread the acting user through the manual PATCH and the profile
  picture side effects; system-initiated changes are logged with a
  null user
- GET /application/status-logs and GET /application/:id/status-logs
New /application-status-logs admin page that lists every application
status change with the affected applicant, the acting user and the
previous/new status.

- client-side filtering (per-column text + date range), sorting and
  pagination, reusing the periods DataTable building blocks
- useApplicationStatusLogs hook + entity type
- linked from the admin dashboard

@BarnaPuppi BarnaPuppi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Én a backendben nem láttam problémát, de pls valaki hozzáértő is nézze át azért

@TGyAkos TGyAkos left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the magic value, it LGTM

try {
await this.prisma.application.findUniqueOrThrow({ where: { id } });
} catch (e) {
if (e instanceof Prisma.PrismaClientKnownRequestError && e.code === 'P2025') {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please wrap your magic values in local constants

@TGyAkos
TGyAkos self-requested a review September 10, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants