feat(ticketing): add users CUD, merge, tags, related, deleted users#78
Merged
Conversation
c4f3768 to
69b5ef7
Compare
Adds the full Users API surface to the Ticketing SDK: - create / update / delete / create_or_update (single + _many) - update_many (uniform) and update_many_individually - destroy_many, merge, permanently_delete - show_many, search (query / external_id), autocomplete - list_related, list_compliance_deletion_statuses, list_entitlements - list_deleted, count_deleted, show_deleted - me_settings, update_me_settings, logout_many, request_create - list/set/add/remove tags Relaxes several User fields to Optional to match the shapes Zendesk returns for freshly-created users (email, phone, external_id, alias, signature, details, notes, etc.). Adds UserRelated and ComplianceDeletionStatus domain models, and CreateUserCmd / UpdateUserCmd command dataclasses with matching payload mappers. Includes 27 live-tenant integration tests using a unique-email helper and the create-throwaway-exercise-verify pattern for destructive ops. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds unit coverage for the new users endpoints, service, and mappers: - UsersService: new test_users_service.py covering create/update/delete (cmd-building), create_many / create_or_update(_many), update_many (uniform) and update_many_individually (paired), merge, destroy_many, request_create, tag helpers, plus delegation for list/count/me/me_settings/entitlements and all read-only lookups. Includes error-propagation parametrization. - UserApiClient: me, show_many (joined ids), search (query / external_id / no-args), autocomplete (with/without users key), list_related, list_compliance_deletion_statuses (including empty), count/count_by_group/count_by_organization, create/update/delete (with empty-body handling), all bulk ops, merge payload shape, deleted users (list/count/show/permanently_delete), me_settings fallback, update_me_settings, list_entitlements, request_create, logout_many, and the four tag helpers (including DELETE with json). - user_mapper: new test_user_mapper.py covering to_payload_create minimal/full-field/tags-conversion/false-preservation cases and to_payload_update empty/name/all-fields variants. Coverage on the PR #2 modules goes from 22-54% to 100% across user_api_client, users_service, user_mapper, user_cmds, and the User/UserRelated/ComplianceDeletionStatus domain models. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
69b5ef7 to
cd22245
Compare
|
This was referenced Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
create_or_update,update_manyuniform and individually,destroy_many,merge, andpermanently_delete.show_many,search(by query orexternal_id),autocomplete,list_related,list_compliance_deletion_statuses,list_entitlements,list_deleted/count_deleted/show_deleted,me_settings/update_me_settings,logout_many,request_create, and list/set/add/remove tags.Userdomain fields toOptionalto match the shape Zendesk returns for freshly-created users, and addsUserRelatedandComplianceDeletionStatusmodels plusCreateUserCmd/UpdateUserCmdcommand dataclasses with matching payload mappers.Dependencies
HttpClient.delete(json=...)forremove_tags. Merge feat(ticketing): complete Tickets CUD + deleted tickets + tags + merge + spam #77 first, then rebase this ontomain.Test plan
uv run --python 3.12 pytest tests/unit -q→ 1445 passedpytest tests/integration/ticketing/test_user.py --collect-only -q→ 27 tests collectedpytest tests/integration/ticketing/test_user.py) against a sandbox Zendesk instance — not executed in this PR, run before merge.test_request_createis@pytest.mark.skip(would send real invitation emails);test_list_entitlementsfalls back topytest.skipwhen Sell/entitlements isn't enabled on the tenant.🤖 Generated with Claude Code