Labor Management

The Labor tab on a zone detail page shows all staff and teams assigned to that zone. It provides two views — Teams and Individuals — that are two lenses on the same pool of labor. Understanding how these views work together is essential for effective workforce management within zones.

Two Views, One Pool

The Teams view shows teams assigned to this zone as dispatch units. Each team row displays the team name with a color indicator, member count, team lead, dispatch priority, primary zone flag, and status. The Individuals view shows individual staff members assigned to this zone. Each row shows the staff member's name, number of teams they belong to, dispatch priority, primary zone flag, and status.

A person can appear in both views simultaneously. For example, Bob might be assigned directly to the "Downtown" zone as an individual with priority 2 and his own rate and schedule. At the same time, Bob is a member of the "Alpha Cleaning Crew" team, which is also assigned to Downtown. These are separate assignments with different implications for dispatch.

When dispatch sends the Alpha team to a large job, all four team members go together as a unit, following the team's collective priority and schedule. When dispatch sends Bob individually to a smaller job, he follows his personal priority and schedule. The zone needs both views to manage capacity across team-based and individual-based dispatch scenarios.

Staff Assignments

Individual staff assignments are tracked in the zone staff table with the following key properties.

Primary Zone Flag — Each staff member should have exactly one primary zone assignment at any given time. The primary zone is where the staff member is dispatched first. Secondary zone assignments only receive the staff member when the primary zone is fully staffed or does not need them.

Priority — A number where lower values indicate higher dispatch preference. Primary zone staff are always dispatched before secondary zone staff, and within each group, lower priority numbers go first. Priority values should be unique per staff member across their zone assignments.

Effective Dates — Zone assignments support temporal ranges. The effective-from date marks when the assignment starts, and the effective-to date marks when it ends (null means indefinite). This enables seasonal staffing, vacation coverage, and planned reassignments.

Team Assignments

Team assignments work similarly to individual assignments but treat the team as a single dispatch unit. The team assignment includes a primary zone flag, priority number, effective dates, and notes. When a team is dispatched to a zone, all active team members participate.

Team assignments include additional information: the team's member list (showing up to eight members with role badges in the preview drawer), team settings like visibility and join policy, and the team lead.

Adding Labor

The "+ Labor" button in the toolbar opens a dropdown with two options: "Assign Staff" and "Assign Team." Selecting either option opens a creation form in the drawer.

The staff assignment form includes a user picker dropdown that filters out staff already assigned to this zone, toggle for primary designation, priority number input, notes textarea, and effective date range pickers. The team assignment form is identical but uses a team picker with color dots.

The system enforces duplicate checking — you cannot assign the same staff member or team to the same zone twice while both assignments are active.

Drawer Previews

Clicking a row in the labor table opens a preview drawer on the right side. Staff previews show staff info (name, email, status), zone assignment details (primary or secondary, priority, effective dates, notes), and team memberships. Team previews show team info (name with color dot, description, status), zone assignment details, member list with role badges, and team settings.

Both previews include an "Open Full View" footer button that creates a new bottom tab for that entity, maintaining the zone context. This lets you navigate deeply into a staff member's or team's details without losing your place in the zone.

Removing Assignments

Preview drawers include a "Remove from Zone" action that soft-deletes the assignment after confirmation. Removing a zone assignment does not affect historical job records, completed timesheets, or payroll records. The assignment is preserved in the database with a deletion flag for audit purposes.

Dispatch Priority Flow

When a job comes in for a zone, the dispatch engine follows a strict priority order. First, it finds all active staff and team assignments for the zone within their effective date ranges. Then it sorts candidates with primary zone assignments first, followed by secondary assignments, each group sorted by priority number ascending. For each candidate, it checks availability via schedules, existing job conflicts, and skill or certification requirements. The first available candidate in priority order gets assigned.

If no candidates are available within the zone, the system escalates to the parent zone hierarchy, then to neighboring zones, and finally to the Pandora marketplace for broader availability.