Add Daily Sales and Distributed Payment

This commit is contained in:
aditya.siregar
2024-08-02 15:16:28 +07:00
parent eff502b24a
commit 6a1dffa750
7 changed files with 101 additions and 1 deletions
+11
View File
@@ -335,6 +335,17 @@ func (s OrderService) GetDailySales(ctx mycontext.Context, req entity.OrderSearc
return dailySales, nil
}
func (s OrderService) GetPaymentDistribution(ctx mycontext.Context, req entity.OrderSearch) ([]entity.PaymentTypeDistribution, error) {
paymentDistribution, err := s.repo.GetPaymentTypeDistribution(ctx, req)
if err != nil {
logger.ContextLogger(ctx).Error("error when get all history orders", zap.Error(err))
return nil, err
}
return paymentDistribution, nil
}
func (s OrderService) SumAmount(ctx mycontext.Context, req entity.OrderSearch) (*entity.Order, error) {
amount, err := s.repo.SumAmount(ctx, req)