feat: integrate OA activation workflows and business migration
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user