Skip to content

Instantly share code, notes, and snippets.

@MkhytarMkhoian
Created May 1, 2024 10:37
Show Gist options
  • Save MkhytarMkhoian/9c1677b0cf0a5ea7f04a6497ba815f67 to your computer and use it in GitHub Desktop.
Save MkhytarMkhoian/9c1677b0cf0a5ea7f04a6497ba815f67 to your computer and use it in GitHub Desktop.
class BuyTicketUseCase(
private val ticketsRepository: TicketsRepository,
private val getFareByIdUseCase: GetFareByIdUseCase,
) {
suspend operator fun invoke(ryderId: String, totalCount: Int) {
val fare = getFareByIdUseCase(ryderId)
ticketsRepository.buyTicket(ryderId = ryderId, fare = fare, totalCount = totalCount)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment