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-08-01 10:20:18 +00:00
|
|
|
adminaddressparam "git.gocasts.ir/ebhomengo/niki/param/admin/address"
|
2024-06-21 06:57:35 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type Repository interface {
|
|
|
|
IsExistBenefactorByID(ctx context.Context, id uint) (bool, error)
|
2024-08-01 10:20:18 +00:00
|
|
|
GetByID(ctx context.Context, id uint) (entity.Benefactor, error)
|
2024-06-21 06:57:35 +00:00
|
|
|
}
|
2024-08-01 10:20:18 +00:00
|
|
|
type AddressSvc interface {
|
|
|
|
GetAddressByID(ctx context.Context, request adminaddressparam.AddressGetRequest) (adminaddressparam.AddressGetResponse, error)
|
2024-06-21 06:57:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Service struct {
|
2024-08-01 10:20:18 +00:00
|
|
|
repo Repository
|
|
|
|
AddressSvc AddressSvc
|
2024-06-21 06:57:35 +00:00
|
|
|
}
|
|
|
|
|
2024-08-01 10:20:18 +00:00
|
|
|
func New(repo Repository, addressSvc AddressSvc) Service {
|
|
|
|
return Service{repo: repo, AddressSvc: addressSvc}
|
2024-06-21 06:57:35 +00:00
|
|
|
}
|