Skip to content

refactor: map the Jira issue details response in GetIssueRequest - #97

Merged
tomasvanrijsse merged 2 commits into
mainfrom
feat/38-jira-issue-details-dto
Nov 7, 2026
Merged

tomasvanrijsse merged 2 commits into
mainfrom
feat/38-jira-issue-details-dto

Conversation

@claude-for-timatic

Copy link
Copy Markdown
Contributor

GetIssueRequest now maps its own response to a typed JiraIssueDetails DTO (issue, comments, status changes), so TicketProvider::fetchTicketDetails() no longer parses raw JSON and the request loses its response-dto architecture exemption.

Closes #38

Decisions

  • Reused JiraIssue, JiraComment and JiraChangelogEntry: their fields already matched the response, so the only new class is the JiraIssueDetails wrapper.
  • Test first: no test covered fetchTicketDetails, so tests/Integration/Jira/TicketProviderTest.php was committed before the refactor to pin the old output (rendered comments, blank comment dropped, only status changelog items, historyId-itemIndex ids, 404 → null).
  • No change to the architecture test file: tests/Architecture/ArchitectureTest.php from the issue no longer exists. The exemption was the @arch-ignore response-dto marker on the request, which is now removed.
  • Mapping is written inline in createDtoFromResponse(), the way GetIssuesRequest does it, not in private helpers.
  • The 404 check stays in TicketProvider, before ->dto(), so a 404 still returns null.

Review

A code-review agent found no blockers. Two optional nits are left out on purpose:

  • Building JiraIssue repeats code from GetIssuesRequest. Nothing on our DTOs shares construction like this yet.
  • Existing behaviour, kept as is: a comment with no rendered body falls back to the raw ADF array, and trim() throws on it.

Docs

Nothing in the domain docs (#96) changes.

Verification

Full Pest suite green, PHPStan 0 errors, Pint clean.

The request now returns a JiraIssueDetails DTO with the issue, its
comments and its status changes, so the TicketProvider no longer parses
raw JSON and the request drops its response-dto architecture exemption.

Closes #38
@tomasvanrijsse
tomasvanrijsse merged commit 25d52a6 into main Nov 7, 2026
4 checks passed
@tomasvanrijsse
tomasvanrijsse deleted the feat/38-jira-issue-details-dto branch November 7, 2026 23:27
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.

Map the Jira issue details response in GetIssueRequest

1 participant