Calculate user state from resource events (wip).
[aquarium] / src / main / scala / gr / grnet / aquarium / store / WalletEntryStore.scala
1 package gr.grnet.aquarium.store
2
3 import gr.grnet.aquarium.logic.events.{WalletEntry}
4 import java.util.Date
5 import com.ckkloverdos.maybe.Maybe
6
7 /**
8  * A store for Wallet entries.
9  *
10  * @author Georgios Gousios <gousiosg@gmail.com>
11  * @author Christos KK Loverdos <loverdos@gmail.com>
12  */
13 trait WalletEntryStore {
14
15   def storeWalletEntry(entry: WalletEntry): Maybe[RecordID]
16
17   def findWalletEntryById(id: String): Maybe[WalletEntry]
18
19   def findUserWalletEntries(userId: String): List[WalletEntry]
20
21   def findUserWalletEntriesFromTo(userId: String, from: Date, to: Date): List[WalletEntry]
22
23   /**
24    * Finds latest wallet entries with same timestamp.
25    */
26   def findLatestUserWalletEntries(userId: String): Maybe[List[WalletEntry]]
27 }