Add Daily sales
This commit is contained in:
@@ -324,6 +324,17 @@ func (s OrderService) CountSoldOfTicket(ctx mycontext.Context, req entity.OrderS
|
||||
return data, nil
|
||||
}
|
||||
|
||||
func (s OrderService) GetDailySales(ctx mycontext.Context, req entity.OrderSearch) ([]entity.ProductDailySales, error) {
|
||||
dailySales, err := s.repo.GetDailySalesMetrics(ctx, req)
|
||||
|
||||
if err != nil {
|
||||
logger.ContextLogger(ctx).Error("error when get all history orders", zap.Error(err))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return dailySales, nil
|
||||
}
|
||||
|
||||
func (s OrderService) SumAmount(ctx mycontext.Context, req entity.OrderSearch) (*entity.Order, error) {
|
||||
amount, err := s.repo.SumAmount(ctx, req)
|
||||
|
||||
|
||||
@@ -114,6 +114,7 @@ type Order interface {
|
||||
GetAllHistoryOrders(ctx mycontext.Context, req entity.OrderSearch) ([]*entity.HistoryOrder, int, error)
|
||||
CountSoldOfTicket(ctx mycontext.Context, req entity.OrderSearch) (*entity.TicketSold, error)
|
||||
SumAmount(ctx mycontext.Context, req entity.OrderSearch) (*entity.Order, error)
|
||||
GetDailySales(ctx mycontext.Context, req entity.OrderSearch) ([]entity.ProductDailySales, error)
|
||||
}
|
||||
|
||||
type OSSService interface {
|
||||
|
||||
Reference in New Issue
Block a user