- Introduced BetStatStore, BranchStatStore, and WalletStatStore interfaces for handling statistics. - Implemented repository methods for fetching and updating bet, branch, and wallet statistics. - Created reporting services for generating interval reports for bets, branches, companies, and wallets. - Enhanced CSV writing functionality to support dynamic struct to CSV conversion. - Added cron jobs for periodic updates of branch and wallet statistics. - Updated wallet handler to include transaction statistics in the response.
28 lines
732 B
Go
28 lines
732 B
Go
package stats
|
|
|
|
import "github.com/SamuelTariku/FortuneBet-Backend/internal/ports"
|
|
|
|
type Service struct {
|
|
companyStatStore ports.CompanyStatStore
|
|
branchStatStore ports.BranchStatStore
|
|
eventStatStore ports.EventStatStore
|
|
betStatStore ports.BetStatStore
|
|
walletStatStore ports.WalletStatStore
|
|
}
|
|
|
|
func NewService(
|
|
companyStatStore ports.CompanyStatStore,
|
|
branchStatStore ports.BranchStatStore,
|
|
eventStatStore ports.EventStatStore,
|
|
betStatStore ports.BetStatStore,
|
|
walletStatStore ports.WalletStatStore,
|
|
) *Service {
|
|
return &Service{
|
|
companyStatStore: companyStatStore,
|
|
branchStatStore: branchStatStore,
|
|
eventStatStore: eventStatStore,
|
|
betStatStore: betStatStore,
|
|
walletStatStore: walletStatStore,
|
|
}
|
|
}
|