Files
apskel-pos-backend/internal/handler/customer_outlet_handler.go
T

27 lines
741 B
Go
Raw Normal View History

2026-09-30 19:21:13 +07:00
package handler
import (
"github.com/gin-gonic/gin"
"apskel-pos-be/internal/service"
"apskel-pos-be/internal/util"
)
// CustomerOutletHandler serves GET /customer/outlets.
type CustomerOutletHandler struct {
outlets service.CustomerOutletService
}
func NewCustomerOutletHandler(outlets service.CustomerOutletService) *CustomerOutletHandler {
return &CustomerOutletHandler{outlets: outlets}
}
// List returns the active outlets of the customer's organization.
func (h *CustomerOutletHandler) List(c *gin.Context) {
customerID, ok := customerIDFromGin(c, "CustomerOutletHandler::List")
if !ok {
return
}
util.HandleResponse(c.Writer, c.Request, h.outlets.List(c.Request.Context(), customerID), "CustomerOutletHandler::List")
}