Task #50
openMLA Availability (Calender Configuration)
0%
Description
Build the calendar management module where admin users define the MLA’s availability by setting dates, locations, time ranges, and maximum appointment slots. The system generates a visual calendar for citizens, marking available dates in green and fully booked dates in red. It also automatically updates slot counts and availability status to prevent overbooking and ensure accurate scheduling.
***Table: mla_availability
Field Type Description
id BIGINT (PK) Availability record ID
constituency_id BIGINT (FK → constituencies.id) Related constituency
available_date DATE Date MLA is available
location VARCHAR(200) Place where MLA is available
start_time TIME Availability start time
end_time TIME Availability end time
max_slots INT Maximum appointments allowed
booked_slots INT Number of booked slots
status ENUM('AVAILABLE','FULL','CANCELLED') Availability status
created_by BIGINT (FK → users.id) Admin who created
created_at TIMESTAMP Created date
***Validations
*available_date must be today or future date
*end_time must be greater than start_time
*max_slots must be greater than 0
*booked_slots ≤ max_slots
*Status automatically changes to FULL when slots are filled
*Only Admin can create or modify availability