Skip to content

feat(deals): add and remove people on a deal - #58

Closed
roger-guifav wants to merge 1 commit into
trycompai:mainfrom
roger-guifav:feat/deal-add-remove-contacts
Closed

feat(deals): add and remove people on a deal#58
roger-guifav wants to merge 1 commit into
trycompai:mainfrom
roger-guifav:feat/deal-add-remove-contacts

Conversation

@roger-guifav

@roger-guifav roger-guifav commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Fixes #57.

Deal Contacts tab previously rendered only an empty state (“bring them onto the deal”) with no API or UI to attach/detach people, despite DealContact existing in the schema and being returned by deals.byId.

Changes

  • API: deals.addContact({ dealId, contactId, role? }) upserts dealContact
  • API: deals.removeContact({ dealId, contactId }) deletes the link
  • Validates the contact belongs to the deal’s company
  • Optional role; re-attach updates role
  • Touches activity stamps on attach/remove
  • UI: Add person on the deal Contacts tab (picker of company contacts not already attached + optional role) and per-row remove
  • Regenerated nestjs-trpc placeholders for the new mutations

Test plan

  • Company with contacts + deal with none → empty state has Add person
  • Attach person + role → row appears; tab count updates
  • Remove person → gone from deal, contact remains on company
  • Contact from another company is rejected by API
  • Re-attach same person with a new role updates role

Summary by cubic

Add the ability to attach and remove people on a deal from the Contacts tab. Adds server mutations with company-scoped validation and a simple UI with an optional role field.

  • New Features
    • API: deals.addContact({ dealId, contactId, role? }) upserts the link; deals.removeContact({ dealId, contactId }) deletes it; validates the contact belongs to the deal’s company; re-attach updates role.
    • UI: Contacts tab now has an “Add person” form (picker of company contacts not already attached + role input) and per-row Remove; tab count updates; success/error toasts and loading states.
    • Activity: Touches activity stamps on attach and remove.

Written for commit 4135bcf. Summary will update on new commits.

Review in cubic

The Contacts tab only showed an empty state with no write path, even
though DealContact already exists. Add deals.addContact /
deals.removeContact and a company-scoped picker with optional role.
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Comp AI - PoC Team on Vercel.

A member of the Team first needs to authorize it.

@roger-guifav

Copy link
Copy Markdown
Author

Noting for maintainers: this is a focused fix for deal people attach/detach only (issue #57).

I see #56 (lewis/contact-and-currencies) is a broader PR that also mentions deal–contact management. If that lands first and covers the same gap, this PR can stay closed as a duplicate. If #56 is delayed or does not include a company-scoped picker + deals.addContact/removeContact write path, happy to reopen/rebase this smaller patch.

Deployed and verified on our self-hosted fork (crm.guifav.dev).

@carhartlewis

Copy link
Copy Markdown
Contributor

It includes it, should be going out soon!

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.

Cannot attach people to a deal from the UI

2 participants