Skip to content

[FEAT]: Add synchronous POST /api/v1/drive/move endpoint for moving assets and folders #33969

Closed as not planned

Description

@zJaaal

Description

Add a new synchronous REST endpoint to move assets and folders within the drive system.

Endpoint Specification

Path: POST /api/v1/drive/move

Request Body:

{
  "pathToMove": "/destination/path",
  "folders": ["/path/to/folder1", "/path/to/folder2"],
  "assets": ["345", "789"]
}

Response: Success/failure status with moved items details

Implementation Requirements

REST Resource

  • Create DriveResource or extend existing drive resource
  • Implement JAX-RS endpoint following REST API patterns
  • Use proper Swagger/OpenAPI annotations:
    • @Tag at class level
    • @Operation with summary and description
    • @ApiResponses for status codes (200, 400, 401, 403, 404)
    • @RequestBody with schema documentation
    • @Schema matching actual return type

Request Form/View

  • Create immutable request form using @Value.Immutable
  • Required field: pathToMove (destination path)
  • Optional arrays: folders and assets
  • Validate at least one of folders or assets is provided
  • Handle empty arrays gracefully

Business Logic

  • Perform synchronous move operations to destination path
  • Validate permissions for source items and destination path
  • Handle conflicts (duplicate names, invalid paths)
  • Use LocalTransaction.wrapReturn() for atomic operations
  • Proper exception handling (DotDataException, DotSecurityException)

Security & Validation

  • Initialize request context: webResource.init(request, response, true)
  • Validate user permissions for all source folders/assets and destination
  • Sanitize and validate path inputs (source and destination)
  • Validate asset identifiers exist and are accessible
  • Ensure destination path exists

Logging & Error Handling

  • Use Logger.info/error/debug(this, ...)
  • Log operation start/completion with duration
  • Comprehensive error messages without exposing sensitive data

Acceptance Criteria

  • Endpoint moves folders and assets to specified destination path synchronously
  • Proper validation of input paths and asset IDs
  • Permission checks for source items and destination location
  • Atomic operation with rollback on failure
  • Complete Swagger/OpenAPI documentation
  • Integration tests for success and error scenarios
  • Unit tests for validation logic
  • Error handling for edge cases

Activity

  1. changed the title [-]feat: Add synchronous POST /api/v1/drive/move endpoint for moving assets and folders[/-] [+][FEAT]: Add synchronous POST /api/v1/drive/move endpoint for moving assets and folders[/+] on Dec 2, 2025
  2. added theissue type on Dec 2, 2025
  3. changed the issue type fromtoon Dec 2, 2025
  4. github-actions commented on Mar 3, 2026

    @github-actions
    Contributor

    This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.

  5. github-actions commented on Apr 5, 2026

    @github-actions
    Contributor

    This issue was closed because it has been stalled with no activity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions