Repurpose Communications tab as admin-only email-activity panel (v0.1.0:80)

The Communications tab is now an admin-only search over captured Gmail
(email_* tables), part of consolidating on the fundraising grid + email
capture as the canonical system of record.

- New GET /api/email/activity (admin-enforced server-side): filter by
  investor / mailbox / direction with free-text search over subject,
  snippet, and sender. Query logic in db.query_email_activity.
  - Soft-delete honored on the per-mailbox sighting (emails carry no
    deleted_at; deletion lives on email_account_messages).
  - Direction decided at the email level (outbound if the sender is one of
    our mailboxes), mirroring digest_builder.
  - Graveyard investors are hidden from the filter dropdown (CRM-wide
    graveyard=0 convention) but their email stays visible in the list and
    findable by free-text search — this is an audit surface.
- Communications page rewritten to render the panel; the classic manual
  "Log Communication" form is retired (the grid context menu remains the
  manual-log path). Nav item + page are admin-only.
- Tests: email_integration/test_email_activity_panel.py (filters,
  per-sighting soft-delete, roll-ups, graveyard handling, route 401/403);
  full suite 22/22. Frontend render verified via a jsdom mount smoke test
  plus the pinned classic-runtime Babel transform.

Code-only, no schema migration (version migrations are no-ops).
This commit is contained in:
Keysat
2026-06-16 14:49:59 -05:00
parent f9705d2216
commit 42d2b4b245
8 changed files with 494 additions and 291 deletions
+21
View File
@@ -0,0 +1,21 @@
import { VersionInfo } from '@start9labs/start-sdk'
// Repurpose the Communications tab as the admin-only email-activity panel. Code-only,
// no schema change (migrations are no-ops):
// * New GET /api/email/activity (admin-enforced server-side): captured-Gmail activity
// over the email_* tables, filterable by investor / mailbox / direction with
// free-text search. Soft-delete is honored on the per-mailbox sighting; direction is
// decided at the email level (outbound if the sender is one of our mailboxes).
// * Communications page rewritten to render that panel; the classic manual
// "Log Communication" form was retired (the grid context menu remains the log path).
// Nav item + page are admin-only.
export const v_0_1_0_80 = VersionInfo.of({
version: '0.1.0:80',
releaseNotes: {
en_US: [
'The Communications tab is now an admin-only email-activity view: search captured',
'Gmail by investor, mailbox, and direction. No data changes.',
].join(' '),
},
migrations: { up: async () => {}, down: async () => {} },
})