AddWaypointUseCase

class AddWaypointUseCase @Inject constructor(repository: EditTrackRepository)

Use case responsible for adding a new waypoint to a specific track.

This encapsulates the logic required to create a Waypoint and delegate the persistence to the EditTrackRepository.

Constructors

Link copied to clipboard
@Inject
constructor(repository: EditTrackRepository)

Functions

Link copied to clipboard
suspend fun getNextId(trackId: Int, position: InsertPosition?): Double

Get the index of the next waypoint /!\ Only for track edges (no middle points) /!\

Link copied to clipboard
suspend operator fun invoke(lat: Double, lng: Double, id: Double?, trackId: Int, position: InsertPosition?, updateUi: Boolean = false)

Creates and adds a new waypoint to the given track.