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)
	GetBetByCashoutID(ctx context.Context, id string) (domain.GetBet, error)
	GetBetByID(ctx context.Context, id int64) (domain.GetBet, error)
	GetAllBets(ctx context.Context, filter domain.BetFilter) ([]domain.GetBet, error)
	GetBetByBranchID(ctx context.Context, BranchID int64) ([]domain.GetBet, error)
	GetBetByUserID(ctx context.Context, UserID int64) ([]domain.GetBet, error)
	GetBetOutcomeByEventID(ctx context.Context, eventID int64) ([]domain.BetOutcome, error)
	GetBetOutcomeByBetID(ctx context.Context, betID int64) ([]domain.BetOutcome, 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)
	DeleteBet(ctx context.Context, id int64) 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)
}
