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

@@ -1,5 +1,34 @@
import type { Dayjs } from 'dayjs';
export interface CheckInFormValues {
studentId: number;
roomId: number;
checkInDate: Dayjs;
billingStartDate?: Dayjs;
stayType?: string;
collectDeposit?: boolean;
depositAmount?: number;
notes?: string;
bedId: number;
lockerId?: number;
}
export const buildCheckInPayload = (values: CheckInFormValues) => {
const collectDeposit = values.collectDeposit ?? false;
return {
studentId: values.studentId,
roomId: values.roomId,
checkInDate: values.checkInDate.format('YYYY-MM-DD'),
billingStartDate: (values.billingStartDate || values.checkInDate).format('YYYY-MM-DD'),
stayType: values.stayType || 'short',
collectDeposit,
depositAmount: collectDeposit ? values.depositAmount ?? 500 : undefined,
notes: values.notes?.trim() || undefined,
bedId: values.bedId,
lockerId: values.lockerId || undefined,
};
};
export interface TransferFormValues {
newRoomId: number;
newBedId: number;