Skip to content

Add Project DTO and return it from project endpoints - #4

Merged
jhhazelaar merged 3 commits into
mainfrom
feature/project-dto
May 7, 2026
Merged

Add Project DTO and return it from project endpoints#4
jhhazelaar merged 3 commits into
mainfrom
feature/project-dto

Conversation

@jhhazelaar

Copy link
Copy Markdown
Member

Summary

  • Introduce a Project DTO that maps the API's Project_UUId/Project_Titel/Project_Timestamp/Laatst_Bijgewerkt fields into typed, readonly properties
  • Wire createDtoFromResponse into GetProjectRequest and GetProjectsRequest, and update ProjectResource::get()/list() to return the DTO(s) instead of raw Response objects
  • Ignore macOS .DS_Store files

Test plan

  • vendor/bin/pest — DTO, request, and resource tests cover both single and list responses

jhhazelaar and others added 3 commits May 7, 2026 11:11
Introduce Project data object with a fromResponse(array) factory that
maps the API's Project_UUId/Project_Titel/Project_Timestamp keys onto
uuid/title/created_at/updated_at. GetProjectRequest::createDtoFromResponse
delegates the field mapping to the DTO, and ProjectResource::get now
returns the typed Project directly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
GetProjectsRequest::createDtoFromResponse maps data.objects through
Project::fromResponse, and ProjectResource::list now returns Project[]
via ->dto() (matching get()'s shape). Project::fromResponse prefers
Laatst_Bijgewerkt for updated_at when present, falling back to
Project_Timestamp so the single-project endpoint is unaffected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jhhazelaar
jhhazelaar merged commit e3eeb9c into main May 7, 2026
18 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