status updated
This commit is contained in:
@@ -93,6 +93,18 @@ func NewFacade(db *gorm.DB, catalogueDB *gorm.DB, embedder utils.Embedder, chat
|
||||
productRepo, catalogueService, services.NewNutritionService(nutritionBase))
|
||||
productController := controllers.NewProductController(productService)
|
||||
|
||||
//Tenant Module
|
||||
//
|
||||
// Onboarding, adding a person and commissioning a branch all create an
|
||||
// account with no password, so all three send an invitation. `tenantRepo` and
|
||||
// `inviteService` are built above, where the reasoning is.
|
||||
//
|
||||
// BEFORE the order controller, which takes it: order creation asks this
|
||||
// service whether the shop is trading before accepting, using the same
|
||||
// rule the customer-facing store list runs. No dependency the other way.
|
||||
tenantService := services.NewTenantService(tenantRepo, inviteService)
|
||||
tenantController := controllers.NewTenantController(tenantService)
|
||||
|
||||
// When each branch delivers.
|
||||
//
|
||||
// BEFORE the order controller, which takes it: order creation re-checks a
|
||||
@@ -100,12 +112,12 @@ func NewFacade(db *gorm.DB, catalogueDB *gorm.DB, embedder utils.Embedder, chat
|
||||
// drift. No dependency the other way — this service knows nothing of orders.
|
||||
deliverySlotRepo := repositories.NewDeliverySlotRepository(db)
|
||||
deliverySlotService := services.NewDeliverySlotService(deliverySlotRepo)
|
||||
deliverySlotController := controllers.NewDeliverySlotController(deliverySlotService)
|
||||
deliverySlotController := controllers.NewDeliverySlotController(deliverySlotService, tenantService)
|
||||
|
||||
// Order Module
|
||||
orderRepo := repositories.NewOrderRepository(db)
|
||||
orderService := services.NewOrderService(orderRepo)
|
||||
orderController := controllers.NewOrderController(orderService, deliverySlotService)
|
||||
orderController := controllers.NewOrderController(orderService, deliverySlotService, tenantService)
|
||||
|
||||
// Deliveries Module
|
||||
deliveriesRepo := repositories.NewDeliveriesRepository(db)
|
||||
@@ -117,14 +129,6 @@ func NewFacade(db *gorm.DB, catalogueDB *gorm.DB, embedder utils.Embedder, chat
|
||||
utilsService := services.NewUtilsService(utilsRepo)
|
||||
utilsController := controllers.NewUtilsController(utilsService)
|
||||
|
||||
//Tenant Module
|
||||
//
|
||||
// Onboarding, adding a person and commissioning a branch all create an
|
||||
// account with no password, so all three send an invitation. `tenantRepo` and
|
||||
// `inviteService` are built above, where the reasoning is.
|
||||
tenantService := services.NewTenantService(tenantRepo, inviteService)
|
||||
tenantController := controllers.NewTenantController(tenantService)
|
||||
|
||||
//Partner Module
|
||||
partnerRepo := repositories.NewPartnerRepository(db)
|
||||
partnerService := services.NewPartnerService(partnerRepo)
|
||||
|
||||
Reference in New Issue
Block a user