- Added new notification handling in the wallet service to notify admins when wallet balances are low or insufficient. - Created a new file for wallet notifications and moved relevant functions from the wallet service to this new file. - Updated the wallet service to publish wallet events including wallet type. - Refactored the client code to improve readability and maintainability. - Enhanced the bet handler to support pagination and status filtering for bets. - Updated routes and handlers for user search functionality to improve clarity and organization. - Modified cron job scheduling to comment out unused jobs for clarity. - Updated the WebSocket broadcast to include wallet type in notifications. - Adjusted the makefile to include Kafka in the docker-compose setup for local development.
52 lines
3.0 KiB
Go
52 lines
3.0 KiB
Go
package bet
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"github.com/SamuelTariku/FortuneBet-Backend/internal/domain"
|
|
)
|
|
|
|
type BetStore interface {
|
|
CreateBet(ctx context.Context, bet domain.CreateBet) (domain.Bet, error)
|
|
CreateBetOutcome(ctx context.Context, outcomes []domain.CreateBetOutcome) (int64, error)
|
|
CreateFlag(ctx context.Context, flag domain.CreateFlagReq) (domain.Flag, error)
|
|
GetBetByID(ctx context.Context, id int64) (domain.GetBet, error)
|
|
GetAllBets(ctx context.Context, filter domain.BetFilter) ([]domain.GetBet, int64, error)
|
|
GetBetByUserID(ctx context.Context, UserID int64) ([]domain.GetBet, error)
|
|
GetBetByFastCode(ctx context.Context, fastcode string) (domain.GetBet, error)
|
|
GetBetOutcomeByEventID(ctx context.Context, eventID int64, is_filtered bool) ([]domain.BetOutcome, error)
|
|
GetBetOutcomeByBetID(ctx context.Context, betID int64) ([]domain.BetOutcome, error)
|
|
GetBetOutcomeCountByOddID(ctx context.Context, oddID int64) (int64, error)
|
|
GetBetCountByUserID(ctx context.Context, userID int64, outcomesHash string) (int64, error)
|
|
GetBetCountByOutcomesHash(ctx context.Context, outcomesHash string) (int64, error)
|
|
UpdateCashOut(ctx context.Context, id int64, cashedOut bool) error
|
|
UpdateStatus(ctx context.Context, id int64, status domain.OutcomeStatus) error
|
|
UpdateBetOutcomeStatus(ctx context.Context, id int64, status domain.OutcomeStatus) (domain.BetOutcome, error)
|
|
UpdateBetOutcomeStatusByBetID(ctx context.Context, id int64, status domain.OutcomeStatus) (domain.BetOutcome, error)
|
|
UpdateBetOutcomeStatusForEvent(ctx context.Context, eventID int64, status domain.OutcomeStatus) ([]domain.BetOutcome, error)
|
|
|
|
GetBetSummary(ctx context.Context, filter domain.ReportFilter) (
|
|
totalStakes domain.Currency,
|
|
totalBets int64,
|
|
activeBets int64,
|
|
totalWins int64,
|
|
totalLosses int64,
|
|
winBalance domain.Currency,
|
|
err error,
|
|
)
|
|
GetBetStats(ctx context.Context, filter domain.ReportFilter) ([]domain.BetStat, error)
|
|
GetSportPopularity(ctx context.Context, filter domain.ReportFilter) (map[time.Time]string, error)
|
|
GetMarketPopularity(ctx context.Context, filter domain.ReportFilter) (map[time.Time]string, error)
|
|
GetExtremeValues(ctx context.Context, filter domain.ReportFilter) (map[time.Time]domain.ExtremeValues, error)
|
|
GetCustomerBetActivity(ctx context.Context, filter domain.ReportFilter) ([]domain.CustomerBetActivity, error)
|
|
GetCustomerPreferences(ctx context.Context, filter domain.ReportFilter) (map[int64]domain.CustomerPreferences, error)
|
|
GetBranchBetActivity(ctx context.Context, filter domain.ReportFilter) ([]domain.BranchBetActivity, error)
|
|
GetSportBetActivity(ctx context.Context, filter domain.ReportFilter) ([]domain.SportBetActivity, error)
|
|
GetSportDetails(ctx context.Context, filter domain.ReportFilter) (map[string]string, error)
|
|
GetSportMarketPopularity(ctx context.Context, filter domain.ReportFilter) (map[string]string, error)
|
|
|
|
GetBetsForCashback(ctx context.Context) ([]domain.GetBet, error)
|
|
UpdateBetWithCashback(ctx context.Context, betID int64, cashbackStatus bool) error
|
|
}
|