You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.5 KiB

package models
import (
"time"
)
// Group represents a racer group (e.g., age group, division)
type Group struct {
ID int64 `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
CreatedAt time.Time `json:"created_at"`
}
// Racer represents a derby racer
type Racer struct {
ID int64 `json:"id"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
CarNumber string `json:"car_number"`
CarWeight float64 `json:"car_weight"`
GroupID int64 `json:"group_id"`
GroupName string `json:"group_name,omitempty"` // For display purposes
CreatedAt time.Time `json:"created_at"`
}
// Race represents a derby race event
type Race struct {
ID int64 `json:"id"`
Name string `json:"name"`
Status string `json:"status"` // pending, running, completed
CreatedAt time.Time `json:"created_at"`
}
// RaceResult represents the result of a racer in a race
type RaceResult struct {
ID int64 `json:"id"`
RaceID int64 `json:"race_id"`
RacerID int64 `json:"racer_id"`
Lane int `json:"lane"`
Time *float64 `json:"time,omitempty"`
Place *int `json:"place,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
// Heat represents a single race with 4 lanes
type Heat struct {
ID int64 `json:"id"`
GroupID int64 `json:"group_id"`
HeatNum int `json:"heat_num"`
Lane1ID *int64 `json:"lane1_id"`
Lane2ID *int64 `json:"lane2_id"`
Lane3ID *int64 `json:"lane3_id"`
Lane4ID *int64 `json:"lane4_id"`
}