swagger: '2.0'
info:
  title: Configurations API
  description: |-
    Centralized configuration endpoints for system setup and global reference data.

    Includes:
    - Authorities (e.g., KeNHA, KURA, KeRRA)
    - Financial Years
    - Fund Types
    - Funding Sources
    - Item Activity Groups & Unit Costs
    - Regions
    - VAT and VAT History

    These endpoints provide standardized lookup tables and master configuration records that are referenced across all modules of the platform for consistency and integration.
  contact:
    email: eomoro@krb.go.ke
  license:
    name: BSD License
  version: v1
host: aprpms.devsgraphics.com
schemes:
- http
basePath: /api/config
consumes:
- application/json
produces:
- application/json
securityDefinitions:
  Basic:
    type: basic
security:
- Basic: []
paths:
  /authorities/:
    get:
      operationId: authorities_list
      description: |-
        Endpoints
        ---------
        GET    /api/config/authorities/                 list (filter/search/order supported)
        POST   /api/config/authorities/                 create (staff)
        GET    /api/config/authorities/{id}/            retrieve
        PATCH  /api/config/authorities/{id}/            partial update (staff)
        PUT    /api/config/authorities/{id}/            update (staff)

        POST   /api/config/authorities/{id}/activate/   activate (set is_active=True)
        POST   /api/config/authorities/{id}/deactivate/ deactivate (set is_active=False)
      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/Authority'
      tags:
      - authorities
    post:
      operationId: authorities_create
      description: |-
        Endpoints
        ---------
        GET    /api/config/authorities/                 list (filter/search/order supported)
        POST   /api/config/authorities/                 create (staff)
        GET    /api/config/authorities/{id}/            retrieve
        PATCH  /api/config/authorities/{id}/            partial update (staff)
        PUT    /api/config/authorities/{id}/            update (staff)

        POST   /api/config/authorities/{id}/activate/   activate (set is_active=True)
        POST   /api/config/authorities/{id}/deactivate/ deactivate (set is_active=False)
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/Authority'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/Authority'
      tags:
      - authorities
    parameters: []
  /authorities/{id}/:
    get:
      operationId: authorities_read
      description: |-
        Endpoints
        ---------
        GET    /api/config/authorities/                 list (filter/search/order supported)
        POST   /api/config/authorities/                 create (staff)
        GET    /api/config/authorities/{id}/            retrieve
        PATCH  /api/config/authorities/{id}/            partial update (staff)
        PUT    /api/config/authorities/{id}/            update (staff)

        POST   /api/config/authorities/{id}/activate/   activate (set is_active=True)
        POST   /api/config/authorities/{id}/deactivate/ deactivate (set is_active=False)
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Authority'
      tags:
      - authorities
    put:
      operationId: authorities_update
      description: |-
        Endpoints
        ---------
        GET    /api/config/authorities/                 list (filter/search/order supported)
        POST   /api/config/authorities/                 create (staff)
        GET    /api/config/authorities/{id}/            retrieve
        PATCH  /api/config/authorities/{id}/            partial update (staff)
        PUT    /api/config/authorities/{id}/            update (staff)

        POST   /api/config/authorities/{id}/activate/   activate (set is_active=True)
        POST   /api/config/authorities/{id}/deactivate/ deactivate (set is_active=False)
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/Authority'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Authority'
      tags:
      - authorities
    patch:
      operationId: authorities_partial_update
      description: |-
        Endpoints
        ---------
        GET    /api/config/authorities/                 list (filter/search/order supported)
        POST   /api/config/authorities/                 create (staff)
        GET    /api/config/authorities/{id}/            retrieve
        PATCH  /api/config/authorities/{id}/            partial update (staff)
        PUT    /api/config/authorities/{id}/            update (staff)

        POST   /api/config/authorities/{id}/activate/   activate (set is_active=True)
        POST   /api/config/authorities/{id}/deactivate/ deactivate (set is_active=False)
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/Authority'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Authority'
      tags:
      - authorities
    delete:
      operationId: authorities_delete
      description: |-
        Endpoints
        ---------
        GET    /api/config/authorities/                 list (filter/search/order supported)
        POST   /api/config/authorities/                 create (staff)
        GET    /api/config/authorities/{id}/            retrieve
        PATCH  /api/config/authorities/{id}/            partial update (staff)
        PUT    /api/config/authorities/{id}/            update (staff)

        POST   /api/config/authorities/{id}/activate/   activate (set is_active=True)
        POST   /api/config/authorities/{id}/deactivate/ deactivate (set is_active=False)
      parameters: []
      responses:
        '204':
          description: ''
      tags:
      - authorities
    parameters:
    - name: id
      in: path
      description: System-generated unique identifier.
      required: true
      type: string
      format: uuid
  /authorities/{id}/activate/:
    post:
      operationId: authorities_activate
      description: |-
        Endpoints
        ---------
        GET    /api/config/authorities/                 list (filter/search/order supported)
        POST   /api/config/authorities/                 create (staff)
        GET    /api/config/authorities/{id}/            retrieve
        PATCH  /api/config/authorities/{id}/            partial update (staff)
        PUT    /api/config/authorities/{id}/            update (staff)

        POST   /api/config/authorities/{id}/activate/   activate (set is_active=True)
        POST   /api/config/authorities/{id}/deactivate/ deactivate (set is_active=False)
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/Authority'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/Authority'
      tags:
      - authorities
    parameters:
    - name: id
      in: path
      description: System-generated unique identifier.
      required: true
      type: string
      format: uuid
  /authorities/{id}/deactivate/:
    post:
      operationId: authorities_deactivate
      description: |-
        Endpoints
        ---------
        GET    /api/config/authorities/                 list (filter/search/order supported)
        POST   /api/config/authorities/                 create (staff)
        GET    /api/config/authorities/{id}/            retrieve
        PATCH  /api/config/authorities/{id}/            partial update (staff)
        PUT    /api/config/authorities/{id}/            update (staff)

        POST   /api/config/authorities/{id}/activate/   activate (set is_active=True)
        POST   /api/config/authorities/{id}/deactivate/ deactivate (set is_active=False)
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/Authority'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/Authority'
      tags:
      - authorities
    parameters:
    - name: id
      in: path
      description: System-generated unique identifier.
      required: true
      type: string
      format: uuid
  /financial-years/:
    get:
      operationId: financial-years_list
      description: |-
        Endpoints
        ---------
        GET    /api/config/financial-years/                 list
        POST   /api/config/financial-years/                 create (staff)
        GET    /api/config/financial-years/{id}/            retrieve
        PATCH  /api/config/financial-years/{id}/            partial update (staff)
        PUT    /api/config/financial-years/{id}/            update (staff)

        POST   /api/config/financial-years/{id}/activate/   make this the single active FY
        POST   /api/config/financial-years/{id}/deactivate/ mark inactive
      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/FinancialYear'
      tags:
      - financial-years
    post:
      operationId: financial-years_create
      description: |-
        Endpoints
        ---------
        GET    /api/config/financial-years/                 list
        POST   /api/config/financial-years/                 create (staff)
        GET    /api/config/financial-years/{id}/            retrieve
        PATCH  /api/config/financial-years/{id}/            partial update (staff)
        PUT    /api/config/financial-years/{id}/            update (staff)

        POST   /api/config/financial-years/{id}/activate/   make this the single active FY
        POST   /api/config/financial-years/{id}/deactivate/ mark inactive
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/FinancialYear'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/FinancialYear'
      tags:
      - financial-years
    parameters: []
  /financial-years/{id}/:
    get:
      operationId: financial-years_read
      description: |-
        Endpoints
        ---------
        GET    /api/config/financial-years/                 list
        POST   /api/config/financial-years/                 create (staff)
        GET    /api/config/financial-years/{id}/            retrieve
        PATCH  /api/config/financial-years/{id}/            partial update (staff)
        PUT    /api/config/financial-years/{id}/            update (staff)

        POST   /api/config/financial-years/{id}/activate/   make this the single active FY
        POST   /api/config/financial-years/{id}/deactivate/ mark inactive
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/FinancialYear'
      tags:
      - financial-years
    put:
      operationId: financial-years_update
      description: |-
        Endpoints
        ---------
        GET    /api/config/financial-years/                 list
        POST   /api/config/financial-years/                 create (staff)
        GET    /api/config/financial-years/{id}/            retrieve
        PATCH  /api/config/financial-years/{id}/            partial update (staff)
        PUT    /api/config/financial-years/{id}/            update (staff)

        POST   /api/config/financial-years/{id}/activate/   make this the single active FY
        POST   /api/config/financial-years/{id}/deactivate/ mark inactive
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/FinancialYear'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/FinancialYear'
      tags:
      - financial-years
    patch:
      operationId: financial-years_partial_update
      description: |-
        Endpoints
        ---------
        GET    /api/config/financial-years/                 list
        POST   /api/config/financial-years/                 create (staff)
        GET    /api/config/financial-years/{id}/            retrieve
        PATCH  /api/config/financial-years/{id}/            partial update (staff)
        PUT    /api/config/financial-years/{id}/            update (staff)

        POST   /api/config/financial-years/{id}/activate/   make this the single active FY
        POST   /api/config/financial-years/{id}/deactivate/ mark inactive
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/FinancialYear'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/FinancialYear'
      tags:
      - financial-years
    delete:
      operationId: financial-years_delete
      description: |-
        Endpoints
        ---------
        GET    /api/config/financial-years/                 list
        POST   /api/config/financial-years/                 create (staff)
        GET    /api/config/financial-years/{id}/            retrieve
        PATCH  /api/config/financial-years/{id}/            partial update (staff)
        PUT    /api/config/financial-years/{id}/            update (staff)

        POST   /api/config/financial-years/{id}/activate/   make this the single active FY
        POST   /api/config/financial-years/{id}/deactivate/ mark inactive
      parameters: []
      responses:
        '204':
          description: ''
      tags:
      - financial-years
    parameters:
    - name: id
      in: path
      description: System-generated unique identifier.
      required: true
      type: string
      format: uuid
  /financial-years/{id}/activate/:
    post:
      operationId: financial-years_activate
      description: |-
        Endpoints
        ---------
        GET    /api/config/financial-years/                 list
        POST   /api/config/financial-years/                 create (staff)
        GET    /api/config/financial-years/{id}/            retrieve
        PATCH  /api/config/financial-years/{id}/            partial update (staff)
        PUT    /api/config/financial-years/{id}/            update (staff)

        POST   /api/config/financial-years/{id}/activate/   make this the single active FY
        POST   /api/config/financial-years/{id}/deactivate/ mark inactive
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/FinancialYear'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/FinancialYear'
      tags:
      - financial-years
    parameters:
    - name: id
      in: path
      description: System-generated unique identifier.
      required: true
      type: string
      format: uuid
  /financial-years/{id}/deactivate/:
    post:
      operationId: financial-years_deactivate
      description: |-
        Endpoints
        ---------
        GET    /api/config/financial-years/                 list
        POST   /api/config/financial-years/                 create (staff)
        GET    /api/config/financial-years/{id}/            retrieve
        PATCH  /api/config/financial-years/{id}/            partial update (staff)
        PUT    /api/config/financial-years/{id}/            update (staff)

        POST   /api/config/financial-years/{id}/activate/   make this the single active FY
        POST   /api/config/financial-years/{id}/deactivate/ mark inactive
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/FinancialYear'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/FinancialYear'
      tags:
      - financial-years
    parameters:
    - name: id
      in: path
      description: System-generated unique identifier.
      required: true
      type: string
      format: uuid
  /fund-types/:
    get:
      operationId: fund-types_list
      summary: CRUD + activation toggles for FundType.
      description: |-
        Endpoints
        ---------
        GET    /api/config/fund-types/                 list
        POST   /api/config/fund-types/                 create (staff)
        GET    /api/config/fund-types/{id}/            retrieve
        PATCH  /api/config/fund-types/{id}/            partial update (staff)
        PUT    /api/config/fund-types/{id}/            update (staff)

        POST   /api/config/fund-types/{id}/activate/   mark active (staff)
        POST   /api/config/fund-types/{id}/deactivate/ mark inactive (staff)
      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/FundType'
      tags:
      - fund-types
    post:
      operationId: fund-types_create
      summary: CRUD + activation toggles for FundType.
      description: |-
        Endpoints
        ---------
        GET    /api/config/fund-types/                 list
        POST   /api/config/fund-types/                 create (staff)
        GET    /api/config/fund-types/{id}/            retrieve
        PATCH  /api/config/fund-types/{id}/            partial update (staff)
        PUT    /api/config/fund-types/{id}/            update (staff)

        POST   /api/config/fund-types/{id}/activate/   mark active (staff)
        POST   /api/config/fund-types/{id}/deactivate/ mark inactive (staff)
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/FundType'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/FundType'
      tags:
      - fund-types
    parameters: []
  /fund-types/{id}/:
    get:
      operationId: fund-types_read
      summary: CRUD + activation toggles for FundType.
      description: |-
        Endpoints
        ---------
        GET    /api/config/fund-types/                 list
        POST   /api/config/fund-types/                 create (staff)
        GET    /api/config/fund-types/{id}/            retrieve
        PATCH  /api/config/fund-types/{id}/            partial update (staff)
        PUT    /api/config/fund-types/{id}/            update (staff)

        POST   /api/config/fund-types/{id}/activate/   mark active (staff)
        POST   /api/config/fund-types/{id}/deactivate/ mark inactive (staff)
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/FundType'
      tags:
      - fund-types
    put:
      operationId: fund-types_update
      summary: CRUD + activation toggles for FundType.
      description: |-
        Endpoints
        ---------
        GET    /api/config/fund-types/                 list
        POST   /api/config/fund-types/                 create (staff)
        GET    /api/config/fund-types/{id}/            retrieve
        PATCH  /api/config/fund-types/{id}/            partial update (staff)
        PUT    /api/config/fund-types/{id}/            update (staff)

        POST   /api/config/fund-types/{id}/activate/   mark active (staff)
        POST   /api/config/fund-types/{id}/deactivate/ mark inactive (staff)
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/FundType'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/FundType'
      tags:
      - fund-types
    patch:
      operationId: fund-types_partial_update
      summary: CRUD + activation toggles for FundType.
      description: |-
        Endpoints
        ---------
        GET    /api/config/fund-types/                 list
        POST   /api/config/fund-types/                 create (staff)
        GET    /api/config/fund-types/{id}/            retrieve
        PATCH  /api/config/fund-types/{id}/            partial update (staff)
        PUT    /api/config/fund-types/{id}/            update (staff)

        POST   /api/config/fund-types/{id}/activate/   mark active (staff)
        POST   /api/config/fund-types/{id}/deactivate/ mark inactive (staff)
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/FundType'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/FundType'
      tags:
      - fund-types
    delete:
      operationId: fund-types_delete
      summary: CRUD + activation toggles for FundType.
      description: |-
        Endpoints
        ---------
        GET    /api/config/fund-types/                 list
        POST   /api/config/fund-types/                 create (staff)
        GET    /api/config/fund-types/{id}/            retrieve
        PATCH  /api/config/fund-types/{id}/            partial update (staff)
        PUT    /api/config/fund-types/{id}/            update (staff)

        POST   /api/config/fund-types/{id}/activate/   mark active (staff)
        POST   /api/config/fund-types/{id}/deactivate/ mark inactive (staff)
      parameters: []
      responses:
        '204':
          description: ''
      tags:
      - fund-types
    parameters:
    - name: id
      in: path
      description: System-generated unique identifier.
      required: true
      type: string
      format: uuid
  /fund-types/{id}/activate/:
    post:
      operationId: fund-types_activate
      description: Mark this fund type as active.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/FundType'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/FundType'
      tags:
      - fund-types
    parameters:
    - name: id
      in: path
      description: System-generated unique identifier.
      required: true
      type: string
      format: uuid
  /fund-types/{id}/deactivate/:
    post:
      operationId: fund-types_deactivate
      description: Mark this fund type as inactive.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/FundType'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/FundType'
      tags:
      - fund-types
    parameters:
    - name: id
      in: path
      description: System-generated unique identifier.
      required: true
      type: string
      format: uuid
  /funding-sources/:
    get:
      operationId: funding-sources_list
      summary: CRUD + activation toggles for FundingSource.
      description: |-
        Endpoints
        ---------
        GET    /api/config/funding-sources/                 list
        POST   /api/config/funding-sources/                 create (staff)
        GET    /api/config/funding-sources/{id}/            retrieve
        PATCH  /api/config/funding-sources/{id}/            partial update (staff)
        PUT    /api/config/funding-sources/{id}/            update (staff)

        POST   /api/config/funding-sources/{id}/activate/   mark active (staff)
        POST   /api/config/funding-sources/{id}/deactivate/ mark inactive (staff)

        Notes
        -----
        - Global funding sources (is_global=True) ignore `authority`.
        - Non-global must have an `authority`. The serializer enforces the XOR rule;
          the model has a CheckConstraint for DB integrity.
        - Uniqueness is case-insensitive and scoped:
            * Global: code/name unique among globals.
            * Per-authority: code/name unique within that authority.
      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/FundingSource'
      tags:
      - funding-sources
    post:
      operationId: funding-sources_create
      summary: CRUD + activation toggles for FundingSource.
      description: |-
        Endpoints
        ---------
        GET    /api/config/funding-sources/                 list
        POST   /api/config/funding-sources/                 create (staff)
        GET    /api/config/funding-sources/{id}/            retrieve
        PATCH  /api/config/funding-sources/{id}/            partial update (staff)
        PUT    /api/config/funding-sources/{id}/            update (staff)

        POST   /api/config/funding-sources/{id}/activate/   mark active (staff)
        POST   /api/config/funding-sources/{id}/deactivate/ mark inactive (staff)

        Notes
        -----
        - Global funding sources (is_global=True) ignore `authority`.
        - Non-global must have an `authority`. The serializer enforces the XOR rule;
          the model has a CheckConstraint for DB integrity.
        - Uniqueness is case-insensitive and scoped:
            * Global: code/name unique among globals.
            * Per-authority: code/name unique within that authority.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/FundingSource'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/FundingSource'
      tags:
      - funding-sources
    parameters: []
  /funding-sources/{id}/:
    get:
      operationId: funding-sources_read
      summary: CRUD + activation toggles for FundingSource.
      description: |-
        Endpoints
        ---------
        GET    /api/config/funding-sources/                 list
        POST   /api/config/funding-sources/                 create (staff)
        GET    /api/config/funding-sources/{id}/            retrieve
        PATCH  /api/config/funding-sources/{id}/            partial update (staff)
        PUT    /api/config/funding-sources/{id}/            update (staff)

        POST   /api/config/funding-sources/{id}/activate/   mark active (staff)
        POST   /api/config/funding-sources/{id}/deactivate/ mark inactive (staff)

        Notes
        -----
        - Global funding sources (is_global=True) ignore `authority`.
        - Non-global must have an `authority`. The serializer enforces the XOR rule;
          the model has a CheckConstraint for DB integrity.
        - Uniqueness is case-insensitive and scoped:
            * Global: code/name unique among globals.
            * Per-authority: code/name unique within that authority.
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/FundingSource'
      tags:
      - funding-sources
    put:
      operationId: funding-sources_update
      summary: CRUD + activation toggles for FundingSource.
      description: |-
        Endpoints
        ---------
        GET    /api/config/funding-sources/                 list
        POST   /api/config/funding-sources/                 create (staff)
        GET    /api/config/funding-sources/{id}/            retrieve
        PATCH  /api/config/funding-sources/{id}/            partial update (staff)
        PUT    /api/config/funding-sources/{id}/            update (staff)

        POST   /api/config/funding-sources/{id}/activate/   mark active (staff)
        POST   /api/config/funding-sources/{id}/deactivate/ mark inactive (staff)

        Notes
        -----
        - Global funding sources (is_global=True) ignore `authority`.
        - Non-global must have an `authority`. The serializer enforces the XOR rule;
          the model has a CheckConstraint for DB integrity.
        - Uniqueness is case-insensitive and scoped:
            * Global: code/name unique among globals.
            * Per-authority: code/name unique within that authority.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/FundingSource'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/FundingSource'
      tags:
      - funding-sources
    patch:
      operationId: funding-sources_partial_update
      summary: CRUD + activation toggles for FundingSource.
      description: |-
        Endpoints
        ---------
        GET    /api/config/funding-sources/                 list
        POST   /api/config/funding-sources/                 create (staff)
        GET    /api/config/funding-sources/{id}/            retrieve
        PATCH  /api/config/funding-sources/{id}/            partial update (staff)
        PUT    /api/config/funding-sources/{id}/            update (staff)

        POST   /api/config/funding-sources/{id}/activate/   mark active (staff)
        POST   /api/config/funding-sources/{id}/deactivate/ mark inactive (staff)

        Notes
        -----
        - Global funding sources (is_global=True) ignore `authority`.
        - Non-global must have an `authority`. The serializer enforces the XOR rule;
          the model has a CheckConstraint for DB integrity.
        - Uniqueness is case-insensitive and scoped:
            * Global: code/name unique among globals.
            * Per-authority: code/name unique within that authority.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/FundingSource'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/FundingSource'
      tags:
      - funding-sources
    delete:
      operationId: funding-sources_delete
      summary: CRUD + activation toggles for FundingSource.
      description: |-
        Endpoints
        ---------
        GET    /api/config/funding-sources/                 list
        POST   /api/config/funding-sources/                 create (staff)
        GET    /api/config/funding-sources/{id}/            retrieve
        PATCH  /api/config/funding-sources/{id}/            partial update (staff)
        PUT    /api/config/funding-sources/{id}/            update (staff)

        POST   /api/config/funding-sources/{id}/activate/   mark active (staff)
        POST   /api/config/funding-sources/{id}/deactivate/ mark inactive (staff)

        Notes
        -----
        - Global funding sources (is_global=True) ignore `authority`.
        - Non-global must have an `authority`. The serializer enforces the XOR rule;
          the model has a CheckConstraint for DB integrity.
        - Uniqueness is case-insensitive and scoped:
            * Global: code/name unique among globals.
            * Per-authority: code/name unique within that authority.
      parameters: []
      responses:
        '204':
          description: ''
      tags:
      - funding-sources
    parameters:
    - name: id
      in: path
      description: System-generated unique identifier.
      required: true
      type: string
      format: uuid
  /funding-sources/{id}/activate/:
    post:
      operationId: funding-sources_activate
      description: |-
        Mark this funding source as active.
        Unlike FinancialYear, multiple FundingSources can be active at once.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/FundingSource'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/FundingSource'
      tags:
      - funding-sources
    parameters:
    - name: id
      in: path
      description: System-generated unique identifier.
      required: true
      type: string
      format: uuid
  /funding-sources/{id}/deactivate/:
    post:
      operationId: funding-sources_deactivate
      description: Mark this funding source as inactive.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/FundingSource'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/FundingSource'
      tags:
      - funding-sources
    parameters:
    - name: id
      in: path
      description: System-generated unique identifier.
      required: true
      type: string
      format: uuid
  /item-activity-groups/:
    get:
      operationId: item-activity-groups_list
      summary: CRUD for ItemActivityGroup.
      description: |-
        GET  /api/config/item-activity-groups/
        POST /api/config/item-activity-groups/   (staff)
        GET  /api/config/item-activity-groups/{id}/
        PATCH/PUT (staff)
      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/ItemActivityGroup'
      tags:
      - item-activity-groups
    post:
      operationId: item-activity-groups_create
      summary: CRUD for ItemActivityGroup.
      description: |-
        GET  /api/config/item-activity-groups/
        POST /api/config/item-activity-groups/   (staff)
        GET  /api/config/item-activity-groups/{id}/
        PATCH/PUT (staff)
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/ItemActivityGroup'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/ItemActivityGroup'
      tags:
      - item-activity-groups
    parameters: []
  /item-activity-groups/{id}/:
    get:
      operationId: item-activity-groups_read
      summary: CRUD for ItemActivityGroup.
      description: |-
        GET  /api/config/item-activity-groups/
        POST /api/config/item-activity-groups/   (staff)
        GET  /api/config/item-activity-groups/{id}/
        PATCH/PUT (staff)
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/ItemActivityGroup'
      tags:
      - item-activity-groups
    put:
      operationId: item-activity-groups_update
      summary: CRUD for ItemActivityGroup.
      description: |-
        GET  /api/config/item-activity-groups/
        POST /api/config/item-activity-groups/   (staff)
        GET  /api/config/item-activity-groups/{id}/
        PATCH/PUT (staff)
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/ItemActivityGroup'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/ItemActivityGroup'
      tags:
      - item-activity-groups
    patch:
      operationId: item-activity-groups_partial_update
      summary: CRUD for ItemActivityGroup.
      description: |-
        GET  /api/config/item-activity-groups/
        POST /api/config/item-activity-groups/   (staff)
        GET  /api/config/item-activity-groups/{id}/
        PATCH/PUT (staff)
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/ItemActivityGroup'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/ItemActivityGroup'
      tags:
      - item-activity-groups
    delete:
      operationId: item-activity-groups_delete
      summary: CRUD for ItemActivityGroup.
      description: |-
        GET  /api/config/item-activity-groups/
        POST /api/config/item-activity-groups/   (staff)
        GET  /api/config/item-activity-groups/{id}/
        PATCH/PUT (staff)
      parameters: []
      responses:
        '204':
          description: ''
      tags:
      - item-activity-groups
    parameters:
    - name: id
      in: path
      description: System-generated unique identifier.
      required: true
      type: string
      format: uuid
  /item-activity-unit-costs/:
    get:
      operationId: item-activity-unit-costs_list
      summary: CRUD endpoints for ItemActivityUnitCost.
      description: |-
        GET    /api/config/item-activity-unit-costs/
        POST   /api/config/item-activity-unit-costs/   (staff)
        GET    /api/config/item-activity-unit-costs/{id}/
        PATCH  /api/config/item-activity-unit-costs/{id}/
        PUT    /api/config/item-activity-unit-costs/{id}/
      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/ItemActivityUnitCost'
      tags:
      - item-activity-unit-costs
    post:
      operationId: item-activity-unit-costs_create
      summary: CRUD endpoints for ItemActivityUnitCost.
      description: |-
        GET    /api/config/item-activity-unit-costs/
        POST   /api/config/item-activity-unit-costs/   (staff)
        GET    /api/config/item-activity-unit-costs/{id}/
        PATCH  /api/config/item-activity-unit-costs/{id}/
        PUT    /api/config/item-activity-unit-costs/{id}/
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/ItemActivityUnitCost'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/ItemActivityUnitCost'
      tags:
      - item-activity-unit-costs
    parameters: []
  /item-activity-unit-costs/{id}/:
    get:
      operationId: item-activity-unit-costs_read
      summary: CRUD endpoints for ItemActivityUnitCost.
      description: |-
        GET    /api/config/item-activity-unit-costs/
        POST   /api/config/item-activity-unit-costs/   (staff)
        GET    /api/config/item-activity-unit-costs/{id}/
        PATCH  /api/config/item-activity-unit-costs/{id}/
        PUT    /api/config/item-activity-unit-costs/{id}/
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/ItemActivityUnitCost'
      tags:
      - item-activity-unit-costs
    put:
      operationId: item-activity-unit-costs_update
      summary: CRUD endpoints for ItemActivityUnitCost.
      description: |-
        GET    /api/config/item-activity-unit-costs/
        POST   /api/config/item-activity-unit-costs/   (staff)
        GET    /api/config/item-activity-unit-costs/{id}/
        PATCH  /api/config/item-activity-unit-costs/{id}/
        PUT    /api/config/item-activity-unit-costs/{id}/
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/ItemActivityUnitCost'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/ItemActivityUnitCost'
      tags:
      - item-activity-unit-costs
    patch:
      operationId: item-activity-unit-costs_partial_update
      summary: CRUD endpoints for ItemActivityUnitCost.
      description: |-
        GET    /api/config/item-activity-unit-costs/
        POST   /api/config/item-activity-unit-costs/   (staff)
        GET    /api/config/item-activity-unit-costs/{id}/
        PATCH  /api/config/item-activity-unit-costs/{id}/
        PUT    /api/config/item-activity-unit-costs/{id}/
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/ItemActivityUnitCost'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/ItemActivityUnitCost'
      tags:
      - item-activity-unit-costs
    delete:
      operationId: item-activity-unit-costs_delete
      summary: CRUD endpoints for ItemActivityUnitCost.
      description: |-
        GET    /api/config/item-activity-unit-costs/
        POST   /api/config/item-activity-unit-costs/   (staff)
        GET    /api/config/item-activity-unit-costs/{id}/
        PATCH  /api/config/item-activity-unit-costs/{id}/
        PUT    /api/config/item-activity-unit-costs/{id}/
      parameters: []
      responses:
        '204':
          description: ''
      tags:
      - item-activity-unit-costs
    parameters:
    - name: id
      in: path
      description: System-generated unique identifier.
      required: true
      type: string
      format: uuid
  /regions/:
    get:
      operationId: regions_list
      summary: CRUD for Region.
      description: |-
        GET    /api/config/regions/
        POST   /api/config/regions/        (staff)
        GET    /api/config/regions/{id}/
        PATCH  /api/config/regions/{id}/    (staff)
        PUT    /api/config/regions/{id}/    (staff)
        DELETE /api/config/regions/{id}/    (staff, if you allow deletes in BaseModel)
      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/Region'
      tags:
      - regions
    post:
      operationId: regions_create
      summary: CRUD for Region.
      description: |-
        GET    /api/config/regions/
        POST   /api/config/regions/        (staff)
        GET    /api/config/regions/{id}/
        PATCH  /api/config/regions/{id}/    (staff)
        PUT    /api/config/regions/{id}/    (staff)
        DELETE /api/config/regions/{id}/    (staff, if you allow deletes in BaseModel)
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/Region'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/Region'
      tags:
      - regions
    parameters: []
  /regions/{id}/:
    get:
      operationId: regions_read
      summary: CRUD for Region.
      description: |-
        GET    /api/config/regions/
        POST   /api/config/regions/        (staff)
        GET    /api/config/regions/{id}/
        PATCH  /api/config/regions/{id}/    (staff)
        PUT    /api/config/regions/{id}/    (staff)
        DELETE /api/config/regions/{id}/    (staff, if you allow deletes in BaseModel)
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Region'
      tags:
      - regions
    put:
      operationId: regions_update
      summary: CRUD for Region.
      description: |-
        GET    /api/config/regions/
        POST   /api/config/regions/        (staff)
        GET    /api/config/regions/{id}/
        PATCH  /api/config/regions/{id}/    (staff)
        PUT    /api/config/regions/{id}/    (staff)
        DELETE /api/config/regions/{id}/    (staff, if you allow deletes in BaseModel)
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/Region'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Region'
      tags:
      - regions
    patch:
      operationId: regions_partial_update
      summary: CRUD for Region.
      description: |-
        GET    /api/config/regions/
        POST   /api/config/regions/        (staff)
        GET    /api/config/regions/{id}/
        PATCH  /api/config/regions/{id}/    (staff)
        PUT    /api/config/regions/{id}/    (staff)
        DELETE /api/config/regions/{id}/    (staff, if you allow deletes in BaseModel)
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/Region'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/Region'
      tags:
      - regions
    delete:
      operationId: regions_delete
      summary: CRUD for Region.
      description: |-
        GET    /api/config/regions/
        POST   /api/config/regions/        (staff)
        GET    /api/config/regions/{id}/
        PATCH  /api/config/regions/{id}/    (staff)
        PUT    /api/config/regions/{id}/    (staff)
        DELETE /api/config/regions/{id}/    (staff, if you allow deletes in BaseModel)
      parameters: []
      responses:
        '204':
          description: ''
      tags:
      - regions
    parameters:
    - name: id
      in: path
      description: System-generated unique identifier.
      required: true
      type: string
      format: uuid
  /vat/:
    get:
      operationId: vat_list
      summary: Manage the singleton VAT record.
      description: |-
        Standard endpoints (rarely used directly since it's a singleton):
        GET    /api/config/vat/
        POST   /api/config/vat/           (staff; only if none exists)
        GET    /api/config/vat/{id}/
        PATCH  /api/config/vat/{id}/      (staff)
        PUT    /api/config/vat/{id}/      (staff)

        Convenience actions:
        GET    /api/config/vat/current/   → {"rate": 16.00, "id": "...", ...}
        POST   /api/config/vat/set-rate/  (staff; body: {"rate": 16.0})
        GET    /api/config/vat/history/   → list of VATHistory (most recent first)
      parameters:
      - 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/VAT'
      tags:
      - vat
    post:
      operationId: vat_create
      summary: Manage the singleton VAT record.
      description: |-
        Standard endpoints (rarely used directly since it's a singleton):
        GET    /api/config/vat/
        POST   /api/config/vat/           (staff; only if none exists)
        GET    /api/config/vat/{id}/
        PATCH  /api/config/vat/{id}/      (staff)
        PUT    /api/config/vat/{id}/      (staff)

        Convenience actions:
        GET    /api/config/vat/current/   → {"rate": 16.00, "id": "...", ...}
        POST   /api/config/vat/set-rate/  (staff; body: {"rate": 16.0})
        GET    /api/config/vat/history/   → list of VATHistory (most recent first)
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/VAT'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/VAT'
      tags:
      - vat
    parameters: []
  /vat/current/:
    get:
      operationId: vat_current
      description: Return the current (singleton) VAT object (or 204 if none).
      parameters:
      - 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/VAT'
      tags:
      - vat
    parameters: []
  /vat/history/:
    get:
      operationId: vat_history
      description: Return VAT change history in reverse chronological order.
      parameters:
      - 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/VAT'
      tags:
      - vat
    parameters: []
  /vat/set-rate/:
    post:
      operationId: vat_set_rate
      summary: Set (create/update) the VAT rate in one call.
      description: |-
        Request body:
        {
          "rate": 16.0
        }

        - Creates the singleton if it doesn't exist.
        - Updates it if it does; model.save() logs to VATHistory when rate changes.
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/VAT'
      responses:
        '201':
          description: ''
          schema:
            $ref: '#/definitions/VAT'
      tags:
      - vat
    parameters: []
  /vat/{id}/:
    get:
      operationId: vat_read
      summary: Manage the singleton VAT record.
      description: |-
        Standard endpoints (rarely used directly since it's a singleton):
        GET    /api/config/vat/
        POST   /api/config/vat/           (staff; only if none exists)
        GET    /api/config/vat/{id}/
        PATCH  /api/config/vat/{id}/      (staff)
        PUT    /api/config/vat/{id}/      (staff)

        Convenience actions:
        GET    /api/config/vat/current/   → {"rate": 16.00, "id": "...", ...}
        POST   /api/config/vat/set-rate/  (staff; body: {"rate": 16.0})
        GET    /api/config/vat/history/   → list of VATHistory (most recent first)
      parameters: []
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/VAT'
      tags:
      - vat
    put:
      operationId: vat_update
      summary: Manage the singleton VAT record.
      description: |-
        Standard endpoints (rarely used directly since it's a singleton):
        GET    /api/config/vat/
        POST   /api/config/vat/           (staff; only if none exists)
        GET    /api/config/vat/{id}/
        PATCH  /api/config/vat/{id}/      (staff)
        PUT    /api/config/vat/{id}/      (staff)

        Convenience actions:
        GET    /api/config/vat/current/   → {"rate": 16.00, "id": "...", ...}
        POST   /api/config/vat/set-rate/  (staff; body: {"rate": 16.0})
        GET    /api/config/vat/history/   → list of VATHistory (most recent first)
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/VAT'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/VAT'
      tags:
      - vat
    patch:
      operationId: vat_partial_update
      summary: Manage the singleton VAT record.
      description: |-
        Standard endpoints (rarely used directly since it's a singleton):
        GET    /api/config/vat/
        POST   /api/config/vat/           (staff; only if none exists)
        GET    /api/config/vat/{id}/
        PATCH  /api/config/vat/{id}/      (staff)
        PUT    /api/config/vat/{id}/      (staff)

        Convenience actions:
        GET    /api/config/vat/current/   → {"rate": 16.00, "id": "...", ...}
        POST   /api/config/vat/set-rate/  (staff; body: {"rate": 16.0})
        GET    /api/config/vat/history/   → list of VATHistory (most recent first)
      parameters:
      - name: data
        in: body
        required: true
        schema:
          $ref: '#/definitions/VAT'
      responses:
        '200':
          description: ''
          schema:
            $ref: '#/definitions/VAT'
      tags:
      - vat
    delete:
      operationId: vat_delete
      summary: Manage the singleton VAT record.
      description: |-
        Standard endpoints (rarely used directly since it's a singleton):
        GET    /api/config/vat/
        POST   /api/config/vat/           (staff; only if none exists)
        GET    /api/config/vat/{id}/
        PATCH  /api/config/vat/{id}/      (staff)
        PUT    /api/config/vat/{id}/      (staff)

        Convenience actions:
        GET    /api/config/vat/current/   → {"rate": 16.00, "id": "...", ...}
        POST   /api/config/vat/set-rate/  (staff; body: {"rate": 16.0})
        GET    /api/config/vat/history/   → list of VATHistory (most recent first)
      parameters: []
      responses:
        '204':
          description: ''
      tags:
      - vat
    parameters:
    - name: id
      in: path
      description: System-generated unique identifier.
      required: true
      type: string
      format: uuid
definitions:
  Authority:
    required:
    - code
    - name
    type: object
    properties:
      id:
        title: UID
        description: System-generated unique identifier.
        type: string
        format: uuid
        readOnly: true
      code:
        title: Authority Code
        description: Unique short code for the authority (e.g., KENHA, KURA).
        type: string
        pattern: ^[A-Za-z0-9_-]{2,15}$
        maxLength: 15
        minLength: 1
      name:
        title: Authority Name
        description: Full name of the authority (e.g., Kenya National Highways Authority).
        type: string
        maxLength: 100
        minLength: 1
      type:
        title: Type
        description: Optional classification type (integer, configurable).
        type: integer
        maximum: 2147483647
        minimum: -2147483648
        x-nullable: true
      number:
        title: Reference Number
        description: Optional registration/reference number for the authority.
        type: string
        x-nullable: true
      is_active:
        title: Is Active?
        description: Mark inactive instead of deleting to preserve history.
        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
      created_by:
        title: Created by
        type: string
        readOnly: true
        minLength: 1
        x-nullable: true
      updated_by:
        title: Updated by
        type: string
        readOnly: true
        minLength: 1
        x-nullable: true
  FinancialYear:
    required:
    - label
    - start_date
    - end_date
    type: object
    properties:
      id:
        title: UID
        description: System-generated unique identifier.
        type: string
        format: uuid
        readOnly: true
      label:
        title: Financial Year Label
        description: 'Format: YYYY-YY (e.g., 2018-19).'
        type: string
        pattern: ^\d{4}-\d{2}$
        maxLength: 7
        minLength: 1
      start_date:
        title: Start Date
        type: string
        format: date
      end_date:
        title: End Date
        type: string
        format: date
      description:
        title: Description
        type: string
      is_active:
        title: Is Active?
        description: Only one financial year can be active at a time.
        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
      created_by:
        title: Created by
        type: string
        readOnly: true
        minLength: 1
        x-nullable: true
      updated_by:
        title: Updated by
        type: string
        readOnly: true
        minLength: 1
        x-nullable: true
  FundType:
    required:
    - code
    - name
    type: object
    properties:
      id:
        title: UID
        description: System-generated unique identifier.
        type: string
        format: uuid
        readOnly: true
      code:
        title: Fund Type Code
        description: Unique short code for the fund type.
        type: string
        maxLength: 15
        minLength: 1
      name:
        title: Fund Type Name
        description: Readable name of the fund type.
        type: string
        maxLength: 70
        minLength: 1
      is_active:
        title: Is Active?
        description: Mark inactive instead of deleting to preserve history.
        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
      created_by:
        title: Created by
        type: string
        readOnly: true
        minLength: 1
        x-nullable: true
      updated_by:
        title: Updated by
        type: string
        readOnly: true
        minLength: 1
        x-nullable: true
  FundingSource:
    required:
    - code
    - name
    - shortname
    type: object
    properties:
      id:
        title: UID
        description: System-generated unique identifier.
        type: string
        format: uuid
        readOnly: true
      authority:
        title: Authority
        description: Authority this source belongs to. Leave blank if global.
        type: string
        format: uuid
        x-nullable: true
      fund_type:
        title: Fund Type
        description: Fund type category this funding source belongs to.
        type: string
        format: uuid
        x-nullable: true
      is_global:
        title: Is Global?
        description: If true, this funding source applies to all authorities.
        type: boolean
      is_active:
        title: Is Active?
        description: Mark inactive instead of deleting to preserve history.
        type: boolean
      code:
        title: Funding Source Code
        description: Unique code for this funding source.
        type: string
        maxLength: 70
        minLength: 1
      name:
        title: Funding Source Name
        description: Full name of the funding source.
        type: string
        maxLength: 100
        minLength: 1
      shortname:
        title: Short Name
        description: Short name or abbreviation of the funding source.
        type: string
        maxLength: 100
        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
      created_by:
        title: Created by
        type: string
        readOnly: true
        minLength: 1
        x-nullable: true
      updated_by:
        title: Updated by
        type: string
        readOnly: true
        minLength: 1
        x-nullable: true
  ItemActivityGroup:
    required:
    - bill_number
    type: object
    properties:
      id:
        title: UID
        description: System-generated unique identifier.
        type: string
        format: uuid
        readOnly: true
      bill_number:
        title: Bill Number
        description: Short bill number (e.g., 01, 1A, etc.).
        type: string
        maxLength: 10
        minLength: 1
      description:
        title: Description
        description: Description of the item activity group.
        type: string
      created_at:
        title: Created at
        type: string
        format: date-time
        readOnly: true
      updated_at:
        title: Updated at
        type: string
        format: date-time
        readOnly: true
      created_by:
        title: Created by
        type: string
        readOnly: true
        minLength: 1
        x-nullable: true
      updated_by:
        title: Updated by
        type: string
        readOnly: true
        minLength: 1
        x-nullable: true
  ItemActivityUnitCost:
    required:
    - group
    - planned_cost
    type: object
    properties:
      id:
        title: UID
        description: System-generated unique identifier.
        type: string
        format: uuid
        readOnly: true
      group:
        title: Item Activity Group
        description: Group this unit cost belongs to.
        type: string
        format: uuid
      item_code:
        title: Item Code
        description: Optional code for the item.
        type: string
        maxLength: 50
        x-nullable: true
      sub_item_code:
        title: Sub Item Code
        description: Optional code for the sub item.
        type: string
        maxLength: 50
        x-nullable: true
      sub_sub_item_code:
        title: Sub Sub Item Code
        description: Optional code for the sub-sub item.
        type: string
        maxLength: 50
        x-nullable: true
      description:
        title: Description
        description: Detailed description of the unit cost item.
        type: string
        x-nullable: true
      overhead_routine_improvement:
        title: Overhead Routine Improvement
        description: Optional field for overhead routine improvements.
        type: string
        x-nullable: true
      unit_code:
        title: Unit Code
        description: Unit code (e.g., KM, M2).
        type: string
        maxLength: 50
        x-nullable: true
      unit_measure:
        title: Unit Measure
        description: Short unit of measure (e.g., m, km, hr).
        type: string
        maxLength: 50
        x-nullable: true
      unit_description:
        title: Unit Description
        description: Full unit description.
        type: string
        x-nullable: true
      planned_cost:
        title: Planned Cost
        description: Planned cost for this unit item.
        type: string
        format: decimal
      created_at:
        title: Created at
        type: string
        format: date-time
        readOnly: true
      updated_at:
        title: Updated at
        type: string
        format: date-time
        readOnly: true
      created_by:
        title: Created by
        type: string
        readOnly: true
        minLength: 1
        x-nullable: true
      updated_by:
        title: Updated by
        type: string
        readOnly: true
        minLength: 1
        x-nullable: true
  Region:
    required:
    - code
    - name
    type: object
    properties:
      id:
        title: UID
        description: System-generated unique identifier.
        type: string
        format: uuid
        readOnly: true
      code:
        title: Region Code
        description: Unique short code, uppercase A–Z/0–9 (e.g., RVF).
        type: string
        pattern: ^[A-Z0-9]{2,10}$
        maxLength: 10
        minLength: 1
      name:
        title: Region Name
        description: Full name of the region, e.g. Rift Valley.
        type: string
        maxLength: 100
        minLength: 1
      description:
        title: Description
        type: string
      created_at:
        title: Created at
        type: string
        format: date-time
        readOnly: true
      updated_at:
        title: Updated at
        type: string
        format: date-time
        readOnly: true
      created_by:
        title: Created by
        type: string
        readOnly: true
        minLength: 1
        x-nullable: true
      updated_by:
        title: Updated by
        type: string
        readOnly: true
        minLength: 1
        x-nullable: true
  VAT:
    required:
    - rate
    type: object
    properties:
      id:
        title: UID
        description: System-generated unique identifier.
        type: string
        format: uuid
        readOnly: true
      rate:
        title: VAT Rate (%)
        description: VAT percentage (e.g., 16.00 for 16%).
        type: string
        format: decimal
      created_at:
        title: Created at
        type: string
        format: date-time
        readOnly: true
      updated_at:
        title: Updated at
        type: string
        format: date-time
        readOnly: true
      created_by:
        title: Created by
        type: string
        readOnly: true
        minLength: 1
        x-nullable: true
      updated_by:
        title: Updated by
        type: string
        readOnly: true
        minLength: 1
        x-nullable: true
