Class EventServiceMain

java.lang.Object
com.endurancetrio.business.event.service.EventServiceMain
All Implemented Interfaces:
EventService

@Service public class EventServiceMain extends Object implements EventService
  • Constructor Details

  • Method Details

    • getEventYears

      @Transactional(readOnly=true) public List<Integer> getEventYears()
      Description copied from interface: EventService
      Returns a list of all distinct years extracted from the events' start dates, ordered descending. This is used by YearsWithEventsDTO to drive the year-browser pagination on the events landing page.
      Specified by:
      getEventYears in interface EventService
      Returns:
      a list of distinct event years in descending order
    • getEventsByYear

      @Transactional(readOnly=true) public EventsPageDTO getEventsByYear(int year, org.springframework.data.domain.Pageable pageable)
      Description copied from interface: EventService
      Returns an EventsPageDTO containing the events whose start date falls within the given year, ordered by start date descending and paginated according to the given Pageable.
      Specified by:
      getEventsByYear in interface EventService
      Parameters:
      year - the year to filter events by
      pageable - the pagination information (page number, page size, etc.)
      Returns:
      an EventsPageDTO with the events for the given year and pagination metadata
    • getEventOverview

      @Cacheable(value="eventOverview", key="#id + \'-\' + #year") @Transactional(readOnly=true) public EventOverviewDTO getEventOverview(Long id, int year)
      Description copied from interface: EventService
      Returns an EventOverviewDTO containing the summary details of the event identified by the given id and belonging to the given year, including its organizers and races.
      Specified by:
      getEventOverview in interface EventService
      Parameters:
      id - the unique identifier of the event
      year - the year the event belongs to
      Returns:
      an EventOverviewDTO with the event overview
    • getMostRecentAddedEvents

      @Cacheable(value="mostRecentAddedEvents", key="#pageable.pageNumber + \'-\' + #pageable.pageSize") @Transactional(readOnly=true) public EventsPageDTO getMostRecentAddedEvents(org.springframework.data.domain.Pageable pageable)
      Description copied from interface: EventService
      Returns an EventsPageDTO containing the most recently added events, ordered by their creation timestamp descending. Courses are eagerly fetched to derive sport codes without additional queries.
      Specified by:
      getMostRecentAddedEvents in interface EventService
      Parameters:
      pageable - the pagination information; use PageRequest.of(0, limit) to retrieve the most recent N events
      Returns:
      an EventsPageDTO with the most recently added events and pagination metadata