// Code generated by sqlc. DO NOT EDIT.
// versions:
//   sqlc v1.29.0

package dbgen

import (
	"database/sql/driver"
	"fmt"

	"github.com/jackc/pgx/v5/pgtype"
)

type Referralstatus string

const (
	ReferralstatusPENDING   Referralstatus = "PENDING"
	ReferralstatusCOMPLETED Referralstatus = "COMPLETED"
	ReferralstatusEXPIRED   Referralstatus = "EXPIRED"
	ReferralstatusCANCELLED Referralstatus = "CANCELLED"
)

func (e *Referralstatus) Scan(src interface{}) error {
	switch s := src.(type) {
	case []byte:
		*e = Referralstatus(s)
	case string:
		*e = Referralstatus(s)
	default:
		return fmt.Errorf("unsupported scan type for Referralstatus: %T", src)
	}
	return nil
}

type NullReferralstatus struct {
	Referralstatus Referralstatus `json:"referralstatus"`
	Valid          bool           `json:"valid"` // Valid is true if Referralstatus is not NULL
}

// Scan implements the Scanner interface.
func (ns *NullReferralstatus) Scan(value interface{}) error {
	if value == nil {
		ns.Referralstatus, ns.Valid = "", false
		return nil
	}
	ns.Valid = true
	return ns.Referralstatus.Scan(value)
}

// Value implements the driver Valuer interface.
func (ns NullReferralstatus) Value() (driver.Value, error) {
	if !ns.Valid {
		return nil, nil
	}
	return string(ns.Referralstatus), nil
}

type Bet struct {
	ID           int64            `json:"id"`
	Amount       int64            `json:"amount"`
	TotalOdds    float32          `json:"total_odds"`
	Status       int32            `json:"status"`
	FullName     string           `json:"full_name"`
	PhoneNumber  string           `json:"phone_number"`
	CompanyID    pgtype.Int8      `json:"company_id"`
	BranchID     pgtype.Int8      `json:"branch_id"`
	UserID       pgtype.Int8      `json:"user_id"`
	CashedOut    bool             `json:"cashed_out"`
	CashoutID    string           `json:"cashout_id"`
	CreatedAt    pgtype.Timestamp `json:"created_at"`
	UpdatedAt    pgtype.Timestamp `json:"updated_at"`
	IsShopBet    bool             `json:"is_shop_bet"`
	OutcomesHash string           `json:"outcomes_hash"`
}

type BetOutcome struct {
	ID           int64            `json:"id"`
	BetID        int64            `json:"bet_id"`
	SportID      int64            `json:"sport_id"`
	EventID      int64            `json:"event_id"`
	OddID        int64            `json:"odd_id"`
	HomeTeamName string           `json:"home_team_name"`
	AwayTeamName string           `json:"away_team_name"`
	MarketID     int64            `json:"market_id"`
	MarketName   string           `json:"market_name"`
	Odd          float32          `json:"odd"`
	OddName      string           `json:"odd_name"`
	OddHeader    string           `json:"odd_header"`
	OddHandicap  string           `json:"odd_handicap"`
	Status       int32            `json:"status"`
	Expires      pgtype.Timestamp `json:"expires"`
}

type BetWithOutcome struct {
	ID           int64            `json:"id"`
	Amount       int64            `json:"amount"`
	TotalOdds    float32          `json:"total_odds"`
	Status       int32            `json:"status"`
	FullName     string           `json:"full_name"`
	PhoneNumber  string           `json:"phone_number"`
	CompanyID    pgtype.Int8      `json:"company_id"`
	BranchID     pgtype.Int8      `json:"branch_id"`
	UserID       pgtype.Int8      `json:"user_id"`
	CashedOut    bool             `json:"cashed_out"`
	CashoutID    string           `json:"cashout_id"`
	CreatedAt    pgtype.Timestamp `json:"created_at"`
	UpdatedAt    pgtype.Timestamp `json:"updated_at"`
	IsShopBet    bool             `json:"is_shop_bet"`
	OutcomesHash string           `json:"outcomes_hash"`
	Outcomes     []BetOutcome     `json:"outcomes"`
}

type Branch struct {
	ID              int64            `json:"id"`
	Name            string           `json:"name"`
	Location        string           `json:"location"`
	IsActive        bool             `json:"is_active"`
	WalletID        int64            `json:"wallet_id"`
	BranchManagerID int64            `json:"branch_manager_id"`
	CompanyID       int64            `json:"company_id"`
	IsSelfOwned     bool             `json:"is_self_owned"`
	CreatedAt       pgtype.Timestamp `json:"created_at"`
	UpdatedAt       pgtype.Timestamp `json:"updated_at"`
}

type BranchCashier struct {
	ID       int64 `json:"id"`
	UserID   int64 `json:"user_id"`
	BranchID int64 `json:"branch_id"`
}

type BranchDetail struct {
	ID                 int64            `json:"id"`
	Name               string           `json:"name"`
	Location           string           `json:"location"`
	IsActive           bool             `json:"is_active"`
	WalletID           int64            `json:"wallet_id"`
	BranchManagerID    int64            `json:"branch_manager_id"`
	CompanyID          int64            `json:"company_id"`
	IsSelfOwned        bool             `json:"is_self_owned"`
	CreatedAt          pgtype.Timestamp `json:"created_at"`
	UpdatedAt          pgtype.Timestamp `json:"updated_at"`
	ManagerName        interface{}      `json:"manager_name"`
	ManagerPhoneNumber pgtype.Text      `json:"manager_phone_number"`
	Balance            pgtype.Int8      `json:"balance"`
}

type BranchOperation struct {
	ID          int64            `json:"id"`
	OperationID int64            `json:"operation_id"`
	BranchID    int64            `json:"branch_id"`
	CreatedAt   pgtype.Timestamp `json:"created_at"`
	UpdatedAt   pgtype.Timestamp `json:"updated_at"`
}

type CompaniesDetail struct {
	ID               int64       `json:"id"`
	Name             string      `json:"name"`
	AdminID          int64       `json:"admin_id"`
	WalletID         int64       `json:"wallet_id"`
	Balance          int64       `json:"balance"`
	IsActive         bool        `json:"is_active"`
	AdminFirstName   string      `json:"admin_first_name"`
	AdminLastName    string      `json:"admin_last_name"`
	AdminPhoneNumber pgtype.Text `json:"admin_phone_number"`
}

type Company struct {
	ID       int64  `json:"id"`
	Name     string `json:"name"`
	AdminID  int64  `json:"admin_id"`
	WalletID int64  `json:"wallet_id"`
}

type CustomerWallet struct {
	ID              int64            `json:"id"`
	CustomerID      int64            `json:"customer_id"`
	RegularWalletID int64            `json:"regular_wallet_id"`
	StaticWalletID  int64            `json:"static_wallet_id"`
	CreatedAt       pgtype.Timestamp `json:"created_at"`
	UpdatedAt       pgtype.Timestamp `json:"updated_at"`
}

type Event struct {
	ID           string           `json:"id"`
	SportID      pgtype.Int4      `json:"sport_id"`
	MatchName    pgtype.Text      `json:"match_name"`
	HomeTeam     pgtype.Text      `json:"home_team"`
	AwayTeam     pgtype.Text      `json:"away_team"`
	HomeTeamID   pgtype.Int4      `json:"home_team_id"`
	AwayTeamID   pgtype.Int4      `json:"away_team_id"`
	HomeKitImage pgtype.Text      `json:"home_kit_image"`
	AwayKitImage pgtype.Text      `json:"away_kit_image"`
	LeagueID     pgtype.Int4      `json:"league_id"`
	LeagueName   pgtype.Text      `json:"league_name"`
	LeagueCc     pgtype.Text      `json:"league_cc"`
	StartTime    pgtype.Timestamp `json:"start_time"`
	Score        pgtype.Text      `json:"score"`
	MatchMinute  pgtype.Int4      `json:"match_minute"`
	TimerStatus  pgtype.Text      `json:"timer_status"`
	AddedTime    pgtype.Int4      `json:"added_time"`
	MatchPeriod  pgtype.Int4      `json:"match_period"`
	IsLive       pgtype.Bool      `json:"is_live"`
	Status       pgtype.Text      `json:"status"`
	FetchedAt    pgtype.Timestamp `json:"fetched_at"`
	Source       pgtype.Text      `json:"source"`
}

type ExchangeRate struct {
	ID           int32            `json:"id"`
	FromCurrency string           `json:"from_currency"`
	ToCurrency   string           `json:"to_currency"`
	Rate         pgtype.Numeric   `json:"rate"`
	ValidUntil   pgtype.Timestamp `json:"valid_until"`
	CreatedAt    pgtype.Timestamp `json:"created_at"`
}

type League struct {
	ID          int64       `json:"id"`
	Name        string      `json:"name"`
	CountryCode pgtype.Text `json:"country_code"`
	Bet365ID    pgtype.Int4 `json:"bet365_id"`
	SportID     int32       `json:"sport_id"`
	IsActive    pgtype.Bool `json:"is_active"`
}

type Notification struct {
	ID              string             `json:"id"`
	RecipientID     int64              `json:"recipient_id"`
	Type            string             `json:"type"`
	Level           string             `json:"level"`
	ErrorSeverity   pgtype.Text        `json:"error_severity"`
	Reciever        string             `json:"reciever"`
	IsRead          bool               `json:"is_read"`
	DeliveryStatus  string             `json:"delivery_status"`
	DeliveryChannel pgtype.Text        `json:"delivery_channel"`
	Payload         []byte             `json:"payload"`
	Priority        pgtype.Int4        `json:"priority"`
	Version         int32              `json:"version"`
	Timestamp       pgtype.Timestamptz `json:"timestamp"`
	Metadata        []byte             `json:"metadata"`
}

type Odd struct {
	ID             int32            `json:"id"`
	EventID        pgtype.Text      `json:"event_id"`
	Fi             pgtype.Text      `json:"fi"`
	MarketType     string           `json:"market_type"`
	MarketName     pgtype.Text      `json:"market_name"`
	MarketCategory pgtype.Text      `json:"market_category"`
	MarketID       pgtype.Text      `json:"market_id"`
	Name           pgtype.Text      `json:"name"`
	Handicap       pgtype.Text      `json:"handicap"`
	OddsValue      pgtype.Float8    `json:"odds_value"`
	Section        string           `json:"section"`
	Category       pgtype.Text      `json:"category"`
	RawOdds        []byte           `json:"raw_odds"`
	FetchedAt      pgtype.Timestamp `json:"fetched_at"`
	Source         pgtype.Text      `json:"source"`
	IsActive       pgtype.Bool      `json:"is_active"`
}

type Otp struct {
	ID        int64              `json:"id"`
	SentTo    string             `json:"sent_to"`
	Medium    string             `json:"medium"`
	OtpFor    string             `json:"otp_for"`
	Otp       string             `json:"otp"`
	Used      bool               `json:"used"`
	UsedAt    pgtype.Timestamptz `json:"used_at"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	ExpiresAt pgtype.Timestamptz `json:"expires_at"`
}

type Referral struct {
	ID             int64              `json:"id"`
	ReferralCode   string             `json:"referral_code"`
	ReferrerID     string             `json:"referrer_id"`
	ReferredID     pgtype.Text        `json:"referred_id"`
	Status         Referralstatus     `json:"status"`
	RewardAmount   pgtype.Numeric     `json:"reward_amount"`
	CashbackAmount pgtype.Numeric     `json:"cashback_amount"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
	UpdatedAt      pgtype.Timestamptz `json:"updated_at"`
	ExpiresAt      pgtype.Timestamptz `json:"expires_at"`
}

type ReferralSetting struct {
	ID                         int64              `json:"id"`
	ReferralRewardAmount       pgtype.Numeric     `json:"referral_reward_amount"`
	CashbackPercentage         pgtype.Numeric     `json:"cashback_percentage"`
	BetReferralBonusPercentage pgtype.Numeric     `json:"bet_referral_bonus_percentage"`
	MaxReferrals               int32              `json:"max_referrals"`
	ExpiresAfterDays           int32              `json:"expires_after_days"`
	UpdatedBy                  string             `json:"updated_by"`
	CreatedAt                  pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                  pgtype.Timestamptz `json:"updated_at"`
	Version                    int32              `json:"version"`
}

type RefreshToken struct {
	ID        int64              `json:"id"`
	UserID    int64              `json:"user_id"`
	Token     string             `json:"token"`
	ExpiresAt pgtype.Timestamptz `json:"expires_at"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	Revoked   bool               `json:"revoked"`
}

type Result struct {
	ID            int64            `json:"id"`
	BetOutcomeID  int64            `json:"bet_outcome_id"`
	EventID       int64            `json:"event_id"`
	OddID         int64            `json:"odd_id"`
	MarketID      int64            `json:"market_id"`
	Status        int32            `json:"status"`
	Score         pgtype.Text      `json:"score"`
	FullTimeScore pgtype.Text      `json:"full_time_score"`
	HalfTimeScore pgtype.Text      `json:"half_time_score"`
	Ss            pgtype.Text      `json:"ss"`
	CreatedAt     pgtype.Timestamp `json:"created_at"`
	UpdatedAt     pgtype.Timestamp `json:"updated_at"`
}

type SupportedOperation struct {
	ID          int64  `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type Team struct {
	ID       string      `json:"id"`
	TeamName string      `json:"team_name"`
	Country  pgtype.Text `json:"country"`
	Bet365ID pgtype.Int4 `json:"bet365_id"`
	LogoUrl  pgtype.Text `json:"logo_url"`
}

type Ticket struct {
	ID        int64            `json:"id"`
	Amount    int64            `json:"amount"`
	TotalOdds float32          `json:"total_odds"`
	Ip        string           `json:"ip"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
}

type TicketOutcome struct {
	ID           int64            `json:"id"`
	TicketID     int64            `json:"ticket_id"`
	EventID      int64            `json:"event_id"`
	OddID        int64            `json:"odd_id"`
	HomeTeamName string           `json:"home_team_name"`
	AwayTeamName string           `json:"away_team_name"`
	MarketID     int64            `json:"market_id"`
	MarketName   string           `json:"market_name"`
	Odd          float32          `json:"odd"`
	OddName      string           `json:"odd_name"`
	OddHeader    string           `json:"odd_header"`
	OddHandicap  string           `json:"odd_handicap"`
	Status       int32            `json:"status"`
	Expires      pgtype.Timestamp `json:"expires"`
}

type TicketWithOutcome struct {
	ID        int64            `json:"id"`
	Amount    int64            `json:"amount"`
	TotalOdds float32          `json:"total_odds"`
	Ip        string           `json:"ip"`
	CreatedAt pgtype.Timestamp `json:"created_at"`
	UpdatedAt pgtype.Timestamp `json:"updated_at"`
	Outcomes  []TicketOutcome  `json:"outcomes"`
}

type Transaction struct {
	ID               int64            `json:"id"`
	Amount           int64            `json:"amount"`
	BranchID         int64            `json:"branch_id"`
	CompanyID        pgtype.Int8      `json:"company_id"`
	CashierID        pgtype.Int8      `json:"cashier_id"`
	CashierName      pgtype.Text      `json:"cashier_name"`
	BetID            pgtype.Int8      `json:"bet_id"`
	NumberOfOutcomes pgtype.Int8      `json:"number_of_outcomes"`
	Type             pgtype.Int8      `json:"type"`
	PaymentOption    pgtype.Int8      `json:"payment_option"`
	FullName         pgtype.Text      `json:"full_name"`
	PhoneNumber      pgtype.Text      `json:"phone_number"`
	BankCode         pgtype.Text      `json:"bank_code"`
	BeneficiaryName  pgtype.Text      `json:"beneficiary_name"`
	AccountName      pgtype.Text      `json:"account_name"`
	AccountNumber    pgtype.Text      `json:"account_number"`
	ReferenceNumber  pgtype.Text      `json:"reference_number"`
	Verified         bool             `json:"verified"`
	ApprovedBy       pgtype.Int8      `json:"approved_by"`
	ApproverName     pgtype.Text      `json:"approver_name"`
	BranchLocation   pgtype.Text      `json:"branch_location"`
	BranchName       pgtype.Text      `json:"branch_name"`
	CreatedAt        pgtype.Timestamp `json:"created_at"`
	UpdatedAt        pgtype.Timestamp `json:"updated_at"`
}

type User struct {
	ID            int64              `json:"id"`
	FirstName     string             `json:"first_name"`
	LastName      string             `json:"last_name"`
	Email         pgtype.Text        `json:"email"`
	PhoneNumber   pgtype.Text        `json:"phone_number"`
	Role          string             `json:"role"`
	Password      []byte             `json:"password"`
	EmailVerified bool               `json:"email_verified"`
	PhoneVerified bool               `json:"phone_verified"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
	CompanyID     pgtype.Int8        `json:"company_id"`
	SuspendedAt   pgtype.Timestamptz `json:"suspended_at"`
	Suspended     bool               `json:"suspended"`
	ReferralCode  pgtype.Text        `json:"referral_code"`
	ReferredBy    pgtype.Text        `json:"referred_by"`
}

type UserGameInteraction struct {
	ID              int64              `json:"id"`
	UserID          int64              `json:"user_id"`
	GameID          int64              `json:"game_id"`
	InteractionType string             `json:"interaction_type"`
	Amount          pgtype.Numeric     `json:"amount"`
	DurationSeconds pgtype.Int4        `json:"duration_seconds"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
}

type VirtualGame struct {
	ID              int64              `json:"id"`
	Name            string             `json:"name"`
	Provider        string             `json:"provider"`
	Category        pgtype.Text        `json:"category"`
	MinBet          pgtype.Numeric     `json:"min_bet"`
	MaxBet          pgtype.Numeric     `json:"max_bet"`
	Volatility      pgtype.Text        `json:"volatility"`
	IsActive        bool               `json:"is_active"`
	Rtp             pgtype.Numeric     `json:"rtp"`
	IsFeatured      bool               `json:"is_featured"`
	PopularityScore pgtype.Int4        `json:"popularity_score"`
	ThumbnailUrl    pgtype.Text        `json:"thumbnail_url"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
}

type VirtualGameSession struct {
	ID           int64              `json:"id"`
	UserID       int64              `json:"user_id"`
	GameID       string             `json:"game_id"`
	SessionToken string             `json:"session_token"`
	Currency     string             `json:"currency"`
	Status       string             `json:"status"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt    pgtype.Timestamptz `json:"updated_at"`
	ExpiresAt    pgtype.Timestamptz `json:"expires_at"`
}

type VirtualGameTransaction struct {
	ID                    int64              `json:"id"`
	SessionID             int64              `json:"session_id"`
	UserID                int64              `json:"user_id"`
	WalletID              int64              `json:"wallet_id"`
	TransactionType       string             `json:"transaction_type"`
	Amount                int64              `json:"amount"`
	Currency              string             `json:"currency"`
	ExternalTransactionID string             `json:"external_transaction_id"`
	Status                string             `json:"status"`
	CreatedAt             pgtype.Timestamptz `json:"created_at"`
	UpdatedAt             pgtype.Timestamptz `json:"updated_at"`
}

type Wallet struct {
	ID             int64            `json:"id"`
	Balance        int64            `json:"balance"`
	IsWithdraw     bool             `json:"is_withdraw"`
	IsBettable     bool             `json:"is_bettable"`
	IsTransferable bool             `json:"is_transferable"`
	UserID         int64            `json:"user_id"`
	IsActive       bool             `json:"is_active"`
	CreatedAt      pgtype.Timestamp `json:"created_at"`
	UpdatedAt      pgtype.Timestamp `json:"updated_at"`
	Currency       string           `json:"currency"`
	BonusBalance   pgtype.Numeric   `json:"bonus_balance"`
	CashBalance    pgtype.Numeric   `json:"cash_balance"`
}

type WalletThresholdNotification struct {
	CompanyID  int64              `json:"company_id"`
	Threshold  float64            `json:"threshold"`
	NotifiedAt pgtype.Timestamptz `json:"notified_at"`
}

type WalletTransfer struct {
	ID               int64            `json:"id"`
	Amount           pgtype.Int8      `json:"amount"`
	Type             pgtype.Text      `json:"type"`
	ReceiverWalletID pgtype.Int8      `json:"receiver_wallet_id"`
	SenderWalletID   pgtype.Int8      `json:"sender_wallet_id"`
	CashierID        pgtype.Int8      `json:"cashier_id"`
	Verified         pgtype.Bool      `json:"verified"`
	ReferenceNumber  pgtype.Text      `json:"reference_number"`
	Status           pgtype.Text      `json:"status"`
	PaymentMethod    pgtype.Text      `json:"payment_method"`
	CreatedAt        pgtype.Timestamp `json:"created_at"`
	UpdatedAt        pgtype.Timestamp `json:"updated_at"`
}
