cart
Build and Publish / BuildAndDeployAmd64 (push) Failing after 3s
Build and Publish / BuildAndDeployArm64 (push) Failing after 5s

This commit is contained in:
2026-07-05 18:09:55 +02:00
parent e2f835c01b
commit 781c1bd171
3 changed files with 79 additions and 21 deletions
+5 -3
View File
@@ -58,9 +58,10 @@ type Config struct {
// App is the commerce admin control plane. Construct with New, register its
// HTTP surface with RegisterRoutes, run background work with Start.
type App struct {
fs *FileServer
hub *Hub
cs *CustomerServer
fs *FileServer
hub *Hub
cs *CustomerServer
OnVouchersChange func(codes []string)
}
// New constructs the commerce admin: it opens the cart/checkout disk event-log
@@ -171,6 +172,7 @@ func New(cfg Config) (*App, error) {
// apply auth or CORS — the composing host (or standalone main) wraps the mux
// with those.
func (a *App) RegisterRoutes(mux *http.ServeMux) {
a.fs.OnVouchersChange = a.OnVouchersChange
mux.HandleFunc("GET /carts", a.fs.CartsHandler)
mux.HandleFunc("GET /cart/{id}", a.fs.CartHandler)
mux.HandleFunc("GET /checkouts", a.fs.CheckoutsHandler)