Skip to content

Implement a GET endpoint to retrieve all tours that given task is linked to #557

Description

@solenuk

As an Org or Admin I want to see every tour a task is linked to, with each tour's title and description so that I can check where a task is already used from its detail page.

Assumptions & Constraints

  • This needs a new response DTO, TaskTourResponseDTO for now, with tourId, title, description, location and executionStatus.
  • Tour title and description come from the competition facade.
  • Since this is meant to be called from that same detail page, the task's owner or an ADMIN or ORG can call it.

Preconditions

  1. TaskAssignmentRepository already exists and can look up assignments by task id.
  2. The competition facade exposes tour title and description for a given tour id.

Business rules

  1. The endpoint returns one entry per tour the task is linked to.
  2. Only an ADMIN or ORG can call this endpoint.
  3. A request for a task id that doesn't exist results in a 404.
  4. A task with no assignments returns an empty list, not an error.

Acceptance Criteria

  • A GET endpoint accepts a task id and returns every tour that task is linked to.
  • Each entry includes the tour's id, title, description, location and executionStatus
  • A task with no assignments returns an empty list.
  • A request for a nonexistent task id returns a 404.
  • A user who isn't an ADMIN or ORG, is rejected with a 403.

Out of scope

  • Any assignment specific fields, like visibility or requirements, this endpoint is about tours, not assignment detail.
  • Any change to the existing get by tour endpoint.

Epic link
Epic #385 - EPIC: Tasks linkage to tours

Tasks

  • Add TaskTourResponseDTO with tourId, title, description, location and executionStatus
  • Add a repository method to find all assignments for a given task id.
  • Add the service method that resolves each tour's title and description through the competition facade and builds the response list.
  • Add the GET endpoint, restricted the same way as getTaskById.
  • Confirm the empty list, 404, and 403 cases behave as expected.

Activity

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

Metadata

Metadata

Assignees

Type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions