Skip to content

Task application layer#173

Merged
scraft-official merged 9 commits intorelease/2.25from
feature/task-application-layer
Dec 26, 2025
Merged

Task application layer#173
scraft-official merged 9 commits intorelease/2.25from
feature/task-application-layer

Conversation

@scraft-official
Copy link
Copy Markdown
Collaborator

This pull request introduces several enhancements and improvements across the backend API and application layers, focusing on access control, OpenAPI documentation, and cascading deletion logic. The most significant changes include the addition of fine-grained access control methods for tasks, improved OpenAPI documentation for PATCH operations, and enhanced cascading deletion for channels and tasks. There are also minor improvements to code consistency and project metadata.

Access Control Enhancements:

  • Added comprehensive access control methods for tasks in AccessControlService, including methods to check and enforce member access and role access at various levels of granularity. This ensures consistent and secure permission checks for task-related operations. [1] [2] [3]

OpenAPI Documentation Improvements:

  • Introduced an OperationCustomizer bean in OpenApiConfig to dynamically append allowed patch operations to the description of PATCH endpoints using the @DisplayPatchOperations annotation, improving API documentation clarity. [1] [2] F5d6d352L5R5, [3] [4]

Cascading Deletion Logic:

  • Updated SharedDeletionService to handle cascading deletion of tasks when a channel or project is deleted, ensuring related entities are properly cleaned up. This includes calling deleteTaskCascade for each task in a deleted channel. [1] [2] [3] [4]

Consistency and Code Quality Improvements:

  • Replaced manual creation of modification lists with ModificationMeta.emptyList() in patch use cases for channels, organizations, and projects, improving code clarity and reducing potential errors. [1] [2] [3]
  • Made minor improvements to constructors and annotations for better immutability and debugging, such as marking fields as final and adding @ToString and @NonNull where appropriate. [1] [2] [3]

Project Metadata and Build Improvements:

  • Updated Maven project versions to use a timestamp-based versioning scheme (dev-${maven.build.timestamp}) for better traceability of builds. [1] [2]

Added TaskCascadeDeletionMeta and updated SharedDeletionService to handle cascade deletion of tasks when deleting channels. Refactored TaskService to support organization-scoped operations and retrieval of tasks by channel. Modified TaskRepository interface to require organizationId for find and save operations. Removed unused getByProjectId from ChannelService.
Introduces TaskCreateCommand for encapsulating task creation parameters and TaskCreateUseCase for handling the creation logic, including access control and task instantiation. These additions support structured task creation within the application.
Introduces TaskPatchCommand and TaskPatchUseCase to support patching tasks with title, description, priority, timestamps, and status. Extends AccessControlService with task-level access checks and role access methods. Refactors patch use cases for channel, organization, and project to use ModificationMeta.emptyList(). Adds organization validation methods to Task and utility methods to ModificationMeta.
Replaces static version '0.0.1-DEV' with 'dev-${maven.build.timestamp}' in all backend modules for dynamic versioning. Adds maven.build.timestamp.format property. Also updates ProjectController OpenAPI documentation, cleans up PatchRequest, and adjusts TaskRepositoryImpl to accept organizationId.
Introduces the @DisplayPatchOperations annotation and a custom OperationCustomizer to dynamically append allowed patch operations to OpenAPI descriptions. Refactors ProjectController to use the new annotation and updates PatchOperationEnum with utility methods for listing operation names. This improves API documentation clarity and maintainability.
Introduces TaskDeleteCommand and TaskDeleteUseCase for handling task deletion with access control. Updates AccessControlService to grant MANAGE access to task owners, refactors SharedDeletionService to use deleteTaskCascade, and adds ownership checks to Task domain model.
Introduces TaskFetchCommand and TaskFetchUseCase to enable fetching a task with access control checks. Also annotates TaskDeleteUseCase with @service for Spring component scanning.
Introduces TaskBatchFetchCommand and TaskBatchFetchUseCase to support fetching multiple tasks at once with access control checks. Also adds @nonnull annotations to relevant fields in TaskFetchCommand and TaskFetchUseCase.Result for improved null safety.
Introduces TasksInChannelCommand and TasksInChannelUseCase to retrieve all task IDs in a channel with access control. Also makes projectId in ChannelsInProjectCommand final and adds access check in ChannelsInProjectUseCase.
@scraft-official scraft-official added this to the SPRINT 2 milestone Dec 26, 2025
@scraft-official scraft-official linked an issue Dec 26, 2025 that may be closed by this pull request
8 tasks
@scraft-official scraft-official merged commit f175895 into release/2.25 Dec 26, 2025
2 checks passed
scraft-official added a commit that referenced this pull request Jan 4, 2026
* Implement cascade deletion for tasks and channels

Added TaskCascadeDeletionMeta and updated SharedDeletionService to handle cascade deletion of tasks when deleting channels. Refactored TaskService to support organization-scoped operations and retrieval of tasks by channel. Modified TaskRepository interface to require organizationId for find and save operations. Removed unused getByProjectId from ChannelService.

* Add TaskCreateCommand and TaskCreateUseCase classes

Introduces TaskCreateCommand for encapsulating task creation parameters and TaskCreateUseCase for handling the creation logic, including access control and task instantiation. These additions support structured task creation within the application.

* Add task patch use case and enhance access control

Introduces TaskPatchCommand and TaskPatchUseCase to support patching tasks with title, description, priority, timestamps, and status. Extends AccessControlService with task-level access checks and role access methods. Refactors patch use cases for channel, organization, and project to use ModificationMeta.emptyList(). Adds organization validation methods to Task and utility methods to ModificationMeta.

* Update versioning to use maven build timestamp

Replaces static version '0.0.1-DEV' with 'dev-${maven.build.timestamp}' in all backend modules for dynamic versioning. Adds maven.build.timestamp.format property. Also updates ProjectController OpenAPI documentation, cleans up PatchRequest, and adjusts TaskRepositoryImpl to accept organizationId.

* Enhance OpenAPI docs with dynamic patch operations

Introduces the @DisplayPatchOperations annotation and a custom OperationCustomizer to dynamically append allowed patch operations to OpenAPI descriptions. Refactors ProjectController to use the new annotation and updates PatchOperationEnum with utility methods for listing operation names. This improves API documentation clarity and maintainability.

* Add task deletion use case and owner access logic

Introduces TaskDeleteCommand and TaskDeleteUseCase for handling task deletion with access control. Updates AccessControlService to grant MANAGE access to task owners, refactors SharedDeletionService to use deleteTaskCascade, and adds ownership checks to Task domain model.

* Add TaskFetch use case and command implementation

Introduces TaskFetchCommand and TaskFetchUseCase to enable fetching a task with access control checks. Also annotates TaskDeleteUseCase with @service for Spring component scanning.

* Add batch fetch use case for tasks

Introduces TaskBatchFetchCommand and TaskBatchFetchUseCase to support fetching multiple tasks at once with access control checks. Also adds @nonnull annotations to relevant fields in TaskFetchCommand and TaskFetchUseCase.Result for improved null safety.

* Add TasksInChannel use case and command

Introduces TasksInChannelCommand and TasksInChannelUseCase to retrieve all task IDs in a channel with access control. Also makes projectId in ChannelsInProjectCommand final and adds access check in ChannelsInProjectUseCase.
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.

Opracować - Application - Base Actions - Task

2 participants