Skip to content

Add over-allocation warning on labor status form (#615)#646

Open
DanielRukwasha wants to merge 105 commits into
developmentfrom
615-over-allocation-warning-lsf-creation
Open

Add over-allocation warning on labor status form (#615)#646
DanielRukwasha wants to merge 105 commits into
developmentfrom
615-over-allocation-warning-lsf-creation

Conversation

@DanielRukwasha

Copy link
Copy Markdown

Closes #615. Shows a non-blocking allocation warning when creating a labor status form that would put the department over its allocation for the selected job type/hours band.

BetterRocket and others added 30 commits June 30, 2026 18:45
…nhistory info to change the primary key field so position code shows
…_peeweeAttribute

Nahom dee alpha peewee attribute
DanielRukwasha and others added 28 commits July 7, 2026 14:27
…-card-real-data-ruk

# Conflicts:
#	app/controllers/main_routes/main_routes.py
#	app/templates/main/departmentPortal.html
#	database/demo_data.py
#	database/migrate_db.sh
Extract allocation logic into app/logic/allocation.py (getAllocationSummary, getAllocationWarning), wire it into modal_approval_and_denial_data() to show a per-department warning box in the approval confirmation modal, and fix demo data so students/supervisors are marked active (needed for the approval checkbox to render at all).
isOverAllocated was a single combined flag, so a department over on one category but fine on the other would show the whole box the same way. Split into isPositionsOverAllocated / isBreakHoursOverAllocated so each metric line is highlighted (with an explicit warning marker, not just color) based on its own status.
…llocated

Complements the pre-approval modal warning: after a Pending LSF is approved, check the affected department's allocation and flash a warning (non-blocking) if it's now over its allocated positions or break hours. Reuses getAllocationWarning() from #602/#622's shared allocation logic.
Imran found that approving forms into a specific band (e.g. 10 Hour Primary, allocated 1) past its limit showed no warning, because isPositionsOverAllocated only compared the aggregate total across all 6 bands. A department can be under its total while one band is individually over. getAllocationWarning() now also flags any band where used > allocated, and both the pre-approval modal and the post-approval flash name the specific band(s) that are over instead of just the misleading aggregate number.

Also removed docstrings that were flagged as too explicit in review.
…-allocation-warning-lsf-approval

# Conflicts:
#	app/models/allocation.py
#	app/models/positionHistory.py
#	database/demo_data.py
…ation-warning-lsf-creation

# Conflicts:
#	app/static/css/base.css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display Over-Allocation Warnings During LSF Creation