package domain import ( "time" dbgen "github.com/SamuelTariku/FortuneBet-Backend/gen/db" ) type ResultLog struct { ID int64 `json:"id"` StatusNotFinishedCount int `json:"status_not_finished_count"` StatusNotFinishedBets int `json:"status_not_finished_bets"` StatusToBeFixedCount int `json:"status_to_be_fixed_count"` StatusToBeFixedBets int `json:"status_to_be_fixed_bets"` StatusPostponedCount int `json:"status_postponed_count"` StatusPostponedBets int `json:"status_postponed_bets"` StatusEndedCount int `json:"status_ended_count"` StatusEndedBets int `json:"status_ended_bets"` StatusRemovedCount int `json:"status_removed_count"` StatusRemovedBets int `json:"status_removed_bets"` RemovedCount int `json:"removed"` CreatedAt time.Time `json:"created_at"` } type CreateResultLog struct { StatusNotFinishedCount int `json:"status_not_finished_count"` StatusNotFinishedBets int `json:"status_not_finished_bets"` StatusToBeFixedCount int `json:"status_to_be_fixed_count"` StatusToBeFixedBets int `json:"status_to_be_fixed_bets"` StatusPostponedCount int `json:"status_postponed_count"` StatusPostponedBets int `json:"status_postponed_bets"` StatusEndedCount int `json:"status_ended_count"` StatusEndedBets int `json:"status_ended_bets"` StatusRemovedCount int `json:"status_removed_count"` StatusRemovedBets int `json:"status_removed_bets"` RemovedCount int `json:"removed"` } type ResultLogFilter struct { CreatedBefore ValidTime CreatedAfter ValidTime } type ResultStatusBets struct { StatusNotFinished []int64 `json:"status_not_finished"` StatusToBeFixed []int64 `json:"status_to_be_fixed"` StatusPostponed []int64 `json:"status_postponed"` StatusEnded []int64 `json:"status_ended"` StatusRemoved []int64 `json:"status_removed"` } func ConvertDBResultLog(result dbgen.ResultLog) ResultLog { return ResultLog{ ID: result.ID, StatusNotFinishedCount: int(result.StatusNotFinishedCount), StatusNotFinishedBets: int(result.StatusNotFinishedBets), StatusToBeFixedCount: int(result.StatusToBeFixedCount), StatusToBeFixedBets: int(result.StatusToBeFixedBets), StatusPostponedCount: int(result.StatusPostponedCount), StatusPostponedBets: int(result.StatusPostponedBets), StatusEndedCount: int(result.StatusEndedCount), StatusEndedBets: int(result.StatusEndedBets), StatusRemovedCount: int(result.StatusRemovedCount), StatusRemovedBets: int(result.StatusRemovedBets), RemovedCount: int(result.RemovedCount), CreatedAt: result.CreatedAt.Time, } } func ConvertCreateResultLog(result CreateResultLog) dbgen.CreateResultLogParams { return dbgen.CreateResultLogParams{ StatusNotFinishedCount: int32(result.StatusNotFinishedCount), StatusNotFinishedBets: int32(result.StatusNotFinishedBets), StatusToBeFixedCount: int32(result.StatusToBeFixedCount), StatusToBeFixedBets: int32(result.StatusToBeFixedBets), StatusPostponedCount: int32(result.StatusPostponedCount), StatusPostponedBets: int32(result.StatusPostponedBets), StatusEndedCount: int32(result.StatusEndedCount), StatusEndedBets: int32(result.StatusEndedBets), StatusRemovedCount: int32(result.StatusRemovedCount), StatusRemovedBets: int32(result.StatusRemovedBets), RemovedCount: int32(result.RemovedCount), } }