[schemas] CRM engagement: notes, tasks, dates, interactions#394
[schemas] CRM engagement: notes, tasks, dates, interactions#394alanshurafa wants to merge 1 commit into
Conversation
OB1 PR Gate✅ Folder structure — All files are in allowed directories Result: All 15 checks passed! Ready for human review. Post-Merge TasksThese don't block merge — they're reminders for admins after this PR lands.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17e85cb294
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| SELECT * INTO v_suggestion | ||
| FROM public.crm_keep_in_touch_suggestions(100, 0, 'all', p_contact_id, true) s |
There was a problem hiding this comment.
Resolve review actions with the same privacy scope
When a privileged caller reads the queue with p_exclude_restricted = false to include a restricted contact or a suggestion driven only by restricted engagement rows, this update path still recomputes the queue with true. The supplied suggestion_key is then absent from the recomputed result and dismiss/snooze/convert raises CRM keep-in-touch suggestion not found, so restricted suggestions exposed by the read RPC cannot be acted on. Pass through an explicit privacy-scope parameter or resolve the exact key without hard-coding the restricted filter.
Useful? React with 👍 / 👎.
Adds
schemas/crm-engagement: engagement layer on top ofschemas/crm-core. Tables and RPCs for per-contact notes, tasks, important dates, and logged interactions, so a contact record carries its activity history.Self-contained under
schemas/crm-engagement/; idempotent. Includes README + metadata.json.Depends on #393 (crm-core) — the engagement tables reference
crm_contacts. Apply crm-core first.Testing: applied on an ephemeral Postgres alongside the full schema stack; composes cleanly.