fix(occupancies): assign room resources during transfers

This commit is contained in:
2026-07-13 12:01:48 +08:00
parent 8cadf8970e
commit 2874ab7bee
6 changed files with 156 additions and 13 deletions

View File

@@ -0,0 +1,21 @@
import type { Dayjs } from 'dayjs';
export interface TransferFormValues {
newRoomId: number;
newBedId: number;
newLockerId?: number;
transferDate: Dayjs;
oldBillingEndDate?: Dayjs;
newBillingStartDate?: Dayjs;
reason?: string;
}
export const buildTransferPayload = (values: TransferFormValues) => ({
newRoomId: values.newRoomId,
newBedId: values.newBedId,
newLockerId: values.newLockerId || undefined,
transferDate: values.transferDate.format('YYYY-MM-DD'),
oldBillingEndDate: values.oldBillingEndDate?.format('YYYY-MM-DD'),
newBillingStartDate: values.newBillingStartDate?.format('YYYY-MM-DD'),
reason: values.reason,
});