# Lawyer Profiles, Team Assignment, Workload Management and Controlled Handover

## Overview

This guide covers the complete Task 2.3 workflow: HR-integrated lawyer profiles, matter team assignment, workload and availability review, assignment approval, reassignment, controlled handover, access transitions, HR-event alerts, notifications, and audit history.

Lawyer resource management is integrated into the existing **HR** and **Matter Management** modules. HR remains the authoritative source for employee identity, employment status, professional information, leave, schedules, and assignment availability. Matter Management stores matter-specific team assignments, workload decisions, reassignments, and handovers.

No separate lawyer directory, employee record, leave register, calendar, task list, or document store is created.

## Permissions

Access is controlled by the existing roles and permissions framework:

- `staff_read` and `staff_update` — view or maintain legal professional information in HR.
- `matters_read` — view matter team, reassignment, and handover information.
- `matters_assign_team` — propose assignments and end eligible non-lead assignments.
- `matters_approve_assignment` — approve or reject proposed assignments.
- `matters_reassign` — request a controlled reassignment.
- `matters_approve_reassignment` — approve or reject reassignment requests.
- `matters_manage_handover` — manage checklist items, cancel, or finalize handovers.
- `matters_override_capacity` — authorize a justified workload-capacity exception.

Backend policies enforce these permissions even when an action is attempted directly through the API.

## Open the HR Staff Directory

1. Open **HR & Payroll** from the main navigation.
2. Select the **Staff** section.
3. Use search, employment-status, and department filters to locate an employee.
4. Select the employee name in the first column or the eye icon in the **Actions** column.

The staff listing displays the employee, job title, department, branch, employment type, status, and start date. Use the pagination controls below the table to move between pages or change the number of displayed records.

## Review a Staff Profile

The first profile card remains visible and shows the employee name, initials, status, title, department, email, branch, and supervisor. The branch is inferred from the employee's linked user account. Correct an inaccurate branch through User Management.

The remaining information is organized into tabs so only one section is displayed at a time:

| Tab | Information shown |
| --- | --- |
| Employment | Employee, email, title, department, employment type and status, dates, supervisor, and branch |
| Professional | Bar admission, experience, roles, registrations, practice areas, qualifications, licences, and education |
| Workload | Matter counts, assignments, tasks, deadlines, hearings, capacity, utilization, and availability |
| Schedule | Normal working days and emergency contacts |
| Assignments | Current and historical matter assignments, responsibilities, periods, and statuses |
| Leave | Leave periods, statuses, and approval details |
| Payroll | Payroll periods, gross pay, tax, net pay, and processing status |

Select a matter reference in the **Assignments** tab to open that matter.

Users with `staff_update` permission can select **Edit** in the profile header. The edit modal updates employment, professional, availability, capacity, schedule, supervisor, and contract information. The linked user account is read-only to preserve the HR-to-user relationship. Select **Update Profile** to save and refresh the displayed details.

## Maintain Legal Professional Information in HR

1. Open **HR & Payroll** and select the staff member.
2. Open the existing staff edit form.
3. Maintain the applicable fields:
   - Bar admission.
   - Legal experience in years.
   - Practice areas and specializations.
   - Professional registrations.
   - Certifications, licences, and education.
   - Assignment availability.
   - Workload capacity.
   - Work schedule and availability notes.
4. Save the employee profile.

Employment status, approved leave, the linked user account, department, position, supervisor, contract dates, and contact details continue to come from the existing HR record.

## Assignment Eligibility

Open a matter and use the **Legal Team & Resource Allocation** section. The employee selector displays HR-backed candidates with eligibility results, warnings, and workload information.

An assignment is blocked when applicable if:

- The employee is not actively employed.
- Assignment availability is disabled.
- The linked user account is inactive.
- The contract ends before the effective date.
- The employee has no eligible legal role or legal job title.
- A lawyer role has no bar admission or professional licence recorded.
- The employee does not match the matter practice area.
- The employee is on approved leave or is not scheduled to work.
- The matter's conflict review is unresolved or rejected.

Court commitments on the effective date and workload capacity are displayed as warnings. A capacity warning may be overridden only by a user with `matters_override_capacity` and a recorded justification. A capacity override never bypasses an eligibility or conflict blocker.

## How the System Determines Unavailability

The system uses two related but different checks.

### Eligibility for a New Assignment or Reassignment

A proposed incoming lawyer is treated as unavailable or ineligible when any of these blockers applies on the requested effective date:

- the HR employment status is not **Active**;
- **Available for matter assignment** is turned off on the HR profile;
- the linked user account is inactive;
- the employment contract ends before the requested effective date;
- approved leave covers the requested effective date;
- the normal work schedule marks that day as a non-working day;
- the employee lacks an eligible legal role or job title;
- a lawyer assignment lacks bar-admission or professional-licence details;
- the employee does not match the matter's practice area; or
- the matter's conflict review is unresolved or rejected.

### Professional Eligibility Requirements

For the professional eligibility check, the employee must have either:

- one of these system roles: **PARTNER**, **ATTORNEY**, **ASSOCIATE**, **PARALEGAL**, or **LEGAL_ASSISTANT**; or
- a job title containing **lawyer**, **attorney**, **counsel**, **paralegal**, or **legal assistant**.

For a **Lead Attorney**, **Associate**, or **Co-Counsel** assignment, the HR profile must also contain either a bar-admission value or at least one professional licence. Paralegal and Legal Assistant assignments do not require bar admission, but the employee must still satisfy the legal role or job-title requirement.

### Practice-Area Requirements

When the matter has a practice area, the employee's HR profile must include that same practice area in **Practice areas**. Matching ignores uppercase or lowercase letters and surrounding spaces, but otherwise requires the complete value to match.

For example, a matter with the practice area **Litigation** accepts a staff profile containing **Litigation** or **litigation**. A profile containing only **Civil Litigation** does not match **Litigation** because partial matching is not used.

If the matter has no practice area recorded, the practice-area check does not block the employee. Practice areas can be maintained from **HR & Payroll > Staff > Staff Profile > Edit** as comma-separated values.

A same-day court hearing and insufficient workload capacity are warnings, not automatic unavailability blockers. Capacity may be overridden by an authorized user with justification; mandatory eligibility and conflict blockers cannot be overridden.

### Existing Assignments Requiring Review

The system flags a lawyer's active assignments for review when:

- the HR employment status changes to a non-active state such as **On Leave**, **Suspended**, **Resigned**, or **Terminated**;
- **Available for matter assignment** changes from enabled to disabled;
- a leave request is approved, including future approved leave; or
- the employee is terminated through the HR termination action.

The impact check finds the employee's active matter assignments and includes upcoming open deadlines and active court hearings. It notifies the employee's supervisor, when assigned, and users with reassignment-approval permission. It also records an audit event.

This is a review flag only. The system does **not** automatically create a reassignment, end the existing assignment, select a replacement, or complete a handover. An authorized user must review the affected matters and start the controlled reassignment workflow where appropriate.

An inactive user account, an expired contract, a non-working day, a court commitment, or high workload can affect eligibility checks without independently creating an assignment-review flag unless an HR update or leave event described above occurs.

## Workload Calculation

The workload summary combines existing matter assignments, tasks, deadlines, and court hearings. It displays:

- Active matter count.
- Lead assignments.
- Supporting assignments.
- Outstanding tasks.
- Deadlines within 30 days.
- Court hearings within 30 days.
- Used, available, and percentage capacity.

The default calculation is:

`used capacity = (lead matters × 1.0) + (supporting matters × 0.6) + (outstanding tasks × 0.2) + (upcoming deadlines × 0.3) + (upcoming hearings × 0.5)`

The weights can be configured on the HR profile through the API, and the configured values are returned with every workload summary. Workload capacity is maintained on the HR employee profile.

## Assign a Matter Team Member

1. Open the matter details page.
2. In **Legal Team & Resource Allocation**, choose the assignment role:
   - Lead Attorney.
   - Associate.
   - Co-Counsel.
   - Paralegal.
   - Legal Assistant.
3. Select an eligible HR employee.
4. Record the employee's matter-specific responsibility and effective date.
5. Review blockers, warnings, workload, and availability.
6. If capacity is exceeded and you have permission, enable the override and enter a meaningful justification.
7. Submit the assignment.

Users with approval permission create an active assignment immediately. Other authorized users create a **Pending Approval** assignment. Duplicate active or pending assignments for the same employee and role are rejected. Replacing an active lead lawyer must use controlled reassignment.

Assignment statuses are **Proposed**, **Pending Approval**, **Approved**, **Active**, **Ended**, and **Rejected**. Historical assignments remain visible on the matter.

## Approve or Reject an Assignment

1. Review the pending assignment in the matter team table.
2. Select **Approve** or **Reject**.
3. Add decision remarks where appropriate.

Eligibility and conflict checks run again at approval time. Approval activates the assignment; rejection preserves it as historical. Relevant users receive notifications, and the decision is audited.

## Reassignment and Handover Are Different

A **reassignment** is the request and approval decision to replace an active matter team member with another eligible employee.

A **handover** is the controlled transfer of matter knowledge, documents, responsibilities, deadlines, hearings, and outstanding work after the reassignment has been approved.

The workflow is:

`Reassignment requested → Reassignment approved → Handover initiated → Checklist completed → Outgoing lawyer confirms → Incoming lawyer acknowledges → Handover finalized → Assignments and access updated`

Approval of a reassignment creates a provisional incoming assignment and starts the handover. It does **not** end the outgoing assignment, activate the replacement fully, or prove that knowledge transfer has occurred. Those changes occur only when the handover requirements are completed and an authorized user finalizes the handover.

## Request a Reassignment

1. Locate an active assignment and choose **Reassign**.
2. Select the proposed replacement from eligible HR employees.
3. Choose a reason:
   - Lawyer unavailability.
   - Excessive workload.
   - Conflict of interest.
   - Resignation or termination.
   - Extended leave.
   - Changed matter requirements.
   - Other authorized reason.
4. Enter the reason details and requested effective date.
5. Review availability and workload warnings, then submit.

The outgoing assignment remains active while the request is pending. Approval creates a provisional incoming assignment and initiates a handover. Rejection leaves the existing assignment unchanged.

The approver reviews the proposed lawyer's employment status, eligibility, practice-area suitability, availability, workload, upcoming hearings and deadlines, conflict results, and any capacity exception. The decision records the approving user, date, remarks, and outcome.

## Complete a Controlled Handover

An approved reassignment is not a completed handover. The handover checklist references existing matter records instead of copying them. It includes:

- Current matter status and legal strategy.
- Outstanding tasks and deadlines.
- Upcoming hearings and calendar events.
- Pleadings, applications, court orders, and rulings where litigation exists.
- Matter documents.
- Pending client communications.
- Matter-specific responsibilities.

To complete a handover:

1. Open the handover from the matter page.
2. Review each checklist item and mark it **Completed** or **Resolved**, adding notes where needed.
3. The outgoing lawyer confirms the handover after all mandatory items are addressed.
4. The incoming lawyer acknowledges receipt.
5. A user with `matters_manage_handover` finalizes the handover.

Finalization ends the outgoing assignment, activates the incoming assignment, and updates the matter's lead attorney when the transferred role is Lead Attorney. Existing tasks, documents, hearings, litigation records, and communications remain unchanged.

A handover may be cancelled before completion with a recorded reason. Cancellation ends only the provisional incoming assignment and leaves the outgoing assignment active.

### Handover Statuses

- **Pending** — the handover exists but work has not started.
- **In Progress** — checklist review and knowledge transfer are underway.
- **Awaiting Acceptance** — outgoing requirements are complete and incoming acknowledgement is required.
- **Completed** — the handover was acknowledged and finalized.
- **Cancelled** — the handover was stopped before completion.

## Matter Access During Reassignment

- The incoming lawyer receives the access required for an authorized provisional assignment and handover.
- The outgoing lawyer retains only the access needed while the handover remains active.
- Finalization updates access according to the active assignment state.
- Access is not retained solely because an employee was previously assigned.
- Access granted through another valid role or assignment is not incorrectly revoked.
- Historical assignments and handovers remain available to authorized users.

Backend authorization enforces these rules independently of frontend visibility.

## HR Changes Affecting Active Assignments

When a lawyer becomes unavailable, starts approved leave, is suspended, resigns, or is terminated, the system identifies their active matters and includes upcoming deadlines and hearings in the impact response. Supervisors and authorized reassignment approvers are notified to review the affected matters.

The system does not automatically reassign matters. Reassignment must follow the validation, approval, and handover process. Existing security rules still revoke account access immediately when employment termination requires it.

## Notifications and Audit History

The existing notification system is used for assignment requests and decisions, reassignment requests and decisions, handover initiation and acceptance, completion, cancellation, and HR changes affecting active matters.

The existing activity log records changes to HR assignment eligibility, team assignments, approvals, capacity overrides, reassignments, handover progress, and final access-state changes.

## Troubleshooting

### The staff Edit button is not visible

Confirm that the signed-in user has the `staff_update` permission.

### The staff branch is incorrect

The staff profile uses the branch assigned to the linked user account. Correct the branch through User Management.

### A lawyer is not available for assignment

Review the employee's HR status, linked user status, assignment availability, legal role, professional details, practice areas, approved leave, work schedule, contract dates, and conflict status.

### An assignment cannot be approved

Eligibility and conflict checks run again during approval. Review the validation message. A capacity override only addresses a capacity warning and requires both permission and justification.

### An approved reassignment did not replace the outgoing lawyer

Approval initiates a handover; it does not complete it. Finish the mandatory checklist, record outgoing confirmation and incoming acknowledgement, and finalize the handover.

### A handover cannot be finalized

Confirm that mandatory checklist items are completed or resolved, required confirmations are recorded, and the finalizing user has `matters_manage_handover` permission.
