Skip to content

feat(tasks): optional contact or prospect reference (#7391) - #52

Merged
poisvin merged 1 commit into
mainfrom
feat/task-person-reference-7391
Nov 2, 2026
Merged

poisvin merged 1 commit into
mainfrom
feat/task-person-reference-7391

Conversation

@poisvin

@poisvin poisvin commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements Gather #7391 / T29: https://app.gatherai.co/tasks/7391

  • Add optional Task contact/prospect references to existing sales records, with at most one reference set.
  • Support create/read/list/replace/clear. Omitted PATCH fields preserve the reference; setting one person clears the other.
  • Validate integer IDs, organization membership of the referenced record, and conflicting inputs. Reject nonexistent/cross-organization IDs without partial writes.
  • Return minimal related id/name summaries; never infer or duplicate person identity.
  • Filter repository writes to permitted task fields so nested Prisma operations cannot bypass person-reference validation.
  • Preserve task assignment, ownership and existing permissions. No UI components or person-page buttons are added; web changes are API types only.

Migration

Add nullable contact_id/prospect_id, indexes, ON DELETE SET NULL foreign keys, and a check constraint preventing both links. No backfill. Deleting a person clears the reference without deleting the task.
Applied only to isolated local preview database zuko_cm_preview. Prisma migration diff reported no difference from the schema. No production deployment performed.

Verification

  • Backend: 447 tests passed across 26 files.
  • Sales library: 280 tests passed across 16 files, including real database reference tests.
  • Frontend: 353 tests passed across 19 files.
  • Web/backend/sales typechecks, formatting and whitespace checks passed.
  • Live API checks passed for create/read/list, omission, replacement across reference types, clearing, invalid/conflicting/cross-org/nonexistent ID rejection, rollback, deletion safety and unchanged task ownership/assignment.
  • Creating people does not create tasks. Temporary test fixtures removed.

@poisvin
poisvin merged commit 3d08cef into main Nov 2, 2026
1 check passed
@poisvin
poisvin deleted the feat/task-person-reference-7391 branch November 2, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant