Skip to content

[US-033][BE] EcoPoint detail endpoint — full profile with opening hours and contact #68

@matix0

Description

@matix0

User Story ID

US-033

Type

BE — Backend

Epic

EP-003 — EcoPoint Location & Discovery

Feature

F-011

User Story

As a user, I want to view detailed information about an EcoPoint so that I know what to expect.

Acceptance Criteria

  • GET /api/ecopoints/:id returns the full EcoPoint document for the given ID
  • Response includes: id, name, address, coordinates, phone, operatingHours (structured by day), acceptedMaterials, status, photos (array of URLs, nullable), createdAt, updatedAt
  • Returns HTTP 404 with descriptive message when EcoPoint is not found
  • Returns HTTP 400 when :id is not a valid MongoDB ObjectId
  • isActive: false EcoPoints are excluded (return 404 rather than exposing soft-deleted records)
  • Endpoint protected with requireAuth
  • Response follows the standard { success, data, message } envelope

Priority (MoSCoW)

🔴 Critical — Must Have

Story Points

3

Planned Sprint

Sprint 4

Technical Notes

  • Endpoint: GET /api/ecopoints/:id
  • Spring Boot: EcoPointController.getById()EcoPointService.findByIdAndIsActiveTrue(id)EcoPointRepository
  • DTO: EcoPointDetailDTO — full projection including all fields listed in acceptance criteria
  • operatingHours modelled as Map<String, OperatingHoursEntry> or embedded document { open: "08:00", close: "18:00", closed: false } per day
  • Depends on: US-098 BE (EcoPoint model must exist)

Definition of Done

  • Code implemented and PR approved
  • Integration tests: valid ID (200), non-existent ID (404), invalid ObjectId format (400), inactive EcoPoint (404)
  • Swagger updated with full EcoPointDetailDTO schema
  • No lint errors
  • Tested locally

Suggested Assignee

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions