1 package gr.grnet.aquarium.store
3 import gr.grnet.aquarium.logic.events.{WalletEntry}
5 import com.ckkloverdos.maybe.Maybe
8 * A store for Wallet entries.
10 * @author Georgios Gousios <gousiosg@gmail.com>
11 * @author Christos KK Loverdos <loverdos@gmail.com>
13 trait WalletEntryStore {
15 def storeWalletEntry(entry: WalletEntry): Maybe[RecordID]
17 def findWalletEntryById(id: String): Maybe[WalletEntry]
19 def findUserWalletEntries(userId: String): List[WalletEntry]
21 def findUserWalletEntriesFromTo(userId: String, from: Date, to: Date): List[WalletEntry]
24 * Finds latest wallet entries with same timestamp.
26 def findLatestUserWalletEntries(userId: String): Maybe[List[WalletEntry]]
29 * Find the previous entry in the user's wallet for the provided resource
32 def findPreviousEntry(userId: String, resource: String,
33 instanceId: String, finalized: Option[Boolean]): List[WalletEntry]
35 def findWalletEntriesAfter(userId: String, from: Date): List[WalletEntry]