Add support for archived departments with schema updates, API integration, and filtering logic
- Added `archived` column and index to `departments` table, ensuring schema initialization via `departments_schema_bootstrap`. - Updated OpenAPI spec to include `archived` attribute and `filters=archived` query parameter with superuser access control. - Enhanced `Departments` API to support archived department filtering and retrieval. - Modified `ApiFixtures`, `departments_o`, and related tests to validate behavior for archived departments. - Added unit and API tests to ensure correct handling of archived departments and filter enforceability.
This commit is contained in:
+12
-1
@@ -3395,7 +3395,7 @@ paths:
|
||||
tags:
|
||||
- Departments
|
||||
summary: List departments
|
||||
description: Retrieve a list of all visible departments
|
||||
description: Retrieve visible, active departments by default. Superuser department access may filter archived departments with `filters=archived:1`.
|
||||
operationId: listDepartments
|
||||
parameters:
|
||||
- name: id
|
||||
@@ -3406,6 +3406,11 @@ paths:
|
||||
- $ref: '#/components/parameters/PageParam'
|
||||
- $ref: '#/components/parameters/PerPageParam'
|
||||
- $ref: '#/components/parameters/SearchParam'
|
||||
- name: filters
|
||||
in: query
|
||||
schema:
|
||||
type: string
|
||||
description: Comma-separated field filters. `archived:1` is only honored for users with superuser department access.
|
||||
responses:
|
||||
'200':
|
||||
description: Departments retrieved successfully
|
||||
@@ -15607,6 +15612,8 @@ components:
|
||||
type: integer
|
||||
visible:
|
||||
type: boolean
|
||||
archived:
|
||||
type: boolean
|
||||
dimension:
|
||||
type: integer
|
||||
branding:
|
||||
@@ -15677,6 +15684,8 @@ components:
|
||||
type: integer
|
||||
visible:
|
||||
type: boolean
|
||||
archived:
|
||||
type: boolean
|
||||
longitude:
|
||||
type: number
|
||||
format: float
|
||||
@@ -15697,6 +15706,8 @@ components:
|
||||
type: string
|
||||
visible:
|
||||
type: boolean
|
||||
archived:
|
||||
type: boolean
|
||||
longitude:
|
||||
type: number
|
||||
format: float
|
||||
|
||||
Reference in New Issue
Block a user