Skip to content

th-3263eb: th api crm deals + companies (pipeline view + idempotent writes)#148

Open
brentrager wants to merge 1 commit into
mainfrom
crm-deals-companies
Open

th-3263eb: th api crm deals + companies (pipeline view + idempotent writes)#148
brentrager wants to merge 1 commit into
mainfrom
crm-deals-companies

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

What

Extends the contacts-only `th api crm` module with two new resource groups over the existing user-auth CRM API:

  • `th api crm deals {list|show|create|move}`
  • `th api crm companies {list|show|upsert}`

Read UX (mirrors the dashboard pipeline)

  • `deals list` → Total / Pipeline-value line + aligned table with colored stage badges (green=won, red=lost). `--json` to pipe.
  • `deals show` → resolves and prints the linked company + contact names, not just ids.
  • `companies list` → NAME / DOMAIN / INDUSTRY table.

Do UX

  • `deals create` is idempotent (a same-title deal is left as-is; use `move` to change stage).
  • `--company` / `--contact` accept a name or email — auto-resolved to ids by a local match against the paged list (the API `?search=` param doesn't reliably hit full emails).
  • `companies upsert` matches by name/domain and patches in place.

Tests

Unit tests for comma money-grouping (`5500.0 → 5,500.00`) and uuid-vs-name detection. `cargo clippy -p smooai-smooth-cli --all-targets` clean.

Dogfood

Used live to backfill the RPM Pizza deal into the Smoo AI org CRM: company + 3 contacts + Discovery (closed_won $5,500) + v1 Build deals.

🤖 Generated with Claude Code

…me-resolving writes)

Extends the contacts-only crm module with two resource groups over the
existing user-auth CRM API: th api crm deals {list|show|create|move} and
companies {list|show|upsert}. 'deals list' renders the dashboard pipeline
(Total/Pipeline-value + aligned table, colored stage badges); 'deals show'
resolves linked company + contact names; --json to pipe. Create is
idempotent; --company/--contact accept a name or email (local-match
resolution). Unit tests for money-grouping + uuid detection.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d8e3dcd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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