Skip to content

Task controller layer#175

Merged
scraft-official merged 8 commits intorelease/2.25from
feature/task-controller-layer
Dec 27, 2025
Merged

Task controller layer#175
scraft-official merged 8 commits intorelease/2.25from
feature/task-controller-layer

Conversation

@scraft-official
Copy link
Copy Markdown
Collaborator

This pull request introduces several improvements and refactorings to the channel and organization controller layers, focusing on code organization, response models, and API documentation. The changes streamline the structure of mappers, enhance API documentation for PATCH operations, and update response models for better clarity and maintainability.

Key changes include:

Refactoring and Organization of Mapper Classes

  • All channel-related mapper interfaces (ChannelCreateMapper, ChannelFetchMapper, ChannelPatchMapper, ChannelsBatchFetchMapper, ChannelsInProjectMapper) have been moved from the mapper package to a new mapper.impl package, and their imports have been updated accordingly. This improves code organization and aligns with best practices for separating interface definitions and implementations. [1] [2] [3] [4] [5] [6]
  • A new ChannelMapper interface has been introduced to map Channel domain objects to ChannelResponseContent, leveraging MapStruct for mapping logic.
  • The method name in ProjectMapper has been standardized from toResponseContent to map for consistency.

API Documentation and PATCH Operation Improvements

  • The @DisplayPatchOperations annotation has been added to PATCH endpoints in both ChannelController and OrganizationController, referencing their respective operation enums. This enhances API documentation by clearly listing supported PATCH operations in generated OpenAPI specs. [1] [2] [3] [4] [5]
  • PATCH endpoint descriptions have been improved for clarity in both controllers. [1] [2]

Response Model Updates

  • ChannelCreateResponse now extends BaseResponse and includes a channelId field, removing status/message properties and inheritance from ChannelResponseContent for a clearer, more focused response model.
  • ChannelsListResponse now includes a @Getter annotation for easier property access.

Minor API and Dependency Updates

  • The method name for fetching channels in a project has been updated from getChannels to getChannelsInProject for improved clarity.
  • The Maven parent version reference in pom.xml has been changed from a timestamp-based version to a static dev-local-version for local development consistency.

Moved channel mappers to an 'impl' subpackage and updated imports accordingly. Introduced ChannelMapper and updated ProjectMapper method naming. Added TaskStatus domain model improvements, TaskStatusService, and related API/controller classes. Enhanced Task and Channel service layers with get/getOrThrow methods. Updated TaskCreateRequest and TaskCreateResponse to include relevant fields.
Introduces TaskMapper and TaskCreateMapper interfaces for mapping between domain and API models using MapStruct. Adds TaskResponseContent DTO and TaskResponseContentMapping annotation to standardize task response mapping.
Introduced a new POST endpoint at /channels/{channelId}/tasks to create a task within a specific channel. Added OpenAPI documentation, organization header, and integrated TaskCreateMapper and TaskCreateUseCase for request handling and response mapping. The endpoint now returns a 201 status with a success message upon task creation.
Introduced TaskPatchMapper and TaskFetchMapper for mapping patch and fetch operations. Updated TaskController to support PATCH and GET endpoints for tasks, including request/response models. Refactored TaskCreateRequest and TaskPatchRequest to use Lombok annotations for consistency. Also added @DisplayPatchOperations annotation to relevant endpoints for better documentation.
Introduces endpoints and mappers for batch fetching tasks and retrieving tasks by channel. Refactors task batch fetch classes and response/request objects to use consistent pluralized naming. Adds delete task endpoint and related use case wiring. Minor improvements to channel controller and response classes.
Implemented TaskStatusController with endpoints for fetching single and multiple task statuses. Added request and response models for batch fetch, and refactored TaskStatusContent to TaskStatusResponseContent. Updated ChannelMapper and TasksBatchFetchResponse for improved type consistency.
Updated task request and response DTOs to use Instant for timestamps and UUID for statusId, replacing previous Long and String types. Adjusted related mapping annotations, command objects, and use cases to align with the new field types and naming conventions. Also updated test method names and usages to reflect changes in the mapper interface.
Improved OpenAPI documentation for patch endpoints by adding descriptions and @DisplayPatchOperations annotations. Changed batch-fetch for tasks to POST. Added @tag annotations for Task and TaskStatus controllers. Registered TaskPatchUseCase as a Spring service. Updated Maven POM files to use a static 'dev-local-version' instead of timestamp-based versioning.
@scraft-official
Copy link
Copy Markdown
Collaborator Author

Dzisiaj to mnie całkowicie z kapci wywaliło...

Tak błądziłem po tym DVD, że szkoda gadać, totalnie wyczerpany kognitywnie XD

@scraft-official scraft-official merged commit 7cc1bc7 into release/2.25 Dec 27, 2025
2 checks passed
scraft-official added a commit that referenced this pull request Jan 4, 2026
* Refactor mappers and add task status support

Moved channel mappers to an 'impl' subpackage and updated imports accordingly. Introduced ChannelMapper and updated ProjectMapper method naming. Added TaskStatus domain model improvements, TaskStatusService, and related API/controller classes. Enhanced Task and Channel service layers with get/getOrThrow methods. Updated TaskCreateRequest and TaskCreateResponse to include relevant fields.

* Add task mapping and response content classes

Introduces TaskMapper and TaskCreateMapper interfaces for mapping between domain and API models using MapStruct. Adds TaskResponseContent DTO and TaskResponseContentMapping annotation to standardize task response mapping.

* Add endpoint to create task in specific channel

Introduced a new POST endpoint at /channels/{channelId}/tasks to create a task within a specific channel. Added OpenAPI documentation, organization header, and integrated TaskCreateMapper and TaskCreateUseCase for request handling and response mapping. The endpoint now returns a 201 status with a success message upon task creation.

* Add patch and fetch endpoints for tasks

Introduced TaskPatchMapper and TaskFetchMapper for mapping patch and fetch operations. Updated TaskController to support PATCH and GET endpoints for tasks, including request/response models. Refactored TaskCreateRequest and TaskPatchRequest to use Lombok annotations for consistency. Also added @DisplayPatchOperations annotation to relevant endpoints for better documentation.

* Add batch fetch and channel task endpoints, refactor naming

Introduces endpoints and mappers for batch fetching tasks and retrieving tasks by channel. Refactors task batch fetch classes and response/request objects to use consistent pluralized naming. Adds delete task endpoint and related use case wiring. Minor improvements to channel controller and response classes.

* Add task status batch fetch API and related models

Implemented TaskStatusController with endpoints for fetching single and multiple task statuses. Added request and response models for batch fetch, and refactored TaskStatusContent to TaskStatusResponseContent. Updated ChannelMapper and TasksBatchFetchResponse for improved type consistency.

* Refactor task timestamp and status fields to use Instant and UUID

Updated task request and response DTOs to use Instant for timestamps and UUID for statusId, replacing previous Long and String types. Adjusted related mapping annotations, command objects, and use cases to align with the new field types and naming conventions. Also updated test method names and usages to reflect changes in the mapper interface.

* Enhance API docs and update Maven versioning

Improved OpenAPI documentation for patch endpoints by adding descriptions and @DisplayPatchOperations annotations. Changed batch-fetch for tasks to POST. Added @tag annotations for Task and TaskStatus controllers. Registered TaskPatchUseCase as a Spring service. Updated Maven POM files to use a static 'dev-local-version' instead of timestamp-based versioning.
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