package notification import ( "context" "fmt" "git.gocasts.ir/ebhomengo/niki/param" bnfparam "git.gocasts.ir/ebhomengo/niki/param/admin/benefactor" kbp "git.gocasts.ir/ebhomengo/niki/param/admin/kind_box" smsmsg "git.gocasts.ir/ebhomengo/niki/pkg/sms_msg" ) func (s Service) KindBoxReturned(req param.NotificationKindBoxReturned) { const op = "notification.KindBoxReturned" ctx := context.Background() kb, err := s.KindBoxSvc.Get(ctx, kbp.KindBoxGetRequest{ KindBoxID: req.KindBoxID, }) if err != nil { fmt.Println(fmt.Errorf("error(%s):%w", op, err)) } bnf, gErr := s.BenefactorSvc.GetByID(ctx, bnfparam.GetBenefactorByIDRequest{BenefactorID: kb.Data.BenefactorID}) if gErr != nil { fmt.Println(fmt.Errorf("error(%s):%w", op, gErr)) } s.smsAdapter.Send(bnf.PhoneNumber, fmt.Sprintf(smsmsg.SmsMsgKindBoxReturned, bnf.FirstName, kb.Data.SerialNumber)) }