Skip to content

View controller layer#180

Merged
scraft-official merged 4 commits intorelease/2.25from
feature/view-controller-layer
Dec 29, 2025
Merged

View controller layer#180
scraft-official merged 4 commits intorelease/2.25from
feature/view-controller-layer

Conversation

@scraft-official
Copy link
Copy Markdown
Collaborator

This pull request introduces a new "Views" API to the backend, enabling fetching of individual views, batch fetching by IDs, and retrieving all views for a specific channel. It adds the necessary controller, request/response DTOs, and mappers for the new endpoints, and also updates the tasks API to support fetching tasks by channel. Additionally, it fixes a naming inconsistency in the ViewsInChannelUseCase result.

New "Views" API Implementation:

  • Added ViewController with endpoints to fetch a single view, batch fetch views by IDs, and fetch all views for a channel, including OpenAPI documentation and organization header support.
  • Introduced request and response DTOs for the new API: ViewsBatchFetchRequest, ViewResponse, ViewsBatchFetchResponse, ViewsListResponse, and ViewResponseContent. [1] [2] [3] [4] [5]
  • Created mapping interfaces for transforming between domain objects, commands, and DTOs: ViewMapper, ViewFetchMapper, ViewsBatchFetchMapper, and ViewsInChannelMapper. [1] [2] [3] [4]
  • Added a custom MapStruct annotation for mapping view domain objects to response content (ViewResponseContentMapping).

Enhancements to Existing APIs:

  • Added endpoint to TaskController for fetching tasks by channel, with OpenAPI documentation and organization header.
  • Added missing no-argument constructor to TasksBatchFetchRequest for compatibility with frameworks.

Bug Fixes / Consistency:

  • Fixed naming inconsistency in ViewsInChannelUseCase.Result by renaming viewIds to viewsIds throughout the codebase. [1] [2]

Introduces a new ViewController with endpoints for fetching single views, batch views, and views by channel. Adds related request, response, and mapper classes for view operations. Also fixes a typo in ViewsInChannelUseCase by renaming 'viewIds' to 'viewsIds'.
Corrected a typo in the ViewController endpoint from '/views/batch-betch' to '/views/batch-fetch'. Added the @Mapper annotation with 'spring' component model to ViewsInChannelMapper for proper MapStruct integration.
Updated the /views/batch-fetch endpoint in ViewController from GET to POST to properly handle request bodies for batch fetching views.
NikodemCyrzan
NikodemCyrzan previously approved these changes Dec 29, 2025
All mapper implementations now extend their respective domain Mapper interfaces (e.g., ChannelMapper, ProjectMapper, TaskMapper, etc.) for consistency and potential shared logic. Additionally, TaskCreateRequest and TaskPatchRequest fields 'beginAtTimestamp' and 'endAtTimestamp' are renamed to 'beginAt' and 'endAt' to standardize naming.
@scraft-official
Copy link
Copy Markdown
Collaborator Author

Sorki, zauważyłem problem dosyć spory ze wszystkimi mapperami XD, musiałem to wrzucić tutaj

@scraft-official scraft-official merged commit eb37bbf into release/2.25 Dec 29, 2025
2 checks passed
scraft-official added a commit that referenced this pull request Jan 4, 2026
* Add view management API endpoints and mappers

Introduces a new ViewController with endpoints for fetching single views, batch views, and views by channel. Adds related request, response, and mapper classes for view operations. Also fixes a typo in ViewsInChannelUseCase by renaming 'viewIds' to 'viewsIds'.

* Fix typo in endpoint and add MapStruct annotation

Corrected a typo in the ViewController endpoint from '/views/batch-betch' to '/views/batch-fetch'. Added the @Mapper annotation with 'spring' component model to ViewsInChannelMapper for proper MapStruct integration.

* Change batch fetch endpoint to POST method

Updated the /views/batch-fetch endpoint in ViewController from GET to POST to properly handle request bodies for batch fetching views.

* Unify mapper interfaces and update task request fields

All mapper implementations now extend their respective domain Mapper interfaces (e.g., ChannelMapper, ProjectMapper, TaskMapper, etc.) for consistency and potential shared logic. Additionally, TaskCreateRequest and TaskPatchRequest fields 'beginAtTimestamp' and 'endAtTimestamp' are renamed to 'beginAt' and 'endAt' to standardize naming.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants