Class RaceServiceMain

java.lang.Object
com.endurancetrio.business.event.service.RaceServiceMain
All Implemented Interfaces:
RaceService

@Service public class RaceServiceMain extends Object implements RaceService
  • Constructor Details

  • Method Details

    • getNonDerivedRacesWithMostRecentAddedResults

      @Cacheable(value="nonDerivedRecentRacesWithMostRecentAddedResults", key="#pageable.pageNumber + \'-\' + #pageable.pageSize") @Transactional(readOnly=true) public org.springframework.data.domain.Page<RaceDTO> getNonDerivedRacesWithMostRecentAddedResults(org.springframework.data.domain.Pageable pageable)
      Description copied from interface: RaceService
      Returns a Page of the most recent non-derived races that have at least one result recorded in the database.

      Derived race types (INDIVIDUAL_DERIVED, TEAM_RELAY_DERIVED, MIXED_RELAY_DERIVED) are excluded. Results are ordered by the most recent result creation date descending.

      Specified by:
      getNonDerivedRacesWithMostRecentAddedResults in interface RaceService
      Parameters:
      pageable - the pagination information
      Returns:
      a Page of races
    • getRaceResults

      @Cacheable(value="raceResults", key="#race.id()") @Transactional(readOnly=true) public RaceResultsDTO getRaceResults(RaceDTO race)
      Description copied from interface: RaceService
      Returns a RaceResultsDTO containing the results of the given race, grouped by AgeGroup. The results include individual, team, or relay entries depending on the race's type group, each enriched with computed time gaps relative to the overall winner.
      Specified by:
      getRaceResults in interface RaceService
      Parameters:
      race - the race whose results are to be retrieved
      Returns:
      a RaceResultsDTO with the race results