forked from wangziqi/gongxue-base
fix(occupancies): assign room resources during transfers
This commit is contained in:
21
apps/admin/src/pages/Occupancies/occupancy-form.ts
Normal file
21
apps/admin/src/pages/Occupancies/occupancy-form.ts
Normal 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,
|
||||
});
|
||||
Reference in New Issue
Block a user