package company

import (
	"context"

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

type Service struct {
	companyStore CompanyStore
}

func NewService(companyStore CompanyStore) *Service {
	return &Service{
		companyStore: companyStore,
	}
}

func (s *Service) CreateCompany(ctx context.Context, company domain.CreateCompany) (domain.Company, error) {
	return s.companyStore.CreateCompany(ctx, company)
}
func (s *Service) GetAllCompanies(ctx context.Context) ([]domain.GetCompany, error) {
	return s.companyStore.GetAllCompanies(ctx)
}

func (s *Service) GetCompanyByID(ctx context.Context, id int64) (domain.GetCompany, error) {
	return s.companyStore.GetCompanyByID(ctx, id)
}

func (s *Service) SearchCompanyByName(ctx context.Context, name string) ([]domain.GetCompany, error) {
	return s.companyStore.SearchCompanyByName(ctx, name)
}

func (s *Service) UpdateCompany(ctx context.Context, company domain.UpdateCompany) (domain.Company, error) {
	return s.companyStore.UpdateCompany(ctx, company)
}
func (s *Service) DeleteCompany(ctx context.Context, id int64) error {
	return s.companyStore.DeleteCompany(ctx, id)
}
