- Removed detailed event routes from the API. - Added new report request routes for creating and fetching report requests. - Introduced new domain models for report requests, including metadata and status handling. - Implemented report request processing logic, including CSV generation for event interval reports. - Enhanced company statistics handling with new domain models and service methods. - Updated repository interfaces and implementations to support new report functionalities. - Added error handling and logging for report file operations and notifications.
25 lines
1.0 KiB
Go
25 lines
1.0 KiB
Go
package report
|
|
|
|
import (
|
|
"context"
|
|
"github.com/SamuelTariku/FortuneBet-Backend/internal/domain"
|
|
)
|
|
|
|
|
|
func (s *Service) CreateReportRequest(ctx context.Context, report domain.CreateReportRequest) (domain.ReportRequest, error) {
|
|
return s.store.CreateReportRequest(ctx, report)
|
|
}
|
|
func (s *Service) GetAllReportRequests(ctx context.Context, filter domain.ReportRequestFilter) ([]domain.ReportRequestDetail, int64, error) {
|
|
return s.store.GetAllReportRequests(ctx, filter)
|
|
}
|
|
func (s *Service) GetReportRequestByRequestedByID(ctx context.Context, requestedBy int64, filter domain.ReportRequestFilter) ([]domain.ReportRequestDetail, error) {
|
|
return s.store.GetReportRequestByRequestedByID(ctx, requestedBy, filter)
|
|
}
|
|
func (s *Service) GetReportRequestByID(ctx context.Context, ID int64) (domain.ReportRequestDetail, error) {
|
|
return s.store.GetReportRequestByID(ctx, ID)
|
|
}
|
|
|
|
func (s *Service) UpdateReportRequest(ctx context.Context, report domain.UpdateRequestRequest) error {
|
|
return s.store.UpdateReportRequest(ctx, report)
|
|
}
|