Skip to content

feat(ticketing): add ticket fields CUD, reorder, option helpers#88

Open
lmeilibr wants to merge 1 commit into
mainfrom
feature/ticket-fields-cud
Open

feat(ticketing): add ticket fields CUD, reorder, option helpers#88
lmeilibr wants to merge 1 commit into
mainfrom
feature/ticket-fields-cud

Conversation

@lmeilibr
Copy link
Copy Markdown
Contributor

Summary

  • Introduce CreateTicketFieldCmd / UpdateTicketFieldCmd / TicketFieldOptionCmd (frozen slots dataclasses) replacing the old pattern that reused the rich typed domain entity as a write command
  • Expand the payload mapper to cover every Zendesk ticket_field field (description, active, required, collapsed_for_agents, regexp_for_validation, portal flags, tag, position, custom_field_options, sub_type_id, relationship_target_type/filter, agent_description) while preserving false booleans and skipping unset optionals
  • Refactor TicketFieldApiClient to accept the new Cmd dataclasses, normalize URLs (drop .json), and add reorder, list_options, get_option, upsert_option, delete_option
  • Migrate TicketFieldsService to **fields kwargs ergonomics and surface the reorder + option helpers

Test plan

  • Unit: mapper (create/update/option) + client (list/get/create/update/delete/reorder/options/errors) + service (delegation/create/update/upsert/errors)
  • pytest tests/unit — 1904 passed
  • Coverage — 302/302 stmts (100%) across cmds/mapper/client/service/domain
  • Integration (live tenant): tests/integration/ticketing/test_ticket_field.py

Refs #79.

🤖 Generated with Claude Code

Refs #79.

- Introduce CreateTicketFieldCmd / UpdateTicketFieldCmd / TicketFieldOptionCmd
- Expand mapper to cover every Zendesk ticket_field payload field while
  preserving false booleans and skipping unset optionals
- Refactor client to use Cmd dataclasses, add reorder and option endpoints
  (list, get, upsert, delete)
- Migrate service to **fields kwargs ergonomics; expose reorder and option
  helpers
- Unit + integration coverage at 100% across 302 stmts

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
id: int | None = None


TicketFieldCmd: TypeAlias = CreateTicketFieldCmd | UpdateTicketFieldCmd
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
4.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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