live stock update

This commit is contained in:
2026-08-27 11:17:17 +05:30
parent ca846f9cd6
commit dc9c049bb9
6 changed files with 548 additions and 2 deletions

View File

@@ -20,6 +20,7 @@ type Facade struct {
StockRequestController *controllers.StockRequestController
CatalogueController *controllers.CatalogueController
PosController *controllers.PosController
LiveController *controllers.LiveController
// Held so the NATS consumer can reach the ingest without going through
// HTTP. Unexported: everything else should use the controller.
@@ -94,6 +95,11 @@ func NewFacade(db *gorm.DB, catalogueDB *gorm.DB) *Facade {
posService := services.NewPosService(posRepo, posPresence)
posController := controllers.NewPosController(posService)
// Shares the POS service purely for its outlet-ownership check — the
// stream itself reads no database and holds no state beyond its
// subscribers.
liveController := controllers.NewLiveController(posService)
return &Facade{
UserController: userController,
ProductController: productController,
@@ -106,6 +112,7 @@ func NewFacade(db *gorm.DB, catalogueDB *gorm.DB) *Facade {
StockRequestController: stockRequestController,
CatalogueController: catalogueController,
PosController: posController,
LiveController: liveController,
posService: posService,
}
}