Skip to content

refactor: type update_opportunity_roles payload as list[RoleAssignment] (v0.3.1) - #11

Merged
jschfflr merged 1 commit into
mainfrom
refactor/typed-role-assignment
Jul 8, 2026
Merged

jschfflr merged 1 commit into
mainfrom
refactor/typed-role-assignment

Conversation

@jschfflr

@jschfflr jschfflr commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Addresses the automated review on #10.

update_opportunity_roles(opportunity_id, roles) typed roles as the loose list[dict], which hurt pyright/autocomplete. This introduces a RoleAssignment TypedDict — required contact_id, optional opportunity_contact_role_type_id / is_primary — and uses it in the signature. Exported from the package root.

Non-breaking: plain dicts still satisfy the TypedDict structurally, so apollo-cli (which passes dicts) is unaffected.

ruff check ✓ · ruff format --check ✓ · pyright src/ 0 errors ✓ · pytest 179 passed ✓

🤖 Generated with Claude Code

…t] (v0.3.1)

Addresses the review on #10: `roles: list[dict]` was loose and gave callers
no type checking/autocomplete. Introduce a `RoleAssignment` TypedDict
(required contact_id; optional opportunity_contact_role_type_id, is_primary)
and use it in the signature. Exported from the package root. Non-breaking —
plain dicts still satisfy it structurally.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
peqy[bot]
peqy Bot approved these changes Jul 8, 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. Introducing RoleAssignment as a TypedDict improves typing/autocomplete for update_opportunity_roles(...) while staying structurally compatible with existing dict callers. Ship it.

@jschfflr
jschfflr merged commit 717b6be into main Jul 8, 2026
4 checks passed
@jschfflr
jschfflr deleted the refactor/typed-role-assignment branch July 8, 2026 12:20
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