Prepare BizOne portal production wallet and UI
This commit is contained in:
@ -231,3 +231,60 @@ model CampaignRecipient {
|
||||
@@index([campaignId, sentAt])
|
||||
@@map("campaign_recipients")
|
||||
}
|
||||
|
||||
model Wallet {
|
||||
id String @id @default(uuid())
|
||||
ownerKey String @unique @map("owner_key")
|
||||
currency String @default("IDR")
|
||||
balanceMinor Int @default(0) @map("balance_minor")
|
||||
heldMinor Int @default(0) @map("held_minor")
|
||||
status String @default("active")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
transactions WalletTransaction[]
|
||||
paymentOrders PaymentOrder[]
|
||||
|
||||
@@map("wallets")
|
||||
}
|
||||
|
||||
model WalletTransaction {
|
||||
id String @id @default(uuid())
|
||||
walletId String @map("wallet_id")
|
||||
type String
|
||||
direction String
|
||||
amountMinor Int @map("amount_minor")
|
||||
balanceBeforeMinor Int @map("balance_before_minor")
|
||||
balanceAfterMinor Int @map("balance_after_minor")
|
||||
status String @default("posted")
|
||||
referenceType String? @map("reference_type")
|
||||
referenceId String? @map("reference_id")
|
||||
description String?
|
||||
metadataJson Json? @map("metadata_json")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
wallet Wallet @relation(fields: [walletId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([walletId, createdAt])
|
||||
@@index([referenceType, referenceId])
|
||||
@@map("wallet_transactions")
|
||||
}
|
||||
|
||||
model PaymentOrder {
|
||||
id String @id @default(uuid())
|
||||
walletId String @map("wallet_id")
|
||||
provider String @default("midtrans")
|
||||
providerOrderId String @unique @map("provider_order_id")
|
||||
amountMinor Int @map("amount_minor")
|
||||
currency String @default("IDR")
|
||||
status String @default("pending")
|
||||
snapToken String? @map("snap_token")
|
||||
redirectUrl String? @map("redirect_url")
|
||||
paidAt DateTime? @map("paid_at")
|
||||
expiredAt DateTime? @map("expired_at")
|
||||
metadataJson Json? @map("metadata_json")
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
wallet Wallet @relation(fields: [walletId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@index([walletId, status])
|
||||
@@map("payment_orders")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user