OfficerManagerInterface
in
Service contract for officer lifecycle management operations.
Defines methods for officer assignment, release, and recalculation with integrated warrant management, role assignment, and notification processing.
Tags
Table of Contents
Methods
- assign() : ServiceResult
- Assign a member to an office position.
- recalculateOfficersForOffice() : ServiceResult
- Recalculate reporting relationships and roles for all officers of an office.
- release() : ServiceResult
- Release a member from an office position.
Methods
assign()
Assign a member to an office position.
public
assign(int $officeId, int $memberId, int $branchId, DateTime $startOn, DateTime|null $endOn, string|null $deputyDescription, int $approverId, string|null $emailAddress) : ServiceResult
Handles office validation, member verification, warrant integration, ActiveWindow temporal management, and hire notifications.
Parameters
- $officeId : int
-
Office identifier for assignment
- $memberId : int
-
Member identifier being assigned
- $branchId : int
-
Branch identifier for organizational context
- $startOn : DateTime
-
Assignment start date
- $endOn : DateTime|null
-
Optional end date; derived from office term_length if null
- $deputyDescription : string|null
-
Optional description for deputy positions
- $approverId : int
-
Approver identifier for audit trail
- $emailAddress : string|null
-
Optional email for officer record
Return values
ServiceResult —Success with assignment data, or failure with reason
recalculateOfficersForOffice()
Recalculate reporting relationships and roles for all officers of an office.
public
recalculateOfficersForOffice(int $officeId, int $updaterId) : ServiceResult
Call when office deputy_to_id, reports_to_id, or grants_role_id changes. Processes all current and upcoming officers with fail-fast error handling.
Parameters
- $officeId : int
-
Office identifier for recalculation
- $updaterId : int
-
Administrator identifier for audit trail
Return values
ServiceResult —Success with counts (updated_count, current_count, upcoming_count), or failure with specific member/office/branch identification
release()
Release a member from an office position.
public
release(int $officerId, int $revokerId, DateTime $revokedOn, string|null $revokedReason) : ServiceResult
Handles ActiveWindow termination, warrant cancellation for warrant-required offices, and release notifications.
Parameters
- $officerId : int
-
Officer record identifier
- $revokerId : int
-
Administrator identifier for audit trail
- $revokedOn : DateTime
-
Effective release date
- $revokedReason : string|null
-
Optional reason for release
Return values
ServiceResult —Success or failure with reason