Skip to content

Commit

Permalink
feat: added db schema for transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
froid1911 committed Mar 15, 2024
1 parent 40a8442 commit 9b06e48
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,36 @@ model RWAPortfolioFixedIncomeTypeOnPortfolio {
@@id([fixedIncomeTypeId, portfolioId, driveId])
}

model RWABaseTransaction {
id String @id @default(uuid())
assetId String
amount Float
entryTime DateTime
tradeTime DateTime
settlementTime DateTime
txRef String
accountId String
counterPartyAccountId String
cashTransactions RWAGroupTransaction[] @relation(name: "cashTransactions")
fixedIncomeTransactions RWAGroupTransaction[] @relation(name: "fixedIncomeTransactions")
feeTransactions RWABaseTransactionOnGroupTransaction[] @relation(name: "feeTransactions")
}

model RWAGroupTransaction {
id String @id @default(uuid())
type String
cashTransaction RWABaseTransaction? @relation(name: "cashTransactions", fields: [cashTransactionId], references: [id])
cashTransactionId String?
fixedIncomeTransaction RWABaseTransaction? @relation(name: "fixedIncomeTransactions", fields: [fixedIncomeTransactionId], references: [id])
fixedIncomeTransactionId String?
feeTransactions RWABaseTransactionOnGroupTransaction[] @relation(name: "feeTransactions")
}

model RWABaseTransactionOnGroupTransaction {
id String @id @default(uuid())
groupTransactionId String
baseTransactionId String
groupTransaction RWAGroupTransaction @relation(name: "feeTransactions", fields: [groupTransactionId], references: [id])
baseTransaction RWABaseTransaction @relation(name: "feeTransactions", fields: [baseTransactionId], references: [id])
}

0 comments on commit 9b06e48

Please sign in to comment.