feat: add 'deals create' command - #11
Conversation
Adds 'deals create --name … [--owner-id] [--account-id] [--amount] [--stage-id | --stage-name] [--closed-date]', wrapping the new ApolloClient.create_deal. --name is the only required field; --stage-name resolves to an ID via list_all_stages (same helper as 'deals search'), and passing both --stage-id and --stage-name is a validation error. Depends on qodev-apollo-api create_deal (apollo-api#13). CI stays red until that is released to PyPI and the version floor is bumped here. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
create_deal landed in apollo-api 0.4.0 (now on PyPI). Bumping the floor unblocks CI (UV_NO_SOURCES pulls from PyPI, which now has the method). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
[Improvement] deals create: consider calling create_deal with name= keyword (and adjust the test) to be resilient if the API method uses a keyword-only signature.
[Question] Given CI runs with UV_NO_SOURCES=1, can you confirm uv sync will resolve qodev-apollo-api from PyPI (0.4.0) despite the repo using a path source override/lock entry locally? If not, CI may still be flaky until the lock/source setup is aligned.
| stage_id = resolve_stage_id(stage_name, all_stages.items, kind="deal stage") | ||
| if stage_id: | ||
| fields["opportunity_stage_id"] = stage_id | ||
| deal = await client.create_deal(name, **fields) |
There was a problem hiding this comment.
[Improvement] Call create_deal with name= keyword to be robust to a keyword-only signature in qodev-apollo-api (and to make the callsite self-documenting).
Fix:
deal = await client.create_deal(name=name, **fields)(and adjust the test to assertcall_args.kwargs["name"]).
What
Adds the
deals createCLI command:--nameis the only required field.--stage-nameresolves to an ID vialist_all_stages(same helper asdeals search).--stage-idand--stage-nameis a validation error (no API call made).This wraps
ApolloClient.create_deal, added in apollo-api#13. CI runs withUV_NO_SOURCES=1(pulls apollo-api from PyPI), so CI will fail (create_dealnot found) until:qodev-apollo-api>=floor to that release.Local checks pass against the path-source api build.
Testing
--stage-name/ rejects both stage args).🤖 Generated with Claude Code