Skip to the content.

← Back to Plugin Architecture

5.1 Officers Plugin

Last Updated: July 18, 2025
Status: Complete
Plugin: Officers

The Officers plugin manages the officer structure, responsibilities, and hierarchy within the kingdom.

Purpose

This plugin defines the officer positions, their relationships, and their organizational structure. It works closely with the Warrants module to manage officer appointments.

Data Model

classDiagram
    class Department {
        +id: int
        +name: string
        +domain: string
        +created: datetime
        +modified: datetime
        +created_by: int
        +modified_by: int
        +deleted: datetime
    }
    
    class Office {
        +id: int
        +name: string
        +department_id: int
        +reports_to_id: int
        +deputy_to_id: int
        +grants_role_id: int
        +requires_warrant: bool
        +required_office: bool
        +only_one_per_branch: bool
        +can_skip_report: bool
        +term_length: int
        +applicable_branch_types: string
        +default_contact_address: string
        +created: datetime
        +modified: datetime
        +created_by: int
        +modified_by: int
        +deleted: datetime
    }
    
    Department "1" -- "0..*" Office
    Office "0..1" -- "0..*" Office : reports_to
    Office "0..1" -- "0..*" Office : deputy_to

Key Features

Officer Assignment Workflow

Complete Assignment Lifecycle

The Officers plugin implements a comprehensive officer assignment lifecycle that spans from initial appointment through active management to eventual release. This workflow integrates multiple KMP systems including warrant management, role-based access control, temporal validation, and organizational hierarchy management.

1. Assignment Initiation

Member Selection and Validation

Office Discovery and Selection

2. Assignment Processing

Service-Oriented Architecture The DefaultOfficerManager service implements the core assignment business logic:

// Assignment workflow through OfficerManagerInterface
$result = $officerManager->assign(
    $officeId,
    $memberId,
    $branchId,
    $startOn,
    $endOn,
    $deputyDescription,
    $approverId,
    $emailAddress
);

Validation and Business Rules

Warrant Integration

3. Temporal Management

ActiveWindow Integration

Automatic Status Management

4. Role-Based Security Integration

Permission-Based Assignment Authority

Automatic Role Assignment

Assignment Management Operations

Officer Editing and Updates

Assignment Modification Interface The officer editing workflow (edit-officer-controller.js) provides:

Data Integrity Validation

Officer Release Processing

Release Workflow The release process through DefaultOfficerManager::release() includes:

Cleanup and Transition

Bulk Operations and Administrative Management

Roster Generation and Management

Organizational Roster Creation The RostersController provides bulk assignment capabilities:

Administrative Oversight

Officer Search and Discovery

Advanced Search Capabilities The officer roster search system (officer-roster-search-controller.js) provides:

Table Management and Selection The roster table system (officer-roster-table-controller.js) includes:

Office Hierarchy Management

Organizational Structure Configuration

Department Management

Departmental Organization Departments provide the foundational organizational structure:

Department Lifecycle Management

Office Configuration and Hierarchy

Hierarchical Office Structure Offices implement sophisticated hierarchical relationships:

Office Lifecycle Operations

Hierarchical Relationship Management

Reporting Structure Integration

Hierarchical Navigation The system provides comprehensive hierarchical navigation:

Hierarchy Validation

Integration with Assignment System

Hierarchy-Aware Assignment Processing Officer assignments respect hierarchical constraints:

Administrative Workflow Integration

Warrant Integration and Role Management

Warrant Requirement Configuration

Automatic Role Assignment

Warrant-Triggered Role Management The system implements sophisticated warrant integration:

Configuration Management

Warrant Lifecycle Integration

Assignment and Warrant Coordination

Integrated Workflow Processing Officer assignments coordinate with warrant management:

Business Rule Enforcement

Automatic Role Management

Role Assignment Automation Warrant approval triggers automatic role processing:

Role Lifecycle Management

Administrative Oversight and Compliance

Warrant Status Reporting

Comprehensive Compliance Monitoring The system provides extensive warrant compliance reporting:

Compliance Validation

Integration with Administrative Workflows

Administrative Interface Integration Warrant management integrates with administrative workflows:

Workflow Automation

Integration Points

The Officers plugin integrates with:

References