Prepare BizOne portal production wallet and UI

This commit is contained in:
2026-05-22 13:13:10 +07:00
parent 36be8607e0
commit 5144207c42
124 changed files with 11034 additions and 7720 deletions

View File

@ -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")
}