Skip to content

feat(ticketing): add unified tags (account + ticket/user/org)#99

Merged
lmeilibr merged 1 commit into
mainfrom
feature/tags
Apr 22, 2026
Merged

feat(ticketing): add unified tags (account + ticket/user/org)#99
lmeilibr merged 1 commit into
mainfrom
feature/tags

Conversation

@lmeilibr
Copy link
Copy Markdown
Contributor

Summary

  • Adds TagApiClient and TagsService unifying the Zendesk account-level tag listing (/api/v2/tags) with per-resource tag operations (add/set/remove) across tickets, users, and organizations.
  • Dispatches by resource name (ticket | user | organization) to the correct endpoint; invalid resource raises ValueError.
  • Wires self.tags onto the Ticketing facade.

Test plan

  • Unit: tests/unit/ticketing/test_tag_client.py (paths, payloads, iterable-to-list, None response handling, error propagation)
  • Unit: tests/unit/ticketing/test_tags_service.py (delegation + error propagation)
  • Coverage: 100% on tag_api_client.py and tags_service.py
  • Full unit suite passes (600 tests)
  • Live-tenant integration: tests/integration/ticketing/test_tags.py (list account, list_for ticket, add/set/remove lifecycle, invalid resource)

Part of #79 (Batch 2 — unified tags).

🤖 Generated with Claude Code

Adds a single TagApiClient and TagsService that covers the Zendesk
account-level tag listing and per-resource tag operations (add/set/remove)
across tickets, users, and organizations.

- list_account paginates /api/v2/tags (id, name, count)
- list_for / add / set / remove dispatch on resource name
  (ticket|user|organization) to the correct tags endpoint
- remove uses DELETE with a json body
- invalid resource names raise ValueError

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
def test_remove_handles_none_response(http):
http.delete.return_value = None
client = TagApiClient(http)
assert client.remove(resource="ticket", resource_id=1, tags=["x"]) == []
return uuid.uuid4().hex[:10]


def _first_ticket_id(ticketing: Ticketing) -> int:
@sonarqubecloud
Copy link
Copy Markdown

@lmeilibr lmeilibr merged commit 3bc5c72 into main Apr 22, 2026
3 checks passed
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