forked from ebhomengo/niki
20 lines
696 B
Go
20 lines
696 B
Go
package notification
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
params "git.gocasts.ir/ebhomengo/niki/param"
|
|
bnfparam "git.gocasts.ir/ebhomengo/niki/param/admin/benefactor"
|
|
kbparam "git.gocasts.ir/ebhomengo/niki/param/admin/kind_box_req"
|
|
smsmsg "git.gocasts.ir/ebhomengo/niki/pkg/sms_msg"
|
|
)
|
|
|
|
func (s Service) KindBoxReqAccepted(req params.NotificationKindBoxReqAccepted) {
|
|
ctx := context.Background()
|
|
kb, _ := s.KindBoxReqSvc.Get(ctx, kbparam.GetKindBoxReqRequest{
|
|
KindBoxID: req.KindBoxReqID,
|
|
})
|
|
bnf, _ := s.BenefactorSvc.GetByID(ctx, bnfparam.GetBenefactorByIDRequest{BenefactorID: kb.BenefactorID})
|
|
s.smsAdapter.Send(bnf.PhoneNumber, fmt.Sprintf(smsmsg.SmsMsgKindBoxReqAccepted, bnf.FirstName))
|
|
}
|