mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 17:56:46 +00:00
feature/Add the bouble-entry booking system
This commit is contained in:
parent
a625a9debd
commit
12468af3c8
@ -810,6 +810,7 @@ object ToSchemify {
|
||||
MappedBankAccount,
|
||||
BankAccountRouting,
|
||||
MappedTransaction,
|
||||
DoubleEntryBookTransaction,
|
||||
MappedCustomerMessage,
|
||||
MappedBranch,
|
||||
MappedAtm,
|
||||
|
||||
@ -0,0 +1,36 @@
|
||||
package code.model.dataAccess
|
||||
|
||||
import code.util.UUIDString
|
||||
import com.openbankproject.commons.model.{TransactionRequestId => ModelTransactionRequestId, _}
|
||||
import net.liftweb.mapper._
|
||||
|
||||
class DoubleEntryBookTransaction extends DoubleEntryBookTransactionTrait with LongKeyedMapper[DoubleEntryBookTransaction] with IdPK with CreatedUpdated {
|
||||
def getSingleton: DoubleEntryBookTransaction.type = DoubleEntryBookTransaction
|
||||
|
||||
override def transactionRequestId: Option[ModelTransactionRequestId] = {
|
||||
val transactionRequestIdString = TransactionRequestId.get
|
||||
if (transactionRequestIdString.isEmpty) None else Some(ModelTransactionRequestId(transactionRequestIdString))
|
||||
}
|
||||
|
||||
override def debitTransactionId: TransactionId = TransactionId(DebitTransactionId.get)
|
||||
|
||||
override def creditTransactionId: TransactionId = TransactionId(CreditTransactionId.get)
|
||||
|
||||
object TransactionRequestId extends UUIDString(this)
|
||||
|
||||
object DebitTransactionId extends UUIDString(this)
|
||||
|
||||
object CreditTransactionId extends UUIDString(this)
|
||||
|
||||
}
|
||||
|
||||
object DoubleEntryBookTransaction extends DoubleEntryBookTransaction with LongKeyedMetaMapper[DoubleEntryBookTransaction] {
|
||||
|
||||
override def dbIndexes: List[BaseIndex[DoubleEntryBookTransaction]] =
|
||||
UniqueIndex(DebitTransactionId) :: UniqueIndex(CreditTransactionId) :: UniqueIndex(DebitTransactionId, CreditTransactionId) :: super.dbIndexes
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -352,3 +352,9 @@ case class CounterpartyBespoke(
|
||||
case class CustomerDependant(
|
||||
dateOfBirth: Date
|
||||
)
|
||||
|
||||
trait DoubleEntryBookTransactionTrait {
|
||||
def transactionRequestId: Option[TransactionRequestId]
|
||||
def debitTransactionId: TransactionId
|
||||
def creditTransactionId: TransactionId
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user