Fix Analytics

This commit is contained in:
Aditya Siregar
2025-08-05 22:50:12 +07:00
parent 5741243425
commit 073681d4d5
6 changed files with 14 additions and 20 deletions
@@ -37,7 +37,6 @@ func (p *AnalyticsProcessorImpl) GetPaymentMethodAnalytics(ctx context.Context,
return nil, fmt.Errorf("failed to get payment method analytics: %w", err)
}
// Calculate summary
var totalAmount float64
var totalOrders int64
var totalPayments int64
@@ -23,13 +23,11 @@ func NewIngredientProcessor(ingredientRepo IngredientRepository, unitRepo UnitRe
}
func (p *IngredientProcessorImpl) CreateIngredient(ctx context.Context, req *models.CreateIngredientRequest) (*models.IngredientResponse, error) {
// Validate unit exists
_, err := p.unitRepo.GetByID(ctx, req.UnitID, req.OrganizationID)
if err != nil {
return nil, err
}
// Create ingredient entity
ingredient := &entities.Ingredient{
ID: uuid.New(),
OrganizationID: req.OrganizationID,