package kindboxservice import ( entity "git.gocasts.ir/ebhomengo/niki/entity" param "git.gocasts.ir/ebhomengo/niki/param/kind_box" richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error" ) func (s Service) Add(req param.KindBoxAddRequest) (param.KindBoxAddResponse, error) { const op = "kindboxservice.Add" kindBox, err := s.repo.AddKindBox(entity.KindBox{ KindBoxReqID: req.KindBoxReqID, SenderID: req.SenderID, SerialNumber: req.SerialNumber, Status: entity.KindBoxPendingSendStatus, }) if err != nil { return param.KindBoxAddResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected) } return param.KindBoxAddResponse{KindBox: kindBox}, nil }