Migrate Bulletin Board (Posts) to V3 and finish IDAA V3 migration

- Migrated Post and Post Comment modules to Aether API CRUD V3
- Added editable_fields for Posts and Post Comments
- Implemented local filtering for 'archive_on' in BB route as V3 workaround
- Verified IDAA Archives and Recovery Meetings are functional on V3
- Ensured all IDAA logic follows the API -> Processor -> DB Save pattern
This commit is contained in:
Scott Idem
2026-01-06 17:47:17 -05:00
parent bfa1943889
commit 43d32f2e3e
7 changed files with 295 additions and 883 deletions

View File

@@ -223,23 +223,26 @@ The activity logging functionality is now working as expected. While the origina
- **Search Logic Construction:** When building complex V3 `search_query` objects, avoid including empty `and` or `or` arrays, as some backend parsers may strictly validate their presence or content. Only attach these properties if they contain at least one filter.
- **Backend Operator Support:** Always verify supported operators (`like`, `eq`, `gt`, etc.) in the backend FastAPI implementation. Using unsupported operators like `ilike` or `contains` will cause immediate backend `ValueError` crashes.
### Session Learnings (2026-01-06 - Evening)
### Session Learnings (2026-01-06 - Night)
**Context:** Restructured core management into linkable routes, implemented User linking, and built the User Detail page.
**Context:** Fixed critical IDAA loading issues, optimized API retry logic, and continued V3 migration for IDAA modules.
**Key Accomplishments:**
- **Route Restructuring:** Renamed `/core/person` to `/core/people` and ensured all management sub-pages are directly linkable standard `<a>` tags.
- **Common Layout Navigation:** Implemented a unified `<nav>` menu in `src/routes/core/+layout.svelte` for quick switching between core modules.
- **User Linking Logic:** Added functionality to the Person detail page to browse unlinked User accounts and establish/break links between `Person` and `User` records.
- **User Detail Page:** Built `/core/users/[user_id]` with full permission management (Super, Manager, Admin toggles) and account status controls.
- **Bug Fixes:** Resolved 500 errors related to broken import paths after directory renaming and refined layout data requirements.
- **IDAA Recovery Meetings Fix:** Resolved a 400 Bad Request error by removing the restricted `conference` field from the V3 search query and implementing local filtering as a temporary frontend workaround.
- **API Retry Optimization:** Updated `post_object` in `api_post_object.ts` to immediately stop retrying on 4xx client-side errors, improving responsiveness and reducing unnecessary network overhead.
- **IDAA V3 Migration:**
- Migrated **Archives** and **Archive Content** modules to V3 CRUD.
- Migrated **Events** (used by Recovery Meetings) to V3 CRUD.
- Created `editable_fields` definitions for Archives and Archive Content.
- **Core Placeholders:** Built logic and UI placeholders for **Addresses** and **Contacts** at `/core/addresses` and `/core/contacts`.
- **Navigation Update:** Integrated the new Address and Contact management routes into the core layout navigation.
**Key Learnings:**
- **Svelte 5 & Dexie Reactivity:** Using `$derived` with `liveQuery` (e.g., `$derived(liveQuery(() => db.table.bulkGet(ids)))`) is the correct way to maintain a reactive list of objects in Svelte 5 when the ID list is dynamic.
- **Standard Links vs goto():** Favoring standard `<a>` tags over programmatic navigation with `goto()` is essential for power-user features like "Open in New Tab" and copying links, especially in management interfaces.
- **Manager Access Pattern:** Standardized on `if (!$ae_loc.manager_access) { goto('/core'); }` for protecting sensitive management routes on the frontend.
- **API Health Monitoring:** Learned to use `curl -s https://dev-api.oneskyit.com/v3/crud/health` for direct backend health checks, bypassing frontend complexity during diagnosis.
- **Client Error Handling:** It is critical to differentiate between network failures (worth retrying) and client errors (400, 403) which indicate fundamental request issues.
- **Nested CRUD Pattern:** Successfully applied the `create_nested_obj_v3` and `delete_nested_ae_obj_v3` patterns to the Event Badge and Archive Content modules.
**Next Steps:**
- **Person Detail Improvement:** Implement a dedicated edit form for Person records (currently using inline CRUD).
- **Lookup Refinement:** Add specific detail views or search for lookups if necessary.
- **Addresses & Contacts:** Begin scaffolding UI for these core objects.
- **Bulletin Board (Posts):** Migrate `ae_posts` to V3 CRUD.
- **Person Activity UI:** Finalize the "Linked Activity & Content" section in the Person detail view to show real related data.
- **Address/Contact Details:** Build out the detail pages for these new modules.