From f6ba3392761cba2c49cc6a38b08712d7a665eb43 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Thu, 7 May 2026 18:42:43 -0400 Subject: [PATCH] Add archive_content fields and docs --- app/models/archive_content_models.py | 3 ++ app/object_definitions/other.py | 30 +++++++++---------- .../ARCH__V3_DEVELOPMENT_STANDARDS.md | 11 +++++++ 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/app/models/archive_content_models.py b/app/models/archive_content_models.py index 4fd26bd..864b7b3 100644 --- a/app/models/archive_content_models.py +++ b/app/models/archive_content_models.py @@ -36,6 +36,9 @@ class Archive_Content_Base(BaseModel): lu_media_type_id: Optional[int] lu_media_type: Optional[str] + external_id: Optional[str] + code: Optional[str] + name: Optional[str] description: Optional[str] diff --git a/app/object_definitions/other.py b/app/object_definitions/other.py index 5e0dfde..578b044 100644 --- a/app/object_definitions/other.py +++ b/app/object_definitions/other.py @@ -33,8 +33,8 @@ other_obj_li = { ], # V3 Search Security: 'searchable_fields': [ - 'id', 'account_id', 'id_random', 'sponsorship_id_random', 'account_id_random', - 'name', 'description', 'website_url', 'level_str', 'enable', 'hide', + 'id', 'account_id', 'id_random', 'sponsorship_id_random', 'account_id_random', + 'name', 'description', 'website_url', 'level_str', 'enable', 'hide', 'priority', 'group', 'created_on', 'updated_on' ], }, @@ -50,8 +50,8 @@ other_obj_li = { 'base_name': Sponsorship_Cfg_Base, # V3 Search Security: 'searchable_fields': [ - 'id', 'account_id', 'id_random', 'sponsorship_cfg_id_random', 'account_id_random', - 'name', 'description', 'enable', 'hide', 'priority', 'sort', 'group', + 'id', 'account_id', 'id_random', 'sponsorship_cfg_id_random', 'account_id_random', + 'name', 'description', 'enable', 'hide', 'priority', 'sort', 'group', 'notes', 'created_on', 'updated_on' ], }, @@ -86,9 +86,9 @@ other_obj_li = { ], # V3 Search Security: 'searchable_fields': [ - 'id', 'account_id', 'id_random', 'archive_id_random', 'account_id_random', - 'archive_type_id_random', 'archive_type', 'name', 'description', - 'filename', 'original_location', 'enable', 'hide', 'priority', + 'id', 'account_id', 'id_random', 'archive_id_random', 'account_id_random', + 'archive_type_id_random', 'archive_type', 'name', 'description', + 'filename', 'original_location', 'enable', 'hide', 'priority', 'sort', 'group', 'notes', 'created_on', 'updated_on' ], }, @@ -108,7 +108,7 @@ other_obj_li = { 'searchable_fields': [ 'id', 'account_id', 'archive_id', 'hosted_file_id', 'id_random', 'archive_content_id_random', 'account_id_random', 'archive_id_random', - 'archive_content_type', 'lu_media_type', 'name', 'description', + 'archive_content_type', 'lu_media_type', 'external_id', 'code', 'name', 'description', 'filename', 'file_extension', 'original_location', 'original_url', 'enable', 'hide', 'priority', 'sort', 'group', 'notes', 'created_on', 'updated_on' ], @@ -137,9 +137,9 @@ other_obj_li = { ], # V3 Search Security: 'searchable_fields': [ - 'id', 'account_id', 'id_random', 'hosted_file_id_random', 'account_id_random', - 'hash_sha256', 'title', 'description', 'filename', 'extension', - 'content_type', 'enable', 'hide', 'priority', 'sort', 'group', + 'id', 'account_id', 'id_random', 'hosted_file_id_random', 'account_id_random', + 'hash_sha256', 'title', 'description', 'filename', 'extension', + 'content_type', 'enable', 'hide', 'priority', 'sort', 'group', 'notes', 'created_on', 'updated_on' ], }, @@ -157,8 +157,8 @@ other_obj_li = { 'base_name': Hosted_File_Link_Base, # V3 Search Security: 'searchable_fields': [ - 'id', 'account_id', 'hosted_file_id', 'id_random', 'account_id_random', - 'hosted_file_id_random', 'link_to_type', 'link_to_id_random', + 'id', 'account_id', 'hosted_file_id', 'id_random', 'account_id_random', + 'hosted_file_id_random', 'link_to_type', 'link_to_id_random', 'created_on', 'updated_on' ], }, @@ -226,8 +226,8 @@ other_obj_li = { 'base_name': Grant_Base, # V3 Search Security: 'searchable_fields': [ - 'id', 'account_id', 'id_random', 'grant_id_random', 'account_id_random', - 'code', 'name', 'description', 'enable', 'hide', 'priority', 'sort', + 'id', 'account_id', 'id_random', 'grant_id_random', 'account_id_random', + 'code', 'name', 'description', 'enable', 'hide', 'priority', 'sort', 'group', 'notes', 'created_on', 'updated_on' ], }, diff --git a/documentation/ARCH__V3_DEVELOPMENT_STANDARDS.md b/documentation/ARCH__V3_DEVELOPMENT_STANDARDS.md index f400722..73d58b3 100644 --- a/documentation/ARCH__V3_DEVELOPMENT_STANDARDS.md +++ b/documentation/ARCH__V3_DEVELOPMENT_STANDARDS.md @@ -37,6 +37,17 @@ Finalized Jan 15, 2026, to ensure boot stability. - **POST Based**: Complex filtering is handled via `POST /search` with a JSON body containing `and`, `or`, and `not` logic. - **Hybrid Filtering**: (Proposed) Query parameters should append simple standard filters (e.g., `?enabled=true`) to the complex body logic. +### Field Evolution Checklist +When a table or view gains, loses, or renames fields, keep the API contract and search registry in sync: + +1. Update the Pydantic model in `app/models/` first so CRUD serialization matches the new shape. +2. Update the SQL view or table projection so `GET` and `SEARCH` responses actually return the field. +3. Update `searchable_fields` in `app/object_definitions/` only for fields that should be searchable. +4. Add write-only, virtual, or view-only fields to `fields_to_exclude_from_db` when they must not be persisted. +5. Run the schema/search E2E tests that cover the object type before handing the change off. + +For `archive_content`, the public field set now includes `external_id` and `code`, and future additions should follow the same order of operations. + ### Response Views (Proposed) - Implement a `view` parameter (e.g., `?view=rich`) to allow clients to request joined data without using legacy `use_alt_tbl` flags.