This commit is contained in:
Aditya Siregar
2025-09-01 12:06:14 +07:00
parent 2bdce63852
commit aa662a321f
25 changed files with 2923 additions and 189 deletions
+9
View File
@@ -50,6 +50,7 @@ func (a *App) Initialize(cfg *config.Config) error {
adminApprovalFlowHandler := handler.NewAdminApprovalFlowHandler(services.approvalFlowService)
dispositionRouteHandler := handler.NewDispositionRouteHandler(services.dispositionRouteService)
onlyOfficeHandler := handler.NewOnlyOfficeHandler(services.onlyOfficeService)
analyticsHandler := handler.NewAnalyticsHandler(services.analyticsService)
a.router = router.NewRouter(
cfg,
@@ -65,6 +66,7 @@ func (a *App) Initialize(cfg *config.Config) error {
adminApprovalFlowHandler,
dispositionRouteHandler,
onlyOfficeHandler,
analyticsHandler,
)
return nil
@@ -141,6 +143,7 @@ type repositories struct {
letterOutgoingActivityLogRepo *repository.LetterOutgoingActivityLogRepository
approvalFlowRepo *repository.ApprovalFlowRepository
letterOutgoingApprovalRepo *repository.LetterOutgoingApprovalRepository
analyticsRepo *repository.AnalyticsRepository
}
func (a *App) initRepositories() *repositories {
@@ -174,6 +177,7 @@ func (a *App) initRepositories() *repositories {
letterOutgoingActivityLogRepo: repository.NewLetterOutgoingActivityLogRepository(a.db),
approvalFlowRepo: repository.NewApprovalFlowRepository(a.db),
letterOutgoingApprovalRepo: repository.NewLetterOutgoingApprovalRepository(a.db),
analyticsRepo: repository.NewAnalyticsRepository(a.db),
}
}
@@ -255,6 +259,7 @@ type services struct {
approvalFlowService *service.ApprovalFlowServiceImpl
dispositionRouteService *service.DispositionRouteServiceImpl
onlyOfficeService *service.OnlyOfficeServiceImpl
analyticsService *service.AnalyticsServiceImpl
}
func (a *App) initServices(processors *processors, repos *repositories, cfg *config.Config) *services {
@@ -289,6 +294,9 @@ func (a *App) initServices(processors *processors, repos *repositories, cfg *con
// Create OnlyOffice service with file storage
onlyOfficeSvc := service.NewOnlyOfficeService(processors.onlyOfficeProcessor, &cfg.OnlyOffice, a.db, s3Client)
// Create Analytics service
analyticsSvc := service.NewAnalyticsService(repos.analyticsRepo)
return &services{
userService: userSvc,
authService: authService,
@@ -300,6 +308,7 @@ func (a *App) initServices(processors *processors, repos *repositories, cfg *con
approvalFlowService: approvalFlowSvc,
dispositionRouteService: dispRouteSvc,
onlyOfficeService: onlyOfficeSvc,
analyticsService: analyticsSvc,
}
}