package user

import (
	"context"

	"github.com/SamuelTariku/FortuneBet-Backend/internal/domain"
)

type UserStore interface {
	CreateUser(ctx context.Context, user domain.User, usedOtpId int64, is_company bool) (domain.User, error)
	CreateUserWithoutOtp(ctx context.Context, user domain.User, is_company bool) (domain.User, error)
	GetUserByID(ctx context.Context, id int64) (domain.User, error)
	GetAllUsers(ctx context.Context, filter Filter) ([]domain.User, int64, error)
	GetAllCashiers(ctx context.Context) ([]domain.GetCashier, int64, error)
	GetCashierByID(ctx context.Context, cashierID int64) (domain.GetCashier, error)
	GetCashiersByBranch(ctx context.Context, branchID int64) ([]domain.User, error)
	UpdateUser(ctx context.Context, user domain.UpdateUserReq) error
	UpdateUserCompany(ctx context.Context, id int64, companyID int64) error
	UpdateUserSuspend(ctx context.Context, id int64, status bool) error
	DeleteUser(ctx context.Context, id int64) error
	CheckPhoneEmailExist(ctx context.Context, phoneNum, email string) (bool, bool, error)
	GetUserByEmail(ctx context.Context, email string) (domain.User, error)
	GetUserByPhone(ctx context.Context, phoneNum string) (domain.User, error)
	SearchUserByNameOrPhone(ctx context.Context, searchString string, role *domain.Role, companyID domain.ValidInt64) ([]domain.User, error)
	UpdatePassword(ctx context.Context, identifier string, password []byte, usedOtpId int64) error // identifier verified email or phone

	GetCustomerCounts(ctx context.Context, filter domain.ReportFilter) (total, active, inactive int64, err error)
	GetCustomerDetails(ctx context.Context, filter domain.ReportFilter) (map[int64]domain.CustomerDetail, error)
	GetBranchCustomerCounts(ctx context.Context, filter domain.ReportFilter) (map[int64]int64, error)
	GetRoleCounts(ctx context.Context, role string, filter domain.ReportFilter) (total, active, inactive int64, err error)
}
type SmsGateway interface {
	SendSMSOTP(ctx context.Context, phoneNumber, otp string) error
}
type EmailGateway interface {
	SendEmailOTP(ctx context.Context, email string, otp string) error
}
type OtpStore interface {
	CreateOtp(ctx context.Context, otp domain.Otp) error
	GetOtp(ctx context.Context, sentTo string, sentfor domain.OtpFor, medium domain.OtpMedium) (domain.Otp, error)
}
