42 lines
829 B
Go
42 lines
829 B
Go
package domain
|
|
|
|
import (
|
|
"time"
|
|
|
|
dbgen "github.com/SamuelTariku/FortuneBet-Backend/gen/db"
|
|
)
|
|
|
|
type EventHistory struct {
|
|
ID int64
|
|
EventID int64
|
|
Status string
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
type CreateEventHistory struct {
|
|
EventID int64
|
|
Status string
|
|
}
|
|
|
|
type EventHistoryFilter struct {
|
|
EventID ValidInt64
|
|
CreatedBefore ValidTime
|
|
CreatedAfter ValidTime
|
|
}
|
|
|
|
func ConvertCreateEventHistory(eventHistory CreateEventHistory) dbgen.InsertEventHistoryParams {
|
|
return dbgen.InsertEventHistoryParams{
|
|
EventID: eventHistory.EventID,
|
|
Status: eventHistory.Status,
|
|
}
|
|
}
|
|
|
|
func ConvertDBEventHistory(eventHistory dbgen.EventHistory) EventHistory {
|
|
return EventHistory{
|
|
ID: eventHistory.ID,
|
|
EventID: eventHistory.EventID,
|
|
Status: eventHistory.Status,
|
|
CreatedAt: eventHistory.CreatedAt.Time,
|
|
}
|
|
}
|