niki/service/seeder/service.go

44 lines
1.3 KiB
Go

package adminseederservice
import (
"context"
"git.gocasts.ir/ebhomengo/niki/entity"
)
type BenefactorRepo interface {
CreateBenefactor(ctx context.Context, benefactor entity.Benefactor) (entity.Benefactor, error)
IsExistBenefactorByPhoneNumber(ctx context.Context, phoneNumber string) (bool, entity.Benefactor, error)
}
type KindBoxRepo interface {
AddKindBox(ctx context.Context, kindBox entity.KindBox) (entity.KindBox, error)
AssignReceiverAgent(ctx context.Context, kindBox entity.KindBox) error
}
type KindBoxReqRepo interface {
AddKindBoxReq(ctx context.Context, kindBoxReq entity.KindBoxReq) (entity.KindBoxReq, error)
AssignSenderAgentToKindBoxReq(ctx context.Context, kindBoxReqID, senderAgentID uint) error
}
type AddressRepo interface {
GetAllCities(ctx context.Context) ([]entity.City, error)
CreateBenefactorAddress(ctx context.Context, address entity.Address) (entity.Address, error)
}
type Service struct {
benefactorRepo BenefactorRepo
kindBoxRepo KindBoxRepo
kindBoxReqRepo KindBoxReqRepo
addressRepo AddressRepo
}
func New(benefactorRepo BenefactorRepo, kindBoxRepo KindBoxRepo, kindBoxReqRepo KindBoxReqRepo, addressRepo AddressRepo) Service {
return Service{
benefactorRepo: benefactorRepo,
kindBoxRepo: kindBoxRepo,
kindBoxReqRepo: kindBoxReqRepo,
addressRepo: addressRepo,
}
}