mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 21:41:55 +00:00
add command normalize data seed standar and price adjustment stocks
This commit is contained in:
@@ -18,11 +18,11 @@ type DashboardModule struct{}
|
||||
|
||||
func (DashboardModule) RegisterRoutes(router fiber.Router, db *gorm.DB, validate *validator.Validate) {
|
||||
dashboardRepo := rDashboard.NewDashboardRepository(db)
|
||||
hppCostRepo := commonRepo.NewHppCostRepository(db)
|
||||
hppV2CostRepo := commonRepo.NewHppV2CostRepository(db)
|
||||
userRepo := rUser.NewUserRepository(db)
|
||||
|
||||
hppSvc := commonService.NewHppService(hppCostRepo)
|
||||
dashboardService := sDashboard.NewDashboardService(dashboardRepo, validate, hppSvc)
|
||||
hppV2Svc := commonService.NewHppV2Service(hppV2CostRepo)
|
||||
dashboardService := sDashboard.NewDashboardService(dashboardRepo, validate, hppV2Svc)
|
||||
userService := sUser.NewUserService(userRepo, validate)
|
||||
|
||||
DashboardRoutes(router, userService, dashboardService)
|
||||
|
||||
@@ -30,10 +30,10 @@ type dashboardService struct {
|
||||
Log *logrus.Logger
|
||||
Validate *validator.Validate
|
||||
Repository repository.DashboardRepository
|
||||
HppSvc commonService.HppService
|
||||
HppSvc commonService.HppV2Service
|
||||
}
|
||||
|
||||
func NewDashboardService(repo repository.DashboardRepository, validate *validator.Validate, hppSvc commonService.HppService) DashboardService {
|
||||
func NewDashboardService(repo repository.DashboardRepository, validate *validator.Validate, hppSvc commonService.HppV2Service) DashboardService {
|
||||
return &dashboardService{
|
||||
Log: utils.Log,
|
||||
Validate: validate,
|
||||
|
||||
@@ -773,7 +773,7 @@ func (s *repportService) GetMarketing(c *fiber.Ctx, params *validation.Marketing
|
||||
return nil, 0, err
|
||||
}
|
||||
|
||||
hppByDelivery := buildMarketingHppByDelivery(c.Context(), s.HppSvc, attributionRows)
|
||||
hppByDelivery := buildMarketingHppByDelivery(c.Context(), s.HppV2Svc, attributionRows)
|
||||
categoryByDelivery := buildMarketingCategoryByDelivery(deliveryProducts, attributionRows)
|
||||
|
||||
items := dto.ToMarketingReportItems(deliveryProducts, hppByDelivery, categoryByDelivery, agingMap)
|
||||
@@ -782,7 +782,7 @@ func (s *repportService) GetMarketing(c *fiber.Ctx, params *validation.Marketing
|
||||
|
||||
func buildMarketingHppByDelivery(
|
||||
ctx context.Context,
|
||||
hppSvc approvalService.HppService,
|
||||
hppSvc approvalService.HppV2Service,
|
||||
attributionRows []commonRepo.MarketingDeliveryAttributionRow,
|
||||
) map[uint]float64 {
|
||||
if len(attributionRows) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user