niki/service/benefactor/kind_box/get_all.go

21 lines
632 B
Go
Raw Normal View History

package benefactorkindboxservice
import (
"context"
param "git.gocasts.ir/ebhomengo/niki/param/benefactor/kind_box"
richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error"
)
// TODO: Pagination, Filters, Sort.
func (s Service) GetAll(ctx context.Context, req param.KindBoxGetAllRequest) (param.KindBoxGetAllResponse, error) {
const op = "userkindboxservice.GetAll"
allKindBox, err := s.repo.GetAllKindBox(ctx, req.BenefactorID)
if err != nil {
return param.KindBoxGetAllResponse{}, richerror.New(op).WithErr(err).WithKind(richerror.KindUnexpected)
}
return param.KindBoxGetAllResponse{AllKindBox: allKindBox}, nil
}