Yimaru-BackEnd/internal/domain/ticket.go
2025-04-23 03:44:17 +03:00

55 lines
2.0 KiB
Go

package domain
import "time"
type TicketOutcome struct {
ID int64 `json:"id" example:"1"`
TicketID int64 `json:"ticket_id" example:"1"`
EventID int64 `json:"event_id" example:"1"`
HomeTeamName string `json:"home_team_name" example:"Manchester"`
AwayTeamName string `json:"away_team_name" example:"Liverpool"`
MarketID int64 `json:"market_id" example:"1"`
MarketName string `json:"market_name" example:"Fulltime Result"`
OddID int64 `json:"odd_id" example:"1"`
Odd float32 `json:"odd" example:"1.5"`
OddName string `json:"odd_name" example:"1"`
OddHeader string `json:"odd_header" example:"1"`
OddHandicap string `json:"odd_handicap" example:"1"`
Status OutcomeStatus `json:"status" example:"1"`
Expires time.Time `json:"expires" example:"2025-04-08T12:00:00Z"`
}
type CreateTicketOutcome struct {
TicketID int64 `json:"ticket_id" example:"1"`
EventID int64 `json:"event_id" example:"1"`
OddID int64 `json:"odd_id" example:"1"`
HomeTeamName string `json:"home_team_name" example:"Manchester"`
AwayTeamName string `json:"away_team_name" example:"Liverpool"`
MarketID int64 `json:"market_id" example:"1"`
MarketName string `json:"market_name" example:"Fulltime Result"`
Odd float32 `json:"odd" example:"1.5"`
OddName string `json:"odd_name" example:"1"`
OddHeader string `json:"odd_header" example:"1"`
OddHandicap string `json:"odd_handicap" example:"1"`
Expires time.Time `json:"expires" example:"2025-04-08T12:00:00Z"`
}
// ID will serve as the fast code since this doesn't need to be secure
type Ticket struct {
ID int64
Amount Currency
TotalOdds float32
}
type GetTicket struct {
ID int64
Amount Currency
TotalOdds float32
Outcomes []TicketOutcome
}
type CreateTicket struct {
Amount Currency
TotalOdds float32
}