- 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.
17 lines
588 B
Go
17 lines
588 B
Go
package stats
|
|
|
|
import (
|
|
"context"
|
|
"github.com/SamuelTariku/FortuneBet-Backend/internal/domain"
|
|
)
|
|
|
|
func (s *Service) UpdateCompanyStats(ctx context.Context) error {
|
|
return s.companyStatStore.UpdateCompanyStats(ctx)
|
|
}
|
|
func (s *Service) GetCompanyStatByID(ctx context.Context, companyID int64) ([]domain.CompanyStat, error) {
|
|
return s.companyStatStore.GetCompanyStatByID(ctx, companyID)
|
|
}
|
|
func (s *Service) GetCompanyStatsByInterval(ctx context.Context, filter domain.CompanyStatFilter) ([]domain.CompanyStat, error) {
|
|
return s.companyStatStore.GetCompanyStatsByInterval(ctx, filter)
|
|
}
|