2024-06-21 06:57:35 +00:00
|
|
|
package benefactor
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2024-07-24 23:45:04 +00:00
|
|
|
|
2024-06-21 06:57:35 +00:00
|
|
|
"git.gocasts.ir/ebhomengo/niki/entity"
|
|
|
|
param "git.gocasts.ir/ebhomengo/niki/param/admin/admin"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Repository interface {
|
2024-07-27 16:17:13 +00:00
|
|
|
GetByID(ctx context.Context, benefactorID uint) (entity.Benefactor, error)
|
2024-06-21 06:57:35 +00:00
|
|
|
IsExistBenefactorByID(ctx context.Context, id uint) (bool, error)
|
|
|
|
GetAddressByID(ctx context.Context, id uint) (*entity.Address, error)
|
|
|
|
}
|
2024-07-24 23:45:04 +00:00
|
|
|
type ForAdminSvc interface {
|
2024-06-21 06:57:35 +00:00
|
|
|
BenefactorExistByID(ctx context.Context, request param.BenefactorExistByIDRequest) (param.BenefactorExistByIDResponse, error)
|
|
|
|
AddressExistByID(ctx context.Context, request param.GetAddressByIDRequest) (param.GetAddressByIDResponse, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
type Service struct {
|
2024-07-24 23:45:04 +00:00
|
|
|
repo Repository
|
2024-06-21 06:57:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func New(repo Repository) Service {
|
|
|
|
return Service{repo: repo}
|
|
|
|
}
|