Skip to content

Ticketing API: complete remaining endpoint coverage (phased PRs) #79

@lmeilibr

Description

@lmeilibr

Tracks the remaining Zendesk Ticketing API coverage in libzapi. Each checkbox is one focused PR (implementation + integration tests + unit-test coverage ≥ 80%). Opened after PRs #77 (tickets CUD) and #78 (users CUD) established the pattern.

Status (2026-04-22)

Merged: 36 PRs (#77, #78, #80#114 minus the three still open).
Open:

Not yet started (Batch 3): Organization Subscriptions, User Events/Profiles/Passwords, Lookup Relationships, Resource Collections, Skill-based Routing, Deletion Schedules, Group SLA Policies, Ticket Form Statuses, Ticket Import, Custom Agent Roles, Approvals, Task Lists, Zendesk Events.

Conventions (from PRs #77 and #78)

  • Layers per feature: command dataclass (CreateXCmd / UpdateXCmd) → mapper (to_payload_create / to_payload_update) → XApiClient (HTTP adapter) → XService (facade).
  • Types: frozen=True, slots=True dataclasses. Relax fields to Optional when Zendesk returns null for freshly-created records.
  • Integration tests: live-tenant style under tests/integration/ticketing/; use the create-throwaway / exercise / verify pattern for destructive ops. _unique() = uuid.uuid4().hex[:10], emails use @example.invalid. Mark side-effecting endpoints (invitation email, settings mutations) @pytest.mark.skip with a reason.
  • Unit tests: 100% coverage target for each new module. Service tests mock the client with Mock() + sentinel; api-client tests mock HttpClient via pytest-mock and patch to_domain. Mapper tests are pure assertions on payload shape.
  • HTTP client: HttpClient.delete accepts an optional json body (needed for tag-removal endpoints).
  • Branching: one focused feature branch per PR, small commits, conventional-commit prefixes. Stack only when a PR depends on unmerged machinery from another; otherwise rebase onto main.

Scope reminders

  • Skip list (out of scope for this effort, keep as stubs if encountered): none. User confirmed we keep Custom Agent Roles, Approvals, Task Lists, and Zendesk Events in scope.
  • Per-tenant endpoints: some (entitlements, Sell, etc.) will pytest.skip at runtime when the feature isn't enabled on the sandbox — that's fine, just wrap in try/skip.

Batch 1 — core CUD / admin surface

Batch 2 — read/search surfaces and threaded models

Batch 3 — supporting & admin endpoints

Done

How to pick up the next PR

  1. Check which checkbox is next and unchecked.
  2. Branch from current main: git checkout -b feature/<area>-cud.
  3. Follow the layer pattern; add a tests/integration/ticketing/test_<area>.py and unit tests for service/api-client/mapper (target 100% on new modules).
  4. Open PR, base main, reference this issue, and tick the box when merged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions