import { prisma } from '@/lib/prisma'; import { isAdminAuthenticated } from '@/lib/adminAuth'; import AdminNav from '@/components/AdminNav'; import Link from 'next/link'; export default async function FinancialAuditPage({ searchParams, }: { searchParams: { type?: string; action?: string; from?: string; to?: string }; }) { const isAdmin = await isAdminAuthenticated(); if (!isAdmin) { return
Complete record of all changes to financial data (orders, sales, purchases, expenses). Use this to track who changed what and when.
{/* Stats */}Total Changes
{allLogs.length}
Last 30 Days
{last30Days.length}
Deletions
0 ? 'text-splash-pink' : ''}`}> {deletions.length}
Creates/Updates
{allLogs.length - deletions.length}
No audit logs found.
) : (| Date & Time | Action | Entity Type | Entity ID | Changed By (IP) | Details |
|---|---|---|---|---|---|
| {log.changedAt.toLocaleDateString('en-GB', { day: '2-digit', month: 'short', year: 'numeric', })}{' '} {log.changedAt.toLocaleTimeString('en-GB', { hour: '2-digit', minute: '2-digit', second: '2-digit', })} | {log.action} | {log.entityType} | {log.entityId} | {log.changedBy || '—'} | {changeList || log.reason || '—'} |
Showing last 200 changes. Audit logs help you track financial data integrity and detect unauthorized changes.