package referral

import (
	"net/http"

	e "simrs-vx/internal/domain/bpjs-entities/referral"
	u "simrs-vx/internal/use-case/bpjs-use-case/referral"

	d "github.com/karincake/dodol"
	rw "github.com/karincake/risoles"
)

func GetList(w http.ResponseWriter, r *http.Request) {
	dto := e.ReadDetailDto{}
	number := rw.ValidateString(w, "number", r.PathValue("number"))
	if number == "" {
		rw.WriteJSON(w, http.StatusBadRequest, d.IS{"message": "number is required"}, nil)
	}
	dto.Number = &number
	res, err := u.ReadDetail(dto)
	rw.DataResponse(w, res, err)
}
