feat: refine admin forms, attendance and finance workflows

Squash merge PR #23.

Included changes:
- complete occupancy check-in required fields/default payload
- improve responsive admin management pages
- fix attendance edge cases and attendance period config
- refine wallet/finance-related workflow handling

Checks:
- npm run typecheck -w apps/admin
- npm run typecheck -w apps/server
This commit is contained in:
2026-07-18 12:54:10 +00:00
parent 92d303ed01
commit 375c7ec60b
64 changed files with 5169 additions and 2404 deletions

View File

@@ -202,24 +202,67 @@ export const LOG_ACTIONS = {
// ── Permission nodes (PRD §17) ──────────────────────────────────────
export const PERMISSION_NODES = [
'student:view', 'student:add', 'student:update', 'student:delete',
'student:import', 'student:export',
'room:view', 'room:add', 'room:update', 'room:delete',
'occupancy:view', 'occupancy:add', 'occupancy:update',
'bill:view', 'bill:generate', 'bill:confirm', 'bill:markPaid', 'bill:export',
'expense:view', 'expense:add', 'expense:update', 'expense:delete',
'deposit:view', 'deposit:collect', 'deposit:refund',
'class:view', 'class:add', 'class:update', 'class:delete',
'schedule:view', 'schedule:add', 'schedule:update', 'schedule:delete',
'attendance:view', 'attendance:add', 'attendance:update', 'attendance:delete',
'student:view',
'student:add',
'student:update',
'student:delete',
'student:import',
'student:export',
'room:view',
'room:add',
'room:update',
'room:delete',
'occupancy:view',
'occupancy:add',
'occupancy:update',
'bill:view',
'bill:generate',
'bill:confirm',
'bill:markPaid',
'bill:export',
'expense:view',
'expense:add',
'expense:update',
'expense:delete',
'deposit:view',
'deposit:collect',
'deposit:refund',
'class:view',
'class:add',
'class:update',
'class:delete',
'schedule:view',
'schedule:add',
'schedule:update',
'schedule:delete',
'attendance:view',
'attendance:add',
'attendance:update',
'attendance:delete',
'attendance:batch',
'classroom:view', 'classroom:add', 'classroom:update', 'classroom:delete',
'organization:view', 'organization:create', 'organization:edit', 'organization:delete',
'rental:view', 'rental:add', 'rental:update', 'rental:delete',
'archive:view', 'archive:import', 'archive:export',
'classroom:view',
'classroom:add',
'classroom:update',
'classroom:delete',
'organization:view',
'organization:create',
'organization:edit',
'organization:delete',
'rental:view',
'rental:add',
'rental:update',
'rental:delete',
'archive:view',
'archive:import',
'archive:export',
'report:generate',
'log:view',
'role:view', 'role:add', 'role:update', 'role:delete',
'user:view', 'user:add', 'user:update',
'role:view',
'role:add',
'role:update',
'role:delete',
'user:view',
'user:add',
'user:update',
'dashboard:view',
] as const;

View File

@@ -25,7 +25,9 @@ type Role = keyof typeof CREDENTIALS;
* Login as a specific role and store the token in localStorage.
* Returns the parsed response data.
*/
export async function loginAs(role: Role): Promise<{ token: string; user: Record<string, unknown> }> {
export async function loginAs(
role: Role,
): Promise<{ token: string; user: Record<string, unknown> }> {
const creds = CREDENTIALS[role];
const res = await fetch(`${BASE}/api/auth/login`, {
method: 'POST',