2024-07-27 14:58:37 +00:00
|
|
|
package notification
|
|
|
|
|
2024-07-27 16:17:13 +00:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
params "git.gocasts.ir/ebhomengo/niki/param/admin/benefactor"
|
|
|
|
param "git.gocasts.ir/ebhomengo/niki/param/admin/kind_box_req"
|
|
|
|
)
|
|
|
|
|
2024-07-27 14:58:37 +00:00
|
|
|
type SmsAdapter interface {
|
|
|
|
Send(phoneNumber string, message string)
|
|
|
|
}
|
|
|
|
|
2024-07-27 16:17:13 +00:00
|
|
|
type KindBoxReqSvc interface {
|
|
|
|
Get(ctx context.Context, request param.GetKindBoxReqRequest) (param.GetKindBoxReqResponse, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
type BenefactorSvc interface {
|
|
|
|
GetByID(ctx context.Context, req params.GetBenefactorByIDRequest) (params.GetBenefactorByIDResponse, error)
|
|
|
|
}
|
|
|
|
|
2024-07-27 14:58:37 +00:00
|
|
|
type Service struct {
|
2024-07-27 16:17:13 +00:00
|
|
|
smsAdapter SmsAdapter
|
|
|
|
KindBoxReqSvc KindBoxReqSvc
|
|
|
|
BenefactorSvc BenefactorSvc
|
2024-07-27 14:58:37 +00:00
|
|
|
}
|
|
|
|
|
2024-07-27 16:17:13 +00:00
|
|
|
func New(smsAdapter SmsAdapter, kindBoxReqSvc KindBoxReqSvc, benefactorSvc BenefactorSvc) Service {
|
2024-07-27 14:58:37 +00:00
|
|
|
return Service{
|
2024-07-27 16:17:13 +00:00
|
|
|
smsAdapter: smsAdapter,
|
|
|
|
KindBoxReqSvc: kindBoxReqSvc,
|
|
|
|
BenefactorSvc: benefactorSvc,
|
2024-07-27 14:58:37 +00:00
|
|
|
}
|
|
|
|
}
|