Skip to content

feat(ticketing): add users CUD, merge, tags, related, deleted users#78

Merged
lmeilibr merged 2 commits into
mainfrom
feature/users-cud
Apr 21, 2026
Merged

feat(ticketing): add users CUD, merge, tags, related, deleted users#78
lmeilibr merged 2 commits into
mainfrom
feature/users-cud

Conversation

@lmeilibr
Copy link
Copy Markdown
Contributor

Summary

  • Implements the Users portion of the Zendesk Ticketing API: create / update / delete (single and bulk), create_or_update, update_many uniform and individually, destroy_many, merge, and permanently_delete.
  • Adds user lookup surfaces: show_many, search (by query or 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, and list/set/add/remove tags.
  • Relaxes several User domain fields to Optional to match the shape Zendesk returns for freshly-created users, and adds UserRelated and ComplianceDeletionStatus models plus CreateUserCmd / UpdateUserCmd command dataclasses with matching payload mappers.

Dependencies

Test plan

  • uv run --python 3.12 pytest tests/unit -q → 1445 passed
  • pytest tests/integration/ticketing/test_user.py --collect-only -q → 27 tests collected
  • Live-tenant integration run (pytest tests/integration/ticketing/test_user.py) against a sandbox Zendesk instance — not executed in this PR, run before merge.
  • test_request_create is @pytest.mark.skip (would send real invitation emails); test_list_entitlements falls back to pytest.skip when Sell/entitlements isn't enabled on the tenant.

🤖 Generated with Claude Code

lmeilibr and others added 2 commits April 21, 2026 17:33
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>
@lmeilibr lmeilibr force-pushed the feature/users-cud branch from 69b5ef7 to cd22245 Compare April 21, 2026 20:34
@lmeilibr lmeilibr changed the base branch from feature/tickets-cud to main April 21, 2026 20:34
@sonarqubecloud
Copy link
Copy Markdown

@lmeilibr lmeilibr merged commit 7f7b61b into main Apr 21, 2026
2 checks passed
@lmeilibr lmeilibr deleted the feature/users-cud branch April 21, 2026 20:36
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