Yimaru-BackEnd/internal/domain/report.go

301 lines
10 KiB
Go

package domain
import "time"
type DashboardSummary struct {
TotalStakes Currency `json:"total_stakes"`
TotalBets int64 `json:"total_bets"`
ActiveBets int64 `json:"active_bets"`
WinBalance Currency `json:"win_balance"`
TotalWins int64 `json:"total_wins"`
TotalLosses int64 `json:"total_losses"`
CustomerCount int64 `json:"customer_count"`
Profit Currency `json:"profit"`
WinRate float64 `json:"win_rate"`
AverageStake Currency `json:"average_stake"`
TotalDeposits Currency `json:"total_deposits"`
TotalWithdrawals Currency `json:"total_withdrawals"`
ActiveCustomers int64 `json:"active_customers"`
BranchesCount int64 `json:"branches_count"`
ActiveBranches int64 `json:"active_branches"`
TotalCashiers int64 `json:"total_cashiers"`
ActiveCashiers int64 `json:"active_cashiers"`
InactiveCashiers int64 `json:"inactive_cashiers"`
TotalWallets int64 `json:"total_wallets"`
TotalGames int64 `json:"total_games"`
ActiveGames int64 `json:"active_games"`
InactiveGames int64 `json:"inactive_games"`
TotalManagers int64 `json:"total_managers"`
ActiveManagers int64 `json:"active_managers"`
InactiveManagers int64 `json:"inactive_managers"`
InactiveBranches int64 `json:"inactive_branches"`
TotalAdmins int64 `json:"total_admins"`
ActiveAdmins int64 `json:"active_admins"`
InactiveAdmins int64 `json:"inactive_admins"`
TotalCompanies int64 `json:"total_companies"`
ActiveCompanies int64 `json:"active_companies"`
InactiveCompanies int64 `json:"inactive_companies"`
InactiveCustomers int64 `json:"inactive_customers"`
TotalNotifications int64 `json:"total_notifications"`
ReadNotifications int64 `json:"read_notifications"`
UnreadNotifications int64 `json:"unread_notifications"`
}
type CustomerActivity struct {
CustomerID int64 `json:"customer_id"`
CustomerName string `json:"customer_name"`
TotalBets int64 `json:"total_bets"`
TotalStakes Currency `json:"total_stakes"`
TotalWins int64 `json:"total_wins"`
TotalPayouts Currency `json:"total_payouts"`
Profit Currency `json:"profit"`
FirstBetDate time.Time `json:"first_bet_date"`
LastBetDate time.Time `json:"last_bet_date"`
FavoriteSport string `json:"favorite_sport"`
FavoriteMarket string `json:"favorite_market"`
AverageStake Currency `json:"average_stake"`
AverageOdds float64 `json:"average_odds"`
WinRate float64 `json:"win_rate"`
ActivityLevel string `json:"activity_level"` // High, Medium, Low
}
type BranchPerformance struct {
BranchID int64 `json:"branch_id"`
BranchName string `json:"branch_name"`
Location string `json:"location"`
ManagerName string `json:"manager_name"`
TotalBets int64 `json:"total_bets"`
TotalStakes Currency `json:"total_stakes"`
TotalWins int64 `json:"total_wins"`
TotalPayouts Currency `json:"total_payouts"`
Profit Currency `json:"profit"`
CustomerCount int64 `json:"customer_count"`
Deposits Currency `json:"deposits"`
Withdrawals Currency `json:"withdrawals"`
WinRate float64 `json:"win_rate"`
AverageStake Currency `json:"average_stake"`
PerformanceScore float64 `json:"performance_score"`
}
type SportPerformance struct {
SportID string `json:"sport_id"`
SportName string `json:"sport_name"`
TotalBets int64 `json:"total_bets"`
TotalStakes Currency `json:"total_stakes"`
TotalWins int64 `json:"total_wins"`
TotalPayouts Currency `json:"total_payouts"`
Profit Currency `json:"profit"`
PopularityRank int `json:"popularity_rank"`
WinRate float64 `json:"win_rate"`
AverageStake Currency `json:"average_stake"`
AverageOdds float64 `json:"average_odds"`
MostPopularMarket string `json:"most_popular_market"`
}
type BetAnalysis struct {
Date time.Time `json:"date"`
TotalBets int64 `json:"total_bets"`
TotalStakes Currency `json:"total_stakes"`
TotalWins int64 `json:"total_wins"`
TotalPayouts Currency `json:"total_payouts"`
Profit Currency `json:"profit"`
MostPopularSport string `json:"most_popular_sport"`
MostPopularMarket string `json:"most_popular_market"`
HighestStake Currency `json:"highest_stake"`
HighestPayout Currency `json:"highest_payout"`
AverageOdds float64 `json:"average_odds"`
}
type ValidOutcomeStatus struct {
Value OutcomeStatus
Valid bool // Valid is true if Value is not NULL
}
// ReportFilter contains filters for report generation
type ReportFilter struct {
StartTime ValidTime `json:"start_time"`
EndTime ValidTime `json:"end_time"`
CompanyID ValidInt64 `json:"company_id"`
BranchID ValidInt64 `json:"branch_id"`
RecipientID ValidInt64 `json:"recipient_id"`
UserID ValidInt64 `json:"user_id"`
SportID ValidString `json:"sport_id"`
Status ValidOutcomeStatus `json:"status"`
}
// BetStat represents aggregated bet statistics
type BetStat struct {
Date time.Time
TotalBets int64
TotalStakes Currency
TotalWins int64
TotalPayouts Currency
AverageOdds float64
}
// ExtremeValues represents extreme values in betting
type ExtremeValues struct {
HighestStake Currency
HighestPayout Currency
}
// CustomerBetActivity represents customer betting activity
type CustomerBetActivity struct {
CustomerID int64
TotalBets int64
TotalStakes Currency
TotalWins int64
TotalPayouts Currency
FirstBetDate time.Time
LastBetDate time.Time
AverageOdds float64
}
// BranchBetActivity represents branch betting activity
type BranchBetActivity struct {
BranchID int64
TotalBets int64
TotalStakes Currency
TotalWins int64
TotalPayouts Currency
}
// BranchDetail represents branch details
// type BranchDetail struct {
// Name string
// Location string
// ManagerName string
// }
// BranchTransactions represents branch transaction totals
type BranchTransactions struct {
Deposits Currency
Withdrawals Currency
}
// SportBetActivity represents sport betting activity
type SportBetActivity struct {
SportID string
TotalBets int64
TotalStakes Currency
TotalWins int64
TotalPayouts Currency
AverageOdds float64
}
// CustomerDetail represents customer details
type CustomerDetail struct {
Name string
}
// BalanceSummary represents wallet balance summary
type BalanceSummary struct {
TotalBalance Currency
ActiveBalance Currency
InactiveBalance Currency
BettableBalance Currency
NonBettableBalance Currency
}
// In your domain package
type CustomerPreferences struct {
FavoriteSport string `json:"favorite_sport"`
FavoriteMarket string `json:"favorite_market"`
}
// type DashboardSummary struct {
// TotalStakes Currency `json:"total_stakes"`
// TotalBets int64 `json:"total_bets"`
// ActiveBets int64 `json:"active_bets"`
// WinBalance Currency `json:"win_balance"`
// TotalWins int64 `json:"total_wins"`
// TotalLosses int64 `json:"total_losses"`
// CustomerCount int64 `json:"customer_count"`
// Profit Currency `json:"profit"`
// WinRate float64 `json:"win_rate"`
// AverageStake Currency `json:"average_stake"`
// TotalDeposits Currency `json:"total_deposits"`
// TotalWithdrawals Currency `json:"total_withdrawals"`
// ActiveCustomers int64 `json:"active_customers"`
// BranchesCount int64 `json:"branches_count"`
// ActiveBranches int64 `json:"active_branches"`
// }
type ErrorResponse struct {
Message string `json:"message"`
Error string `json:"error,omitempty"`
}
type NotificationReport struct {
CountsByType []NotificationTypeCount `json:"counts_by_type"`
DeliveryStats NotificationDeliveryStats `json:"delivery_stats"`
ActiveRecipients []ActiveNotificationRecipient `json:"active_recipients"`
}
type NotificationTypeCount struct {
Type string `json:"type"`
Total int64 `json:"total"`
Read int64 `json:"read"`
Unread int64 `json:"unread"`
}
type NotificationDeliveryStats struct {
TotalSent int64 `json:"total_sent"`
FailedDeliveries int64 `json:"failed_deliveries"`
SuccessRate float64 `json:"success_rate"`
MostUsedChannel string `json:"most_used_channel"`
}
type ActiveNotificationRecipient struct {
RecipientID int64 `json:"recipient_id"`
RecipientName string `json:"recipient_name"`
NotificationCount int64 `json:"notification_count"`
LastNotificationTime time.Time `json:"last_notification_time"`
}
type CompanyPerformance struct {
CompanyID int64 `json:"company_id"`
CompanyName string `json:"company_name"`
ContactEmail string `json:"contact_email"`
TotalBets int64 `json:"total_bets"`
TotalStakes Currency `json:"total_stakes"`
TotalWins int64 `json:"total_wins"`
TotalPayouts Currency `json:"total_payouts"`
Profit Currency `json:"profit"`
WinRate float64 `json:"win_rate"`
AverageStake Currency `json:"average_stake"`
TotalBranches int64 `json:"total_branches"`
ActiveBranches int64 `json:"active_branches"`
TotalCashiers int64 `json:"total_cashiers"`
ActiveCashiers int64 `json:"active_cashiers"`
WalletBalance Currency `json:"wallet_balance"`
LastActivity time.Time `json:"last_activity"`
}
type CashierPerformance struct {
CashierID int64 `json:"cashier_id"`
CashierName string `json:"cashier_name"`
BranchID int64 `json:"branch_id"`
BranchName string `json:"branch_name"`
CompanyID int64 `json:"company_id"`
TotalBets int64 `json:"total_bets"`
TotalStakes Currency `json:"total_stakes"`
TotalWins int64 `json:"total_wins"`
TotalPayouts Currency `json:"total_payouts"`
Profit Currency `json:"profit"`
WinRate float64 `json:"win_rate"`
AverageStake Currency `json:"average_stake"`
Deposits Currency `json:"deposits"`
Withdrawals Currency `json:"withdrawals"`
NetTransactionAmount Currency `json:"net_transaction_amount"`
FirstActivity time.Time `json:"first_activity"`
LastActivity time.Time `json:"last_activity"`
ActiveDays int `json:"active_days"`
}