2024-07-30 14:20:49 +00:00
|
|
|
package adminbenefactorservice
|
2024-06-21 06:57:35 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2024-07-24 23:45:04 +00:00
|
|
|
|
2024-06-21 06:57:35 +00:00
|
|
|
"git.gocasts.ir/ebhomengo/niki/entity"
|
2024-07-30 14:20:49 +00:00
|
|
|
params "git.gocasts.ir/ebhomengo/niki/param/admin/benefactor"
|
2024-06-21 06:57:35 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Repository interface {
|
|
|
|
IsExistBenefactorByID(ctx context.Context, id uint) (bool, error)
|
|
|
|
GetAddressByID(ctx context.Context, id uint) (*entity.Address, error)
|
|
|
|
}
|
2024-07-30 14:20:49 +00:00
|
|
|
type BenefactorService interface {
|
|
|
|
GetByID(ctx context.Context, req params.GetBenefactorByIDRequest) (params.GetBenefactorByIDResponse, error)
|
2024-06-21 06:57:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Service struct {
|
2024-07-30 14:20:49 +00:00
|
|
|
repo Repository
|
|
|
|
benefactorService BenefactorService
|
2024-06-21 06:57:35 +00:00
|
|
|
}
|
|
|
|
|
2024-07-30 14:20:49 +00:00
|
|
|
func New(repo Repository, benefactorService BenefactorService) Service {
|
|
|
|
return Service{repo: repo, benefactorService: benefactorService}
|
2024-06-21 06:57:35 +00:00
|
|
|
}
|