26 lines
790 B
Go
Executable file
26 lines
790 B
Go
Executable file
package models
|
|
|
|
import "time"
|
|
|
|
// Region represents a global region (State, Province, Prefecture)
|
|
type Region struct {
|
|
ID int `json:"id" db:"id"`
|
|
Name string `json:"name" db:"name"`
|
|
CountryCode string `json:"countryCode" db:"country_code"`
|
|
Code string `json:"code" db:"code"` // ISO Code
|
|
CreatedAt time.Time `json:"createdAt" db:"created_at"`
|
|
}
|
|
|
|
// City represents a global city within a region
|
|
type City struct {
|
|
ID int `json:"id" db:"id"`
|
|
RegionID int `json:"regionId" db:"region_id"`
|
|
Name string `json:"name" db:"name"`
|
|
CreatedAt time.Time `json:"createdAt" db:"created_at"`
|
|
}
|
|
|
|
// CityWithRegion includes region information
|
|
type CityWithRegion struct {
|
|
City
|
|
RegionName string `json:"regionName,omitempty"`
|
|
}
|