feat: integrate OA activation workflows and business migration

This commit is contained in:
Yvan
2026-11-07 00:09:19 +08:00
parent 64aca495f2
commit 9caf5b1abc
47 changed files with 1831 additions and 152 deletions
+10 -2
View File
@@ -7,9 +7,14 @@ import (
"kra/internal/biz/business"
)
type dashboardRepo struct{ data Provider }
type dashboardRepo struct {
data Provider
databases PlatformProvider
}
func NewDashboardRepo(data Provider) business.DashboardRepo { return &dashboardRepo{data: data} }
func NewDashboardRepo(data Provider, databases PlatformProvider) business.DashboardRepo {
return &dashboardRepo{data: data, databases: databases}
}
func (r *dashboardRepo) Overview(ctx context.Context, scope business.AnalyticsScope, sources []string, w business.DashboardWindow) (*business.DashboardData, error) {
db := r.data.DB().WithContext(ctx)
out := &business.DashboardData{Current: business.DashboardMetrics{Pay: "0.00"}, Previous: business.DashboardMetrics{Pay: "0.00"}, Available: true}
@@ -90,5 +95,8 @@ func (r *dashboardRepo) Overview(ctx context.Context, scope business.AnalyticsSc
out.Current.NewChannels, out.Previous.NewChannels = channels.CurrentNew, channels.PreviousNew
out.Current.Effective, out.Previous.Effective = channels.CurrentEffective, channels.PreviousEffective
out.Current.Pay, out.Previous.Pay = amounts.CurrentPay, amounts.PreviousPay
if err := r.events(ctx, scope, sources, w, out); err != nil {
return nil, err
}
return out, nil
}