swagger: '2.0'
info:
  title: User Management API
  description: |-
    Centralized identity and access control module.

    Includes:
    - **Users** — CRUD, activation, archival, password reset, locking.
    - **Access List** — Pre-registration moderation and verification.
    - **Departments** — Organizational subunits under directorates.
    - **Directorates** — Top-level organizational entities.
    - **Roles** — Permission-based access definitions.
    - **Role Groups** — Containers organizing related roles.
    - **User Role Group Memberships** — Assign role groups to users with audit trail and validity windows.

    These endpoints form the foundation for user lifecycle management, RBAC enforcement, and access governance across the platform.
  contact:
    email: eomoro@krb.go.ke
  license:
    name: BSD License
  version: v1
host: aprpms.devsgraphics.com
schemes:
- http
basePath: /api/user-management
consumes:
- application/json
produces:
- application/json
securityDefinitions:
  Basic:
    type: basic
security:
- Basic: []
paths:
  /access-list/:
    get:
      operationId: access-list_list
      description: Holding table for self-registrations pending verification/approval.
      parameters:
      - name: ordering
        in: query
        description: Which field to use when ordering the results.
        required: false
        type: string
      - name: search
        in: query
        description: A search term.
        required: false
        type: string
      - name: page
        in: query
        description: A page number within the paginated result set.
        required: false
        type: integer
      - name: page_size
        in: query
        description: Number of results to return per page.
        required: false
        type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
            - count
            - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/AccessListList'
      tags:
      - access-list
    post:
      operationId: access-list_create
      description: Holding table for self-registrations pending verification/approval.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/AccessListCreate'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/AccessListCreate'
      tags:
      - access-list
    parameters: []
  /access-list/bulk-reject/:
    post:
      operationId: access-list_bulk_reject
      description: Holding table for self-registrations pending verification/approval.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/AccessListDetail'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/AccessListDetail'
      tags:
      - access-list
    parameters: []
  /access-list/bulk-verify/:
    post:
      operationId: access-list_bulk_verify
      description: Holding table for self-registrations pending verification/approval.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/AccessListDetail'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/AccessListDetail'
      tags:
      - access-list
    parameters: []
  /access-list/summary/:
    get:
      operationId: access-list_summary
      description: Holding table for self-registrations pending verification/approval.
      parameters:
      - name: ordering
        in: query
        description: Which field to use when ordering the results.
        required: false
        type: string
      - name: search
        in: query
        description: A search term.
        required: false
        type: string
      - name: page
        in: query
        description: A page number within the paginated result set.
        required: false
        type: integer
      - name: page_size
        in: query
        description: Number of results to return per page.
        required: false
        type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
            - count
            - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/AccessListDetail'
      tags:
      - access-list
    parameters: []
  /access-list/{id}/:
    get:
      operationId: access-list_read
      description: Holding table for self-registrations pending verification/approval.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/AccessListDetail'
      tags:
      - access-list
    put:
      operationId: access-list_update
      description: Holding table for self-registrations pending verification/approval.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/AccessListUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/AccessListUpdate'
      tags:
      - access-list
    patch:
      operationId: access-list_partial_update
      description: Holding table for self-registrations pending verification/approval.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/AccessListUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/AccessListUpdate'
      tags:
      - access-list
    delete:
      operationId: access-list_delete
      description: Holding table for self-registrations pending verification/approval.
      parameters: []
      responses:
        '204':
          description: ''
      tags:
      - access-list
    parameters:
    - name: id
      in: path
      description: A UUID string identifying this Access List Entry.
      required: true
      type: string
      format: uuid
  /access-list/{id}/create-user/:
    post:
      operationId: access-list_create_user_from_access
      description: Holding table for self-registrations pending verification/approval.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/AccessListDetail'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/AccessListDetail'
      tags:
      - access-list
    parameters:
    - name: id
      in: path
      description: A UUID string identifying this Access List Entry.
      required: true
      type: string
      format: uuid
  /access-list/{id}/reject/:
    post:
      operationId: access-list_reject
      description: Holding table for self-registrations pending verification/approval.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/AccessListDetail'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/AccessListDetail'
      tags:
      - access-list
    parameters:
    - name: id
      in: path
      description: A UUID string identifying this Access List Entry.
      required: true
      type: string
      format: uuid
  /access-list/{id}/unreject/:
    post:
      operationId: access-list_unreject
      description: Holding table for self-registrations pending verification/approval.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/AccessListDetail'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/AccessListDetail'
      tags:
      - access-list
    parameters:
    - name: id
      in: path
      description: A UUID string identifying this Access List Entry.
      required: true
      type: string
      format: uuid
  /access-list/{id}/verify/:
    post:
      operationId: access-list_verify
      description: Holding table for self-registrations pending verification/approval.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/AccessListDetail'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/AccessListDetail'
      tags:
      - access-list
    parameters:
    - name: id
      in: path
      description: A UUID string identifying this Access List Entry.
      required: true
      type: string
      format: uuid
  /departments/:
    get:
      operationId: departments_list
      description: ''
      parameters:
      - name: page
        in: query
        description: A page number within the paginated result set.
        required: false
        type: integer
      - name: page_size
        in: query
        description: Number of results to return per page.
        required: false
        type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
            - count
            - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/DepartmentList'
      tags:
      - departments
    post:
      operationId: departments_create
      description: ''
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/DepartmentCreate'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/DepartmentCreate'
      tags:
      - departments
    parameters: []
  /departments/{id}/:
    get:
      operationId: departments_read
      description: ''
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/DepartmentDetail'
      tags:
      - departments
    put:
      operationId: departments_update
      description: ''
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/DepartmentUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/DepartmentUpdate'
      tags:
      - departments
    patch:
      operationId: departments_partial_update
      description: ''
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/DepartmentUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/DepartmentUpdate'
      tags:
      - departments
    delete:
      operationId: departments_delete
      description: ''
      parameters: []
      responses:
        '204':
          description: ''
      tags:
      - departments
    parameters:
    - name: id
      in: path
      description: Stable UUID primary key for the department (non auto-increment).
      required: true
      type: string
      format: uuid
  /directorates/:
    get:
      operationId: directorates_list
      description: ''
      parameters:
      - name: page
        in: query
        description: A page number within the paginated result set.
        required: false
        type: integer
      - name: page_size
        in: query
        description: Number of results to return per page.
        required: false
        type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
            - count
            - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/DirectorateList'
      tags:
      - directorates
    post:
      operationId: directorates_create
      description: ''
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/DirectorateCreate'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/DirectorateCreate'
      tags:
      - directorates
    parameters: []
  /directorates/{id}/:
    get:
      operationId: directorates_read
      description: ''
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/DirectorateDetail'
      tags:
      - directorates
    put:
      operationId: directorates_update
      description: ''
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/DirectorateUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/DirectorateUpdate'
      tags:
      - directorates
    patch:
      operationId: directorates_partial_update
      description: ''
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/DirectorateUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/DirectorateUpdate'
      tags:
      - directorates
    delete:
      operationId: directorates_delete
      description: ''
      parameters: []
      responses:
        '204':
          description: ''
      tags:
      - directorates
    parameters:
    - name: id
      in: path
      description: Stable UUID primary key for the directorate (non auto-increment).
      required: true
      type: string
      format: uuid
  /role-groups/:
    get:
      operationId: role-groups_list
      description: ''
      parameters:
      - name: page
        in: query
        description: A page number within the paginated result set.
        required: false
        type: integer
      - name: page_size
        in: query
        description: Number of results to return per page.
        required: false
        type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
            - count
            - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/RoleGroupList'
      tags:
      - role-groups
    post:
      operationId: role-groups_create
      description: ''
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/RoleGroupWrite'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/RoleGroupWrite'
      tags:
      - role-groups
    parameters: []
  /role-groups/{id}/:
    get:
      operationId: role-groups_read
      description: ''
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/RoleGroupDetail'
      tags:
      - role-groups
    put:
      operationId: role-groups_update
      description: ''
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/RoleGroupWrite'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/RoleGroupWrite'
      tags:
      - role-groups
    patch:
      operationId: role-groups_partial_update
      description: ''
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/RoleGroupWrite'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/RoleGroupWrite'
      tags:
      - role-groups
    delete:
      operationId: role-groups_delete
      description: ''
      parameters: []
      responses:
        '204':
          description: ''
      tags:
      - role-groups
    parameters:
    - name: id
      in: path
      required: true
      type: string
  /roles/:
    get:
      operationId: roles_list
      description: ''
      parameters:
      - name: page
        in: query
        description: A page number within the paginated result set.
        required: false
        type: integer
      - name: page_size
        in: query
        description: Number of results to return per page.
        required: false
        type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
            - count
            - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/RoleList'
      tags:
      - roles
    post:
      operationId: roles_create
      description: ''
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/RoleCreate'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/RoleCreate'
      tags:
      - roles
    parameters: []
  /roles/{id}/:
    get:
      operationId: roles_read
      description: ''
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/RoleDetail'
      tags:
      - roles
    put:
      operationId: roles_update
      description: ''
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/RoleUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/RoleUpdate'
      tags:
      - roles
    patch:
      operationId: roles_partial_update
      description: ''
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/RoleUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/RoleUpdate'
      tags:
      - roles
    delete:
      operationId: roles_delete
      description: ''
      parameters: []
      responses:
        '204':
          description: ''
      tags:
      - roles
    parameters:
    - name: id
      in: path
      required: true
      type: string
  /user-role-group-memberships/:
    get:
      operationId: user-role-group-memberships_list
      description: ''
      parameters:
      - name: search
        in: query
        description: A search term.
        required: false
        type: string
      - name: ordering
        in: query
        description: Which field to use when ordering the results.
        required: false
        type: string
      - name: page
        in: query
        description: A page number within the paginated result set.
        required: false
        type: integer
      - name: page_size
        in: query
        description: Number of results to return per page.
        required: false
        type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
            - count
            - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/UserRoleGroupMembershipBase'
      tags:
      - user-role-group-memberships
    post:
      operationId: user-role-group-memberships_create
      description: ''
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/UserRoleGroupMembershipCreate'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/UserRoleGroupMembershipCreate'
      tags:
      - user-role-group-memberships
    parameters: []
  /user-role-group-memberships/{id}/:
    get:
      operationId: user-role-group-memberships_read
      description: ''
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/UserRoleGroupMembershipBase'
      tags:
      - user-role-group-memberships
    put:
      operationId: user-role-group-memberships_update
      description: ''
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/UserRoleGroupMembershipUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/UserRoleGroupMembershipUpdate'
      tags:
      - user-role-group-memberships
    patch:
      operationId: user-role-group-memberships_partial_update
      description: ''
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/UserRoleGroupMembershipUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/UserRoleGroupMembershipUpdate'
      tags:
      - user-role-group-memberships
    delete:
      operationId: user-role-group-memberships_delete
      description: ''
      parameters: []
      responses:
        '204':
          description: ''
      tags:
      - user-role-group-memberships
    parameters:
    - name: id
      in: path
      required: true
      type: string
  /user-role-group-memberships/{id}/activate/:
    post:
      operationId: user-role-group-memberships_activate
      description: ''
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/UserRoleGroupMembershipBase'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/UserRoleGroupMembershipBase'
      tags:
      - user-role-group-memberships
    parameters:
    - name: id
      in: path
      required: true
      type: string
  /user-role-group-memberships/{id}/deactivate/:
    post:
      operationId: user-role-group-memberships_deactivate
      description: ''
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/UserRoleGroupMembershipBase'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/UserRoleGroupMembershipBase'
      tags:
      - user-role-group-memberships
    parameters:
    - name: id
      in: path
      required: true
      type: string
  /users/:
    get:
      operationId: users_list
      description: |-
        User management:
        - Full CRUD (DELETE performs a soft-delete via `archive()`).
        - Filtering, search, ordering.
        - Pagination via DefaultPageNumberPagination.
        - Extra actions: activate, archive, unarchive, set_password, lock, unlock,
          bulk_archive, bulk_unarchive; plus me, summary.
      parameters:
      - name: search
        in: query
        description: A search term.
        required: false
        type: string
      - name: ordering
        in: query
        description: Which field to use when ordering the results.
        required: false
        type: string
      - name: page
        in: query
        description: A page number within the paginated result set.
        required: false
        type: integer
      - name: page_size
        in: query
        description: Number of results to return per page.
        required: false
        type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
            - count
            - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/UserList'
      tags:
      - users
    post:
      operationId: users_create
      description: |-
        User management:
        - Full CRUD (DELETE performs a soft-delete via `archive()`).
        - Filtering, search, ordering.
        - Pagination via DefaultPageNumberPagination.
        - Extra actions: activate, archive, unarchive, set_password, lock, unlock,
          bulk_archive, bulk_unarchive; plus me, summary.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/UserCreate'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/UserCreate'
      tags:
      - users
    parameters: []
  /users/bulk-archive/:
    post:
      operationId: users_bulk_archive
      description: |-
        User management:
        - Full CRUD (DELETE performs a soft-delete via `archive()`).
        - Filtering, search, ordering.
        - Pagination via DefaultPageNumberPagination.
        - Extra actions: activate, archive, unarchive, set_password, lock, unlock,
          bulk_archive, bulk_unarchive; plus me, summary.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/UserDetail'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/UserDetail'
      tags:
      - users
    parameters: []
  /users/bulk-unarchive/:
    post:
      operationId: users_bulk_unarchive
      description: |-
        User management:
        - Full CRUD (DELETE performs a soft-delete via `archive()`).
        - Filtering, search, ordering.
        - Pagination via DefaultPageNumberPagination.
        - Extra actions: activate, archive, unarchive, set_password, lock, unlock,
          bulk_archive, bulk_unarchive; plus me, summary.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/UserDetail'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/UserDetail'
      tags:
      - users
    parameters: []
  /users/me/:
    get:
      operationId: users_me
      description: |-
        User management:
        - Full CRUD (DELETE performs a soft-delete via `archive()`).
        - Filtering, search, ordering.
        - Pagination via DefaultPageNumberPagination.
        - Extra actions: activate, archive, unarchive, set_password, lock, unlock,
          bulk_archive, bulk_unarchive; plus me, summary.
      parameters:
      - name: search
        in: query
        description: A search term.
        required: false
        type: string
      - name: ordering
        in: query
        description: Which field to use when ordering the results.
        required: false
        type: string
      - name: page
        in: query
        description: A page number within the paginated result set.
        required: false
        type: integer
      - name: page_size
        in: query
        description: Number of results to return per page.
        required: false
        type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
            - count
            - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/UserDetail'
      tags:
      - users
    parameters: []
  /users/summary/:
    get:
      operationId: users_summary
      description: |-
        User management:
        - Full CRUD (DELETE performs a soft-delete via `archive()`).
        - Filtering, search, ordering.
        - Pagination via DefaultPageNumberPagination.
        - Extra actions: activate, archive, unarchive, set_password, lock, unlock,
          bulk_archive, bulk_unarchive; plus me, summary.
      parameters:
      - name: search
        in: query
        description: A search term.
        required: false
        type: string
      - name: ordering
        in: query
        description: Which field to use when ordering the results.
        required: false
        type: string
      - name: page
        in: query
        description: A page number within the paginated result set.
        required: false
        type: integer
      - name: page_size
        in: query
        description: Number of results to return per page.
        required: false
        type: integer
      responses:
        '200':
          description: ''
          schema:
            required:
            - count
            - results
            type: object
            properties:
              count:
                type: integer
              next:
                type: string
                format: uri
                x-nullable: true
              previous:
                type: string
                format: uri
                x-nullable: true
              results:
                type: array
                items:
                  $ref: '#/definitions/UserDetail'
      tags:
      - users
    parameters: []
  /users/{id}/:
    get:
      operationId: users_read
      description: |-
        User management:
        - Full CRUD (DELETE performs a soft-delete via `archive()`).
        - Filtering, search, ordering.
        - Pagination via DefaultPageNumberPagination.
        - Extra actions: activate, archive, unarchive, set_password, lock, unlock,
          bulk_archive, bulk_unarchive; plus me, summary.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/UserDetail'
      tags:
      - users
    put:
      operationId: users_update
      description: |-
        User management:
        - Full CRUD (DELETE performs a soft-delete via `archive()`).
        - Filtering, search, ordering.
        - Pagination via DefaultPageNumberPagination.
        - Extra actions: activate, archive, unarchive, set_password, lock, unlock,
          bulk_archive, bulk_unarchive; plus me, summary.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/UserUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/UserUpdate'
      tags:
      - users
    patch:
      operationId: users_partial_update
      description: |-
        User management:
        - Full CRUD (DELETE performs a soft-delete via `archive()`).
        - Filtering, search, ordering.
        - Pagination via DefaultPageNumberPagination.
        - Extra actions: activate, archive, unarchive, set_password, lock, unlock,
          bulk_archive, bulk_unarchive; plus me, summary.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/UserUpdate'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/UserUpdate'
      tags:
      - users
    delete:
      operationId: users_delete
      description: |-
        User management:
        - Full CRUD (DELETE performs a soft-delete via `archive()`).
        - Filtering, search, ordering.
        - Pagination via DefaultPageNumberPagination.
        - Extra actions: activate, archive, unarchive, set_password, lock, unlock,
          bulk_archive, bulk_unarchive; plus me, summary.
      parameters: []
      responses:
        '204':
          description: ''
      tags:
      - users
    parameters:
    - name: id
      in: path
      required: true
      type: string
  /users/{id}/activate/:
    post:
      operationId: users_activate
      description: |-
        User management:
        - Full CRUD (DELETE performs a soft-delete via `archive()`).
        - Filtering, search, ordering.
        - Pagination via DefaultPageNumberPagination.
        - Extra actions: activate, archive, unarchive, set_password, lock, unlock,
          bulk_archive, bulk_unarchive; plus me, summary.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/UserDetail'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/UserDetail'
      tags:
      - users
    parameters:
    - name: id
      in: path
      required: true
      type: string
  /users/{id}/archive/:
    post:
      operationId: users_archive
      description: |-
        User management:
        - Full CRUD (DELETE performs a soft-delete via `archive()`).
        - Filtering, search, ordering.
        - Pagination via DefaultPageNumberPagination.
        - Extra actions: activate, archive, unarchive, set_password, lock, unlock,
          bulk_archive, bulk_unarchive; plus me, summary.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/UserDetail'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/UserDetail'
      tags:
      - users
    parameters:
    - name: id
      in: path
      required: true
      type: string
  /users/{id}/lock/:
    post:
      operationId: users_lock
      description: |-
        User management:
        - Full CRUD (DELETE performs a soft-delete via `archive()`).
        - Filtering, search, ordering.
        - Pagination via DefaultPageNumberPagination.
        - Extra actions: activate, archive, unarchive, set_password, lock, unlock,
          bulk_archive, bulk_unarchive; plus me, summary.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/UserDetail'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/UserDetail'
      tags:
      - users
    parameters:
    - name: id
      in: path
      required: true
      type: string
  /users/{id}/set-password/:
    post:
      operationId: users_set_password
      description: |-
        User management:
        - Full CRUD (DELETE performs a soft-delete via `archive()`).
        - Filtering, search, ordering.
        - Pagination via DefaultPageNumberPagination.
        - Extra actions: activate, archive, unarchive, set_password, lock, unlock,
          bulk_archive, bulk_unarchive; plus me, summary.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/UserDetail'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/UserDetail'
      tags:
      - users
    parameters:
    - name: id
      in: path
      required: true
      type: string
  /users/{id}/unarchive/:
    post:
      operationId: users_unarchive
      description: |-
        User management:
        - Full CRUD (DELETE performs a soft-delete via `archive()`).
        - Filtering, search, ordering.
        - Pagination via DefaultPageNumberPagination.
        - Extra actions: activate, archive, unarchive, set_password, lock, unlock,
          bulk_archive, bulk_unarchive; plus me, summary.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/UserDetail'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/UserDetail'
      tags:
      - users
    parameters:
    - name: id
      in: path
      required: true
      type: string
  /users/{id}/unlock/:
    post:
      operationId: users_unlock
      description: |-
        User management:
        - Full CRUD (DELETE performs a soft-delete via `archive()`).
        - Filtering, search, ordering.
        - Pagination via DefaultPageNumberPagination.
        - Extra actions: activate, archive, unarchive, set_password, lock, unlock,
          bulk_archive, bulk_unarchive; plus me, summary.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/UserDetail'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/UserDetail'
      tags:
      - users
    parameters:
    - name: id
      in: path
      required: true
      type: string
definitions:
  AccessListList:
    required:
    - first_name
    - last_name
    - email
    type: object
    properties:
      id:
        title: Id
        type: string
        format: uuid
        readOnly: true
      first_name:
        title: First name
        type: string
        maxLength: 50
        minLength: 1
      middle_name:
        title: Middle name
        type: string
        maxLength: 50
      last_name:
        title: Last name
        type: string
        maxLength: 50
        minLength: 1
      designation:
        title: Designation
        type: string
        maxLength: 120
      email:
        title: Email
        type: string
        format: email
        maxLength: 254
        minLength: 1
      phone:
        title: Phone
        type: string
        maxLength: 32
      directorate:
        title: Directorate
        type: string
        format: uuid
        x-nullable: true
      directorate_name:
        title: Directorate name
        type: string
        readOnly: true
        minLength: 1
      department:
        title: Department
        type: string
        format: uuid
        x-nullable: true
      department_name:
        title: Department name
        type: string
        readOnly: true
        minLength: 1
      region:
        title: Region
        type: string
        format: uuid
        x-nullable: true
      region_name:
        title: Region name
        type: string
        readOnly: true
        minLength: 1
      status:
        title: Status
        type: string
        enum:
        - UNVERIFIED
        - VERIFIED
        - REJECTED
      otp_expires_at:
        title: Otp expires at
        type: string
        format: date-time
        x-nullable: true
      verified_at:
        title: Verified at
        type: string
        format: date-time
        readOnly: true
        x-nullable: true
      rejected_at:
        title: Rejected at
        type: string
        format: date-time
        readOnly: true
        x-nullable: true
      is_promoted:
        title: Is promoted
        type: boolean
        readOnly: true
      created_at:
        title: Created at
        type: string
        format: date-time
        readOnly: true
  AccessListCreate:
    required:
    - first_name
    - last_name
    - email
    type: object
    properties:
      first_name:
        title: First name
        type: string
        maxLength: 50
        minLength: 1
      middle_name:
        title: Middle name
        type: string
        maxLength: 50
      last_name:
        title: Last name
        type: string
        maxLength: 50
        minLength: 1
      designation:
        title: Designation
        type: string
        maxLength: 120
      email:
        title: Email
        type: string
        format: email
        maxLength: 254
        minLength: 1
      phone:
        title: Phone
        type: string
        maxLength: 32
      personal_no:
        title: Personal no
        type: string
        maxLength: 50
        x-nullable: true
      national_id:
        title: National id
        type: string
        maxLength: 50
        x-nullable: true
      directorate:
        title: Directorate
        type: string
        format: uuid
        x-nullable: true
      department:
        title: Department
        type: string
        format: uuid
        x-nullable: true
      region:
        title: Region
        type: string
        format: uuid
        x-nullable: true
  AccessListDetail:
    required:
    - first_name
    - last_name
    - email
    type: object
    properties:
      id:
        title: Id
        type: string
        format: uuid
        readOnly: true
      first_name:
        title: First name
        type: string
        maxLength: 50
        minLength: 1
      middle_name:
        title: Middle name
        type: string
        maxLength: 50
      last_name:
        title: Last name
        type: string
        maxLength: 50
        minLength: 1
      designation:
        title: Designation
        type: string
        maxLength: 120
      email:
        title: Email
        type: string
        format: email
        maxLength: 254
        minLength: 1
      phone:
        title: Phone
        type: string
        maxLength: 32
      personal_no:
        title: Personal no
        type: string
        maxLength: 50
        x-nullable: true
      national_id:
        title: National id
        type: string
        maxLength: 50
        x-nullable: true
      directorate:
        title: Directorate
        type: string
        format: uuid
        x-nullable: true
      department:
        title: Department
        type: string
        format: uuid
        x-nullable: true
      region:
        title: Region
        type: string
        format: uuid
        x-nullable: true
      directorate_name:
        title: Directorate name
        type: string
        readOnly: true
        minLength: 1
      department_name:
        title: Department name
        type: string
        readOnly: true
        minLength: 1
      region_name:
        title: Region name
        type: string
        readOnly: true
        minLength: 1
      status:
        title: Status
        type: string
        enum:
        - UNVERIFIED
        - VERIFIED
        - REJECTED
      otp_hash:
        title: Otp hash
        type: string
        maxLength: 128
      otp_expires_at:
        title: Otp expires at
        type: string
        format: date-time
        x-nullable: true
      verified_at:
        title: Verified at
        type: string
        format: date-time
        readOnly: true
        x-nullable: true
      rejected_at:
        title: Rejected at
        type: string
        format: date-time
        readOnly: true
        x-nullable: true
      rejected_reason:
        title: Rejected reason
        type: string
      rejected_by:
        title: Rejected by
        type: string
        format: uuid
        readOnly: true
        x-nullable: true
      is_promoted:
        title: Is promoted
        type: boolean
        readOnly: true
      created_at:
        title: Created at
        type: string
        format: date-time
        readOnly: true
      updated_at:
        title: Updated at
        type: string
        format: date-time
        readOnly: true
  AccessListUpdate:
    required:
    - first_name
    - last_name
    type: object
    properties:
      first_name:
        title: First name
        type: string
        maxLength: 50
        minLength: 1
      middle_name:
        title: Middle name
        type: string
        maxLength: 50
      last_name:
        title: Last name
        type: string
        maxLength: 50
        minLength: 1
      designation:
        title: Designation
        type: string
        maxLength: 120
      phone:
        title: Phone
        type: string
        maxLength: 32
      personal_no:
        title: Personal no
        type: string
        maxLength: 50
        x-nullable: true
      national_id:
        title: National id
        type: string
        maxLength: 50
        x-nullable: true
      directorate:
        title: Directorate
        type: string
        format: uuid
        x-nullable: true
      department:
        title: Department
        type: string
        format: uuid
        x-nullable: true
      region:
        title: Region
        type: string
        format: uuid
        x-nullable: true
  DepartmentList:
    required:
    - name
    - directorate
    type: object
    properties:
      id:
        title: Id
        description: Stable UUID primary key for the department (non auto-increment).
        type: string
        format: uuid
        readOnly: true
      name:
        title: Name
        description: Department name (unique within its directorate).
        type: string
        maxLength: 150
        minLength: 1
      is_active:
        title: Is active
        description: Set to false to retire the department without deleting historical
          references.
        type: boolean
      directorate:
        title: Directorate
        description: The parent directorate under which this department falls.
        type: string
        format: uuid
      directorate_name:
        title: Directorate name
        type: string
        readOnly: true
        minLength: 1
      description:
        title: Description
        description: Optional description or notes about this department.
        type: string
        x-nullable: true
  DepartmentCreate:
    required:
    - name
    - directorate
    type: object
    properties:
      name:
        title: Name
        description: Department name (unique within its directorate).
        type: string
        maxLength: 150
        minLength: 1
      description:
        title: Description
        description: Optional description or notes about this department.
        type: string
        x-nullable: true
      is_active:
        title: Is active
        description: Set to false to retire the department without deleting historical
          references.
        type: boolean
      directorate:
        title: Directorate
        description: The parent directorate under which this department falls.
        type: string
        format: uuid
  DepartmentDetail:
    required:
    - name
    - directorate
    type: object
    properties:
      id:
        title: Id
        description: Stable UUID primary key for the department (non auto-increment).
        type: string
        format: uuid
        readOnly: true
      name:
        title: Name
        description: Department name (unique within its directorate).
        type: string
        maxLength: 150
        minLength: 1
      description:
        title: Description
        description: Optional description or notes about this department.
        type: string
        x-nullable: true
      is_active:
        title: Is active
        description: Set to false to retire the department without deleting historical
          references.
        type: boolean
      directorate:
        title: Directorate
        description: The parent directorate under which this department falls.
        type: string
        format: uuid
      directorate_name:
        title: Directorate name
        type: string
        readOnly: true
        minLength: 1
      created_at:
        title: Created at
        type: string
        format: date-time
        readOnly: true
      updated_at:
        title: Updated at
        type: string
        format: date-time
        readOnly: true
  DepartmentUpdate:
    required:
    - name
    - directorate
    type: object
    properties:
      name:
        title: Name
        description: Department name (unique within its directorate).
        type: string
        maxLength: 150
        minLength: 1
      description:
        title: Description
        description: Optional description or notes about this department.
        type: string
        x-nullable: true
      is_active:
        title: Is active
        description: Set to false to retire the department without deleting historical
          references.
        type: boolean
      directorate:
        title: Directorate
        description: The parent directorate under which this department falls.
        type: string
        format: uuid
  DirectorateList:
    required:
    - name
    type: object
    properties:
      id:
        title: Id
        description: Stable UUID primary key for the directorate (non auto-increment).
        type: string
        format: uuid
        readOnly: true
      name:
        title: Name
        description: Human-readable name of the directorate. Must be unique.
        type: string
        maxLength: 100
        minLength: 1
      description:
        title: Description
        description: Optional description or notes about this directorate.
        type: string
        x-nullable: true
      is_active:
        title: Is active
        description: Set to false to retire the directorate without deleting historical
          references.
        type: boolean
      created_at:
        title: Created at
        type: string
        format: date-time
        readOnly: true
      updated_at:
        title: Updated at
        type: string
        format: date-time
        readOnly: true
  DirectorateCreate:
    required:
    - name
    type: object
    properties:
      name:
        title: Name
        description: Human-readable name of the directorate. Must be unique.
        type: string
        maxLength: 100
        minLength: 1
      description:
        title: Description
        description: Optional description or notes about this directorate.
        type: string
        x-nullable: true
      is_active:
        title: Is active
        description: Set to false to retire the directorate without deleting historical
          references.
        type: boolean
  DirectorateDetail:
    required:
    - name
    type: object
    properties:
      id:
        title: Id
        description: Stable UUID primary key for the directorate (non auto-increment).
        type: string
        format: uuid
        readOnly: true
      name:
        title: Name
        description: Human-readable name of the directorate. Must be unique.
        type: string
        maxLength: 100
        minLength: 1
      description:
        title: Description
        description: Optional description or notes about this directorate.
        type: string
        x-nullable: true
      is_active:
        title: Is active
        description: Set to false to retire the directorate without deleting historical
          references.
        type: boolean
      created_at:
        title: Created at
        type: string
        format: date-time
        readOnly: true
      updated_at:
        title: Updated at
        type: string
        format: date-time
        readOnly: true
  DirectorateUpdate:
    required:
    - name
    type: object
    properties:
      name:
        title: Name
        description: Human-readable name of the directorate. Must be unique.
        type: string
        maxLength: 100
        minLength: 1
      description:
        title: Description
        description: Optional description or notes about this directorate.
        type: string
        x-nullable: true
      is_active:
        title: Is active
        description: Set to false to retire the directorate without deleting historical
          references.
        type: boolean
  RoleMini:
    type: object
    properties:
      id:
        title: Id
        description: Stable UUID primary key for the role.
        type: string
        format: uuid
        readOnly: true
      code:
        title: Code
        description: Stable, unique code for this role (e.g., 'APPROVER_L2').
        type: string
        readOnly: true
        minLength: 1
      name:
        title: Name
        description: Human-readable name of the role.
        type: string
        readOnly: true
        minLength: 1
      is_active:
        title: Is active
        description: Set false to retire the role without deleting historical data.
        type: boolean
        readOnly: true
  RoleGroupList:
    required:
    - code
    - name
    type: object
    properties:
      id:
        title: Id
        description: Stable UUID primary key for the role group.
        type: string
        format: uuid
        readOnly: true
      code:
        title: Code
        description: Stable, unique code for this group (e.g. 'FINANCE_CORE').
        type: string
        maxLength: 64
        minLength: 1
      name:
        title: Name
        description: Human-readable name of this role group.
        type: string
        maxLength: 120
        minLength: 1
      description:
        title: Description
        description: Optional description of this group's purpose/scope.
        type: string
      is_active:
        title: Is active
        description: Set false to retire the group without deleting it.
        type: boolean
      roles_count:
        title: Roles count
        type: integer
        readOnly: true
      roles:
        type: array
        items:
          $ref: '#/definitions/RoleMini'
        readOnly: true
      created_at:
        title: Created at
        type: string
        format: date-time
        readOnly: true
      updated_at:
        title: Updated at
        type: string
        format: date-time
        readOnly: true
  RoleGroupWrite:
    required:
    - code
    - name
    type: object
    properties:
      code:
        title: Code
        description: Stable, unique code for this group (e.g. 'FINANCE_CORE').
        type: string
        maxLength: 64
        minLength: 1
      name:
        title: Name
        description: Human-readable name of this role group.
        type: string
        maxLength: 120
        minLength: 1
      description:
        title: Description
        description: Optional description of this group's purpose/scope.
        type: string
      is_active:
        title: Is active
        description: Set false to retire the group without deleting it.
        type: boolean
      role_ids:
        type: array
        items:
          type: string
          format: uuid
        uniqueItems: true
  RoleGroupDetail:
    required:
    - code
    - name
    type: object
    properties:
      id:
        title: Id
        description: Stable UUID primary key for the role group.
        type: string
        format: uuid
        readOnly: true
      code:
        title: Code
        description: Stable, unique code for this group (e.g. 'FINANCE_CORE').
        type: string
        maxLength: 64
        minLength: 1
      name:
        title: Name
        description: Human-readable name of this role group.
        type: string
        maxLength: 120
        minLength: 1
      description:
        title: Description
        description: Optional description of this group's purpose/scope.
        type: string
      is_active:
        title: Is active
        description: Set false to retire the group without deleting it.
        type: boolean
      roles_count:
        title: Roles count
        type: integer
        readOnly: true
      roles:
        type: array
        items:
          $ref: '#/definitions/RoleMini'
        readOnly: true
      created_at:
        title: Created at
        type: string
        format: date-time
        readOnly: true
      updated_at:
        title: Updated at
        type: string
        format: date-time
        readOnly: true
  PermissionMini:
    type: object
    properties:
      id:
        title: ID
        type: integer
        readOnly: true
      codename:
        title: Codename
        type: string
        readOnly: true
        minLength: 1
      name:
        title: Name
        type: string
        readOnly: true
        minLength: 1
  RoleList:
    required:
    - code
    - name
    type: object
    properties:
      id:
        title: Id
        description: Stable UUID primary key for the role.
        type: string
        format: uuid
        readOnly: true
      code:
        title: Code
        description: Stable, unique code for this role (e.g., 'APPROVER_L2').
        type: string
        maxLength: 64
        minLength: 1
      name:
        title: Name
        description: Human-readable name of the role.
        type: string
        maxLength: 120
        minLength: 1
      description:
        title: Description
        description: Optional description/scope of the role.
        type: string
      is_active:
        title: Is active
        description: Set false to retire the role without deleting historical data.
        type: boolean
      permissions_count:
        title: Permissions count
        type: integer
        readOnly: true
      permissions:
        type: array
        items:
          $ref: '#/definitions/PermissionMini'
        readOnly: true
  RoleCreate:
    required:
    - code
    - name
    type: object
    properties:
      code:
        title: Code
        description: Stable, unique code for this role (e.g., 'APPROVER_L2').
        type: string
        maxLength: 64
        minLength: 1
      name:
        title: Name
        description: Human-readable name of the role.
        type: string
        maxLength: 120
        minLength: 1
      description:
        title: Description
        description: Optional description/scope of the role.
        type: string
      is_active:
        title: Is active
        description: Set false to retire the role without deleting historical data.
        type: boolean
      permission_ids:
        type: array
        items:
          type: integer
        uniqueItems: true
  RoleDetail:
    required:
    - code
    - name
    type: object
    properties:
      id:
        title: Id
        description: Stable UUID primary key for the role.
        type: string
        format: uuid
        readOnly: true
      code:
        title: Code
        description: Stable, unique code for this role (e.g., 'APPROVER_L2').
        type: string
        maxLength: 64
        minLength: 1
      name:
        title: Name
        description: Human-readable name of the role.
        type: string
        maxLength: 120
        minLength: 1
      description:
        title: Description
        description: Optional description/scope of the role.
        type: string
      is_active:
        title: Is active
        description: Set false to retire the role without deleting historical data.
        type: boolean
      permissions_count:
        title: Permissions count
        type: integer
        readOnly: true
      permissions:
        type: array
        items:
          $ref: '#/definitions/PermissionMini'
        readOnly: true
      created_at:
        title: Created at
        type: string
        format: date-time
        readOnly: true
      updated_at:
        title: Updated at
        type: string
        format: date-time
        readOnly: true
  RoleUpdate:
    required:
    - code
    - name
    type: object
    properties:
      code:
        title: Code
        description: Stable, unique code for this role (e.g., 'APPROVER_L2').
        type: string
        maxLength: 64
        minLength: 1
      name:
        title: Name
        description: Human-readable name of the role.
        type: string
        maxLength: 120
        minLength: 1
      description:
        title: Description
        description: Optional description/scope of the role.
        type: string
      is_active:
        title: Is active
        description: Set false to retire the role without deleting historical data.
        type: boolean
      permission_ids:
        type: array
        items:
          type: integer
        uniqueItems: true
  UserRoleGroupMembershipBase:
    required:
    - user
    - role_group
    type: object
    properties:
      id:
        title: Id
        description: Stable UUID primary key for this membership.
        type: string
        format: uuid
        readOnly: true
      user:
        title: User
        description: The user receiving the role group.
        type: string
        format: uuid
      role_group:
        title: Role group
        description: The assigned role group.
        type: string
        format: uuid
      valid_from:
        title: Valid from
        description: Optional start time from which this membership is effective.
        type: string
        format: date-time
        x-nullable: true
      valid_to:
        title: Valid to
        description: Optional end time after which this membership is no longer effective.
        type: string
        format: date-time
        x-nullable: true
      assigned_by:
        title: Assigned by
        description: Actor/admin identifier who assigned this membership.
        type: string
        maxLength: 120
        x-nullable: true
      reason:
        title: Reason
        description: Optional reason or ticket reference for the assignment.
        type: string
      is_active:
        title: Is active
        description: Set false to suspend this membership without deleting history.
        type: boolean
      username:
        title: Username
        type: string
        readOnly: true
      user_full_name:
        title: User full name
        type: string
        readOnly: true
      role_group_code:
        title: Role group code
        type: string
        readOnly: true
      role_group_name:
        title: Role group name
        type: string
        readOnly: true
      created_at:
        title: Created at
        type: string
        format: date-time
        readOnly: true
      updated_at:
        title: Updated at
        type: string
        format: date-time
        readOnly: true
  UserRoleGroupMembershipCreate:
    required:
    - user
    - role_group
    type: object
    properties:
      user:
        title: User
        description: The user receiving the role group.
        type: string
        format: uuid
      role_group:
        title: Role group
        description: The assigned role group.
        type: string
        format: uuid
      valid_from:
        title: Valid from
        description: Optional start time from which this membership is effective.
        type: string
        format: date-time
        x-nullable: true
      valid_to:
        title: Valid to
        description: Optional end time after which this membership is no longer effective.
        type: string
        format: date-time
        x-nullable: true
      reason:
        title: Reason
        description: Optional reason or ticket reference for the assignment.
        type: string
      is_active:
        title: Is active
        description: Set false to suspend this membership without deleting history.
        type: boolean
  UserRoleGroupMembershipUpdate:
    type: object
    properties:
      valid_from:
        title: Valid from
        description: Optional start time from which this membership is effective.
        type: string
        format: date-time
        x-nullable: true
      valid_to:
        title: Valid to
        description: Optional end time after which this membership is no longer effective.
        type: string
        format: date-time
        x-nullable: true
      reason:
        title: Reason
        description: Optional reason or ticket reference for the assignment.
        type: string
      is_active:
        title: Is active
        description: Set false to suspend this membership without deleting history.
        type: boolean
  UserList:
    required:
    - username
    - email
    - first_name
    - last_name
    type: object
    properties:
      id:
        title: Id
        type: string
        format: uuid
        readOnly: true
      username:
        title: Username
        type: string
        maxLength: 150
        minLength: 1
      email:
        title: Email
        type: string
        format: email
        maxLength: 254
        minLength: 1
      first_name:
        title: First name
        type: string
        maxLength: 50
        minLength: 1
      middle_name:
        title: Middle name
        type: string
        maxLength: 50
      last_name:
        title: Last name
        type: string
        maxLength: 50
        minLength: 1
      full_name:
        title: Full name
        type: string
        readOnly: true
        minLength: 1
      designation:
        title: Designation
        type: string
        maxLength: 120
        x-nullable: true
      directorate:
        title: Directorate
        type: string
        format: uuid
        x-nullable: true
      department:
        title: Department
        type: string
        format: uuid
        x-nullable: true
      region:
        title: Region
        type: string
        format: uuid
        x-nullable: true
      directorate_name:
        title: Directorate name
        type: string
        readOnly: true
      department_name:
        title: Department name
        type: string
        readOnly: true
      region_name:
        title: Region name
        type: string
        readOnly: true
      region_code:
        title: Region code
        type: string
        readOnly: true
      role_groups:
        title: Role groups
        type: string
        readOnly: true
      roles:
        title: Roles
        type: string
        readOnly: true
      role_groups_count:
        title: Role groups count
        type: string
        readOnly: true
      roles_count:
        title: Roles count
        type: string
        readOnly: true
      status:
        title: Status
        type: string
        enum:
        - PASSWORD_PENDING
        - ACTIVE
        - SUSPENDED
        - DEACTIVATED
      is_active:
        title: Is active
        type: boolean
      locked_until:
        title: Locked until
        type: string
        format: date-time
        x-nullable: true
      archived_at:
        title: Archived at
        type: string
        format: date-time
        readOnly: true
        x-nullable: true
  UserCreate:
    required:
    - username
    - email
    - first_name
    - last_name
    type: object
    properties:
      username:
        title: Username
        type: string
        maxLength: 150
        minLength: 1
      email:
        title: Email
        type: string
        format: email
        maxLength: 254
        minLength: 1
      password:
        title: Password
        type: string
      first_name:
        title: First name
        type: string
        maxLength: 50
        minLength: 1
      middle_name:
        title: Middle name
        type: string
        maxLength: 50
      last_name:
        title: Last name
        type: string
        maxLength: 50
        minLength: 1
      designation:
        title: Designation
        type: string
        maxLength: 120
        x-nullable: true
      personal_number:
        title: Personal number
        type: string
        maxLength: 50
        x-nullable: true
      national_id:
        title: National id
        type: string
        maxLength: 50
        x-nullable: true
      mobile_no:
        title: Mobile no
        type: string
        maxLength: 32
        x-nullable: true
      directorate:
        title: Directorate
        type: string
        format: uuid
        x-nullable: true
      department:
        title: Department
        type: string
        format: uuid
        x-nullable: true
      region:
        title: Region
        type: string
        format: uuid
        x-nullable: true
      status:
        title: Status
        type: string
        enum:
        - PASSWORD_PENDING
        - ACTIVE
        - SUSPENDED
        - DEACTIVATED
      is_active:
        title: Is active
        type: boolean
      is_staff:
        title: Is staff
        type: boolean
      email_confirmed:
        title: Email confirmed
        type: boolean
      phone_verified:
        title: Phone verified
        type: boolean
  UserDetail:
    required:
    - username
    - email
    - first_name
    - last_name
    type: object
    properties:
      id:
        title: Id
        type: string
        format: uuid
        readOnly: true
      username:
        title: Username
        type: string
        maxLength: 150
        minLength: 1
      email:
        title: Email
        type: string
        format: email
        maxLength: 254
        minLength: 1
      first_name:
        title: First name
        type: string
        maxLength: 50
        minLength: 1
      middle_name:
        title: Middle name
        type: string
        maxLength: 50
      last_name:
        title: Last name
        type: string
        maxLength: 50
        minLength: 1
      full_name:
        title: Full name
        type: string
        readOnly: true
        minLength: 1
      designation:
        title: Designation
        type: string
        maxLength: 120
        x-nullable: true
      personal_number:
        title: Personal number
        type: string
        maxLength: 50
        x-nullable: true
      national_id:
        title: National id
        type: string
        maxLength: 50
        x-nullable: true
      mobile_no:
        title: Mobile no
        type: string
        maxLength: 32
        x-nullable: true
      directorate:
        title: Directorate
        type: string
        format: uuid
        x-nullable: true
      department:
        title: Department
        type: string
        format: uuid
        x-nullable: true
      region:
        title: Region
        type: string
        format: uuid
        x-nullable: true
      directorate_name:
        title: Directorate name
        type: string
        readOnly: true
      department_name:
        title: Department name
        type: string
        readOnly: true
      region_name:
        title: Region name
        type: string
        readOnly: true
      region_code:
        title: Region code
        type: string
        readOnly: true
      role_groups:
        title: Role groups
        type: string
        readOnly: true
      roles:
        title: Roles
        type: string
        readOnly: true
      role_groups_count:
        title: Role groups count
        type: string
        readOnly: true
      roles_count:
        title: Roles count
        type: string
        readOnly: true
      status:
        title: Status
        type: string
        enum:
        - PASSWORD_PENDING
        - ACTIVE
        - SUSPENDED
        - DEACTIVATED
      email_confirmed:
        title: Email confirmed
        type: boolean
      phone_verified:
        title: Phone verified
        type: boolean
      is_active:
        title: Is active
        type: boolean
      is_staff:
        title: Is staff
        type: boolean
      password_set_at:
        title: Password set at
        type: string
        format: date-time
        readOnly: true
        x-nullable: true
      failed_login_attempts:
        title: Failed login attempts
        type: integer
        readOnly: true
      last_failed_login_at:
        title: Last failed login at
        type: string
        format: date-time
        readOnly: true
        x-nullable: true
      locked_until:
        title: Locked until
        type: string
        format: date-time
        x-nullable: true
      archived_at:
        title: Archived at
        type: string
        format: date-time
        readOnly: true
        x-nullable: true
      archived_by:
        title: Archived by
        description: Admin/staff who archived this account.
        type: string
        format: uuid
        readOnly: true
        x-nullable: true
      archived_reason:
        title: Archived reason
        type: string
      archived_by_username:
        title: Archived by username
        type: string
        readOnly: true
      archived_by_full_name:
        title: Archived by full name
        type: string
        readOnly: true
      created_at:
        title: Created at
        type: string
        format: date-time
        readOnly: true
      updated_at:
        title: Updated at
        type: string
        format: date-time
        readOnly: true
  UserUpdate:
    required:
    - email
    - first_name
    - last_name
    type: object
    properties:
      email:
        title: Email
        type: string
        format: email
        maxLength: 254
        minLength: 1
      first_name:
        title: First name
        type: string
        maxLength: 50
        minLength: 1
      middle_name:
        title: Middle name
        type: string
        maxLength: 50
      last_name:
        title: Last name
        type: string
        maxLength: 50
        minLength: 1
      designation:
        title: Designation
        type: string
        maxLength: 120
        x-nullable: true
      personal_number:
        title: Personal number
        type: string
        maxLength: 50
        x-nullable: true
      national_id:
        title: National id
        type: string
        maxLength: 50
        x-nullable: true
      mobile_no:
        title: Mobile no
        type: string
        maxLength: 32
        x-nullable: true
      directorate:
        title: Directorate
        type: string
        format: uuid
        x-nullable: true
      department:
        title: Department
        type: string
        format: uuid
        x-nullable: true
      region:
        title: Region
        type: string
        format: uuid
        x-nullable: true
      status:
        title: Status
        type: string
        enum:
        - PASSWORD_PENDING
        - ACTIVE
        - SUSPENDED
        - DEACTIVATED
      is_active:
        title: Is active
        type: boolean
      is_staff:
        title: Is staff
        type: boolean
      email_confirmed:
        title: Email confirmed
        type: boolean
      phone_verified:
        title: Phone verified
        type: boolean
