Populate and explain every CRM table #15

Merged
KofTwentyTwo merged 3 commits from feature/tables-populated-defaults into develop 2026-10-14 22:10:41 +00:00
KofTwentyTwo commented 2026-10-14 21:51:34 +00:00 (Migrated from github.com)

Audit result

34 tables: 10 seeded by the new crm-defaults.changelog.sql, 24 start empty with a stated reason (user content, runtime-written, or host-specific). Every table help now says "How rows get created". The home has a Setup card.

Changes

  • crm-defaults.changelog.sql (insert-only; table-exists and tenant_key preconditions; lists seeded only while empty, pipeline only if none exists, base currency only if none). CrmStarterData unchanged.
  • Setup card (crm_setup widget, CrmSetupStatus): default pipeline, stages (incl. closed won/lost), lifecycle Lead/Opportunity, base currency, email delivery (CrmReadiness). Resolves config the way the runtime does.
  • Help bundle extended for all 34 tables and the app.
  • crm_currency.rateLastUpdatedDate now stamped on insert and when the rate changes (CurrencyRateDateCustomizer), field read-only.
  • crm_external_mapping: no writer exists; help says "not used yet" (only erasure reads it).

Tests

CrmDefaultsChangelogTest (real Liquibase on H2: applies once, second update runs nothing, missing tables and tenant schemas MARK_RAN; plus SQL-level idempotency/edit survival), CrmTablesGuardrailTest, CrmSetupStatusTest, CurrencyRateDateTest. ./mvnw verify green.

Not done

  • crm_external_mapping stays unwritten (a sync is more than a day).
  • Tenant-enabled hosts must seed per tenant themselves.
  • No "Create defaults" table action (changelog covers it).

🤖 Generated with Claude Code

## Audit result 34 tables: 10 seeded by the new `crm-defaults.changelog.sql`, 24 start empty with a stated reason (user content, runtime-written, or host-specific). Every table help now says "How rows get created". The home has a Setup card. ## Changes - `crm-defaults.changelog.sql` (insert-only; table-exists and tenant_key preconditions; lists seeded only while empty, pipeline only if none exists, base currency only if none). CrmStarterData unchanged. - Setup card (`crm_setup` widget, `CrmSetupStatus`): default pipeline, stages (incl. closed won/lost), lifecycle Lead/Opportunity, base currency, email delivery (CrmReadiness). Resolves config the way the runtime does. - Help bundle extended for all 34 tables and the app. - `crm_currency.rateLastUpdatedDate` now stamped on insert and when the rate changes (`CurrencyRateDateCustomizer`), field read-only. - `crm_external_mapping`: no writer exists; help says "not used yet" (only erasure reads it). ## Tests `CrmDefaultsChangelogTest` (real Liquibase on H2: applies once, second update runs nothing, missing tables and tenant schemas MARK_RAN; plus SQL-level idempotency/edit survival), `CrmTablesGuardrailTest`, `CrmSetupStatusTest`, `CurrencyRateDateTest`. `./mvnw verify` green. ## Not done - crm_external_mapping stays unwritten (a sync is more than a day). - Tenant-enabled hosts must seed per tenant themselves. - No "Create defaults" table action (changelog covers it). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.