package admin import ( "context" "errors" "github.com/google/uuid" "github.com/jackc/pgx/v5" "github.com/yuxingu/digital-psychology/apps/api/internal/repository" ) var ErrHandoffCaseNotFound = errString("handoff case not found") // ListHandoffCases returns catalog. func (s *Service) ListHandoffCases(ctx context.Context) ([]repository.HandoffCaseRow, error) { items, err := s.Repo.ListHandoffCases(ctx) if err != nil { return nil, err } if items == nil { items = []repository.HandoffCaseRow{} } return items, nil } // GetHandoffCase loads one. func (s *Service) GetHandoffCase(ctx context.Context, id uuid.UUID) (*repository.HandoffCaseRow, error) { row, err := s.Repo.GetHandoffCase(ctx, id) if errors.Is(err, pgx.ErrNoRows) { return nil, ErrHandoffCaseNotFound } return row, err }