delivery slot api creation

This commit is contained in:
2026-10-06 17:35:51 +05:30
parent f67cbad79a
commit 03ae7d310b
12 changed files with 1137 additions and 104 deletions

View File

@@ -28,6 +28,7 @@ type Facade struct {
LiveController *controllers.LiveController
CatalogueUploadController *controllers.CatalogueUploadController
ScanController *controllers.ScanController
DeliverySlotController *controllers.DeliverySlotController
AssistantController *controllers.AssistantController
HealthController *controllers.HealthController
MCPController *controllers.MCPController
@@ -92,10 +93,19 @@ func NewFacade(db *gorm.DB, catalogueDB *gorm.DB, embedder utils.Embedder, chat
productRepo, catalogueService, services.NewNutritionService(nutritionBase))
productController := controllers.NewProductController(productService)
// When each branch delivers.
//
// BEFORE the order controller, which takes it: order creation re-checks a
// chosen window against the same rule the app was shown, so the two cannot
// drift. No dependency the other way — this service knows nothing of orders.
deliverySlotRepo := repositories.NewDeliverySlotRepository(db)
deliverySlotService := services.NewDeliverySlotService(deliverySlotRepo)
deliverySlotController := controllers.NewDeliverySlotController(deliverySlotService)
// Order Module
orderRepo := repositories.NewOrderRepository(db)
orderService := services.NewOrderService(orderRepo)
orderController := controllers.NewOrderController(orderService)
orderController := controllers.NewOrderController(orderService, deliverySlotService)
// Deliveries Module
deliveriesRepo := repositories.NewDeliveriesRepository(db)
@@ -241,6 +251,7 @@ func NewFacade(db *gorm.DB, catalogueDB *gorm.DB, embedder utils.Embedder, chat
LiveController: liveController,
CatalogueUploadController: catalogueUploadController,
ScanController: scanController,
DeliverySlotController: deliverySlotController,
AssistantController: assistantController,
HealthController: healthController,
MCPController: mcpController,