41 lines
2.1 KiB
Go
41 lines
2.1 KiB
Go
package ports
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/SamuelTariku/FortuneBet-Backend/internal/domain"
|
|
)
|
|
|
|
type EventStore interface {
|
|
SaveEvent(ctx context.Context, e domain.CreateEvent) error
|
|
GetAllEvents(ctx context.Context, filter domain.EventFilter) ([]domain.BaseEvent, int64, error)
|
|
GetEventByID(ctx context.Context, ID int64) (domain.BaseEvent, error)
|
|
UpdateFinalScore(ctx context.Context, eventID int64, fullScore string, status domain.EventStatus) error
|
|
UpdateEventStatus(ctx context.Context, eventID int64, status domain.EventStatus) error
|
|
IsEventMonitored(ctx context.Context, eventID int64) (bool, error)
|
|
UpdateEventMonitored(ctx context.Context, eventID int64, IsMonitored bool) error
|
|
GetSportAndLeagueIDs(ctx context.Context, eventID int64) ([]int64, error)
|
|
|
|
GetLiveEventIDs(ctx context.Context) ([]int64, error)
|
|
GetEventBySourceID(ctx context.Context, id string, source domain.EventSource) (domain.BaseEvent, error)
|
|
|
|
DeleteEvent(ctx context.Context, eventID int64) error
|
|
// Event Settings Views
|
|
GetEventsWithSettings(ctx context.Context, companyID int64, filter domain.EventFilter) ([]domain.EventWithSettings, int64, error)
|
|
GetEventWithSettingByID(ctx context.Context, ID int64, companyID int64) (domain.EventWithSettings, error)
|
|
UpdateTenantEventSettings(ctx context.Context, event domain.UpdateTenantEventSettings) error
|
|
UpdateGlobalEventSettings(ctx context.Context, event domain.UpdateGlobalEventSettings) error
|
|
}
|
|
|
|
type EventHistoryStore interface {
|
|
InsertEventHistory(ctx context.Context, eventHistory domain.CreateEventHistory) (domain.EventHistory, error)
|
|
GetAllEventHistory(ctx context.Context, filter domain.EventHistoryFilter) ([]domain.EventHistory, error)
|
|
GetInitialEventPerDay(ctx context.Context, filter domain.EventHistoryFilter) ([]domain.EventHistory, error)
|
|
}
|
|
|
|
type EventStatStore interface {
|
|
GetTotalEventStats(ctx context.Context, filter domain.EventStatsFilter) (domain.EventStats, error)
|
|
GetTotalEventStatsByInterval(ctx context.Context, filter domain.EventStatsByIntervalFilter) ([]domain.EventStatsByInterval, error)
|
|
UpdateEventBetStats(ctx context.Context) error
|
|
}
|