package adminbenefactorservice

import (
	"context"

	"git.gocasts.ir/ebhomengo/niki/entity"
	"git.gocasts.ir/ebhomengo/niki/param"
	adminaddressparam "git.gocasts.ir/ebhomengo/niki/param/admin/address"
	validator "git.gocasts.ir/ebhomengo/niki/validator/admin/benefactor"
)

type Repository interface {
	IsExistBenefactorByID(ctx context.Context, id uint) (bool, error)
	GetByID(ctx context.Context, id uint) (entity.Benefactor, error)
	UpdateGeneralBenefactor(ctx context.Context, benefactor entity.Benefactor) error
	UpdateStatusBenefactor(ctx context.Context, benefactor entity.Benefactor, status entity.BenefactorStatus) error
	GetAllBenefactor(ctx context.Context, filter param.FilterRequest, pagination param.PaginationRequest, sort param.SortRequest, searchParams *param.QuerySearch) ([]entity.Benefactor, uint, error)
}
type AddressSvc interface {
	GetAddressByID(ctx context.Context, request adminaddressparam.AddressGetRequest) (adminaddressparam.AddressGetResponse, error)
}

type Service struct {
	repo       Repository
	addressSvc AddressSvc
	vld        validator.Validator
}

func New(repo Repository, addressSvc AddressSvc, vld validator.Validator) Service {
	return Service{repo: repo, addressSvc: addressSvc, vld: vld}
}
