mirror of
https://github.com/logos-co/logos-web.git
synced 2026-08-27 12:11:14 +00:00
* feat(civi-crm-cms): add project architecture documentation
* chore(civi-crm-cms): register app in mono-repo
Add civi-crm-cms env vars to turbo.json build.env. Update root AGENTS.md
with app entry (port 3002, arch doc link) and dev command. Update lockfile.
* chore(civi-crm-cms): scaffold app config and tooling
Next.js 16, Tailwind v4, Vitest, ESLint, PostCSS — matching apps/web
conventions. Path alias @/* → ./src/*. Port 3002. AGENTS.md links to
the architecture doc and documents doc-update rules and code conventions.
* feat(civi-crm-cms): add lib layer, view config, and domain type stubs
- views.ts: full ViewConfig types + circles_onboarding config + getActiveView()
- auth.ts: getCurrentUserEmail() — DEV_USER_EMAIL_MOCK override + Keycloak header
- civicrm/client.ts: CiviCRMClient skeleton with typed interface
- civicrm/scorecard.ts: computeScorecard() pure function (tested, 4 passing)
- civicrm/{cases,contacts,activities,relationships,coordinators}.ts: stubs
- activity-logger.ts: logActivity() stub
- constants/pagination.ts: PAGE_SIZE = 20
- types/{case,contact}.ts: placeholder stubs
* feat(civi-crm-cms): add app router skeleton
Root layout + redirect to /cases. Page stubs for list and detail views.
Server Actions stub (updateCase, updateContact, swapCoordinator).
API route stubs returning 501 for all planned endpoints:
GET /api/cases, GET+PATCH /api/cases/[id], GET /api/cases/[id]/activities,
PATCH /api/cases/[id]/coordinator, PATCH /api/contacts/[contactId],
GET /api/coordinators.
* feat(civi-crm-cms): add component stubs
AppNav, CasesTable, CasesFilters, CaseDetailShell, CaseFields,
ContactFields, Scorecard, ActivityLog — each returns null with a
TODO comment describing its role per the architecture doc.
* fix(civi-crm-cms): add assignedTo FieldDef backed by Relationship entity
Adds a missing FieldDef for the `assignedTo` listColumn so that
`getFieldDef()` no longer throws when rendering or building select[] for
that column. The field is `readonly` with a dedicated `Relationship`
UpdateTarget, reflecting that coordinator assignment goes through
CiviCRM's Relationship entity rather than a direct Case/Contact PATCH.
* chore(civi-crm-cms): update architecture docs
Remove mention of repo pending node & pnpm upgrade.
* docs(civi-crm-cms): align ActivityLog Server/Client boundary description
The table incorrectly said ActivityLog had no client-side fetching, but
the stub and the dedicated GET /api/cases/[id]/activities?page= route
both indicate it fetches on page change. Corrected to reflect that
ActivityLog is a client-fetching component, with a note that the Server
Component shell can pre-fetch page 1 to avoid a first-render waterfall.
* docs(civi-crm-cms): fix globals.css snippet to use Tailwind v4 import syntax
The snippet used `@tailwind utilities;` which is a v3 directive. Updated
to match the actual app file and apps/web pattern: `@import 'tailwindcss'`
plus the `@source` directive for the shared UI package. Added a note
clarifying that the v3 directives must not be used.
* fix(civi-crm-cms): guard DEV_USER_EMAIL_MOCK against production
* fix(civi-crm-cms): strengthen views and client stubs
- Add skipSelect flag to FieldDef; mark assignedTo so select[] builders
have a typed signal to exclude it rather than relying on comments
- Add assertViewIntegrity() called from getActiveView() to catch
scorecardFieldKeys referencing unknown or non-scorecard field keys at startup
- Add constructor to CiviCRMClient wiring CIVICRM_BASE_URL / CIVICRM_API_KEY
- Remove spurious blank lines in update() params
- Document null as a valid CiviWhere value for IS NULL / IS NOT NULL operators
* docs(civi-crm-cms): sync architecture doc with code fixes
- Fix /case/[id] → /cases/[id] route path in §1
- Add Relationship to UpdateTarget union in §5.2
- Add skipSelect to FieldDef snippet in §5.2
- Update auth.ts snippet in §8 to show NODE_ENV guard with explanation
- Add null to CiviWhere type in §6.1 with IS NULL / IS NOT NULL note
* refactor(civi-crm-cms): rename circles_onboarding view to movement_view
Renames the view ID, variable, label, and caseTypeName throughout:
- src/lib/views.ts: const + registry key + ACTIVE_VIEW default
- .env.local.example: ACTIVE_VIEW default value
- docs/civi-crm-cms-architecture.md: §5.1, §5.3, §13 snippets
* feat(civi-crm-cms): implement types and CiviCRM HTTP client
Define raw CiviCRM APIv4 response types, domain types for Case/Contact,
and implement the four CiviCRMClient methods (get, create, update, delete)
with X-Civi-Auth header and CiviCRMError on non-2xx responses.
* test(civi-crm-cms): add CiviCRMClient unit tests
* chore(civi-crm): update directory name
* chore: update lock file
* refactor(civi-crm): tighten CiviCRMClient and expand tests
- Extract repeated auth headers into a private getter
- Simplify get() body to JSON.stringify(params) -- new CiviParams fields no longer need manual wiring
- Guard create() against empty values response; throws CiviCRMError(200) instead of returning undefined
- Assert request body in create and update tests
- Add test for empty-values guard in create
* docs: rename civi-crm-cms to civi-crm in architecture doc