Skip to content

feat: add create_deal to ApolloClient - #13

Merged
jschfflr merged 1 commit into
mainfrom
feat/create-deal
Jul 9, 2026
Merged

feat: add create_deal to ApolloClient#13
jschfflr merged 1 commit into
mainfrom
feat/create-deal

Conversation

@jschfflr

@jschfflr jschfflr commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What

Adds ApolloClient.create_deal(name, **fields) -> Deal, wrapping POST /api/v1/opportunities.

  • name is the only required field.
  • Optional fields forwarded as-is: owner_id, account_id, amount, opportunity_stage_id, closed_date (YYYY-MM-DD).
  • Requires a master API key (non-master keys 403) — documented in the docstring.

Why

The client could search/get/update deals but not create them; creating a deal previously required raw curl.

Testing

  • +2 unit tests (test_create_deal, test_create_deal_name_only).
  • Live-verified against the real Apollo API (created a throwaway deal, confirmed via deals search).
  • ruff ✅ · pyright ✅ · 183 tests ✅

Note: no version bump here — versioning/tag intentionally left for release time.

🤖 Generated with Claude Code

Adds ApolloClient.create_deal(name, **fields) -> Deal, wrapping
POST /api/v1/opportunities. Only 'name' is required; optional owner_id,
account_id, amount, opportunity_stage_id, closed_date are forwarded.
Requires a master API key (non-master keys 403). Live-verified against
the real API.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
peqy[bot]
peqy Bot approved these changes Jul 9, 2026

@peqy peqy Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. The method matches existing client patterns (payload passthrough + Deal parsing), and the tests cover both name-only and extra-fields bodies. Ship it.

@jschfflr
jschfflr merged commit 99caebd into main Jul 9, 2026
4 checks passed
@jschfflr jschfflr mentioned this pull request Jul 9, 2026
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