feat(cpone): migrate lab registration endpoints
This commit is contained in:
@@ -16,12 +16,23 @@ type LayananRepository interface {
|
||||
MappingHarga(ctx context.Context, params repository.MappingHargaParams) ([]repository.TarifLayanan, error)
|
||||
}
|
||||
|
||||
type Handler struct {
|
||||
repo LayananRepository
|
||||
type LabRegistrationRepository interface {
|
||||
RegisterLab(ctx context.Context, params repository.LabRegistrationParams) (repository.LabRegistrationOutcome, error)
|
||||
AddLabServices(ctx context.Context, regID string, params repository.AddLabServicesParams) (repository.LabRegistrationOutcome, error)
|
||||
}
|
||||
|
||||
func NewHandler(repo LayananRepository) Handler {
|
||||
return Handler{repo: repo}
|
||||
type Handler struct {
|
||||
layananRepo LayananRepository
|
||||
labRepo LabRegistrationRepository
|
||||
}
|
||||
|
||||
type CPONERepository interface {
|
||||
LayananRepository
|
||||
LabRegistrationRepository
|
||||
}
|
||||
|
||||
func NewHandler(repo CPONERepository) Handler {
|
||||
return Handler{layananRepo: repo, labRepo: repo}
|
||||
}
|
||||
|
||||
func (h Handler) MappingHarga(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -55,7 +66,7 @@ func (h Handler) MappingHarga(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
rows, err := h.repo.MappingHarga(r.Context(), repository.MappingHargaParams{
|
||||
rows, err := h.layananRepo.MappingHarga(r.Context(), repository.MappingHargaParams{
|
||||
PeriodeTarifID: periodeTarifID,
|
||||
LayananIDs: layananIDs,
|
||||
Search: strings.TrimSpace(r.URL.Query().Get("search")),
|
||||
|
||||
Reference in New Issue
Block a user