package transaction

import (
	"context"

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

type Service struct {
	transactionStore TransactionStore
}

func NewService(transactionStore TransactionStore) *Service {
	return &Service{
		transactionStore: transactionStore,
	}
}

func (s *Service) CreateTransaction(ctx context.Context, transaction domain.CreateTransaction) (domain.Transaction, error) {
	return s.transactionStore.CreateTransaction(ctx, transaction)
}
func (s *Service) GetTransactionByID(ctx context.Context, id int64) (domain.Transaction, error) {
	return s.transactionStore.GetTransactionByID(ctx, id)
}
func (s *Service) GetAllTransactions(ctx context.Context, filter domain.TransactionFilter) ([]domain.Transaction, error) {
	return s.transactionStore.GetAllTransactions(ctx, filter)
}
func (s *Service) GetTransactionByBranch(ctx context.Context, id int64) ([]domain.Transaction, error) {
	return s.transactionStore.GetTransactionByBranch(ctx, id)
}
func (s *Service) UpdateTransactionVerified(ctx context.Context, id int64, verified bool, approvedBy int64, approverName string) error {
	return s.transactionStore.UpdateTransactionVerified(ctx, id, verified, approvedBy, approverName)
}
