DefaultTransactionService

Default TransactionService implementation.

Author

Jan Müller
class DefaultTransactionService(userRepository: UserRepository,itemRepository: ItemRepository) : TransactionService

Constructors

<init>
Link copied to clipboard
fun <init>(userRepository: UserRepository, itemRepository: ItemRepository)

Functions

equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
getTransactionsOfUser
Link copied to clipboard
Returns all Transactions of the User with the given id. Must validate that the User exists.
open suspend override fun getTransactionsOfUser(userId: String): Result<TransactionList>
hashCode
Link copied to clipboard
open override fun hashCode(): Int
processFunding
Link copied to clipboard
Processes a Funding for the User with the given id. Must validate that the User exists and the Funding is valid.
open suspend override fun processFunding(userId: String, funding: Funding): Result<String>
processPurchase
Link copied to clipboard
Processes a Purchase for the User with the given id. Must validate that the User and Item exist and the Purchase is valid.
open suspend override fun processPurchase(userId: String, purchase: Purchase): Result<String>
refundLastPurchase
Link copied to clipboard
Processes a refund for the User with the given id. Must validate that the User exists and has a refundable Transaction.
open suspend override fun refundLastPurchase(userId: String): Result<String>
toString
Link copied to clipboard
open override fun toString(): String