phase 0.3

This commit is contained in:
portakal 2026-06-04 20:51:20 +03:00
commit 4a94bfc4e7
52 changed files with 11653 additions and 0 deletions

704
internal/db/models.go Normal file
View file

@ -0,0 +1,704 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.31.1
package db
import (
"database/sql"
"database/sql/driver"
"fmt"
"time"
)
type BuildingsBuildingType string
const (
BuildingsBuildingTypeNone BuildingsBuildingType = "none"
BuildingsBuildingTypeStorage BuildingsBuildingType = "storage"
BuildingsBuildingTypeSupport BuildingsBuildingType = "support"
BuildingsBuildingTypeOperation BuildingsBuildingType = "operation"
BuildingsBuildingTypePassive BuildingsBuildingType = "passive"
BuildingsBuildingTypeShop BuildingsBuildingType = "shop"
BuildingsBuildingTypeProduction BuildingsBuildingType = "production"
)
func (e *BuildingsBuildingType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = BuildingsBuildingType(s)
case string:
*e = BuildingsBuildingType(s)
default:
return fmt.Errorf("unsupported scan type for BuildingsBuildingType: %T", src)
}
return nil
}
type NullBuildingsBuildingType struct {
BuildingsBuildingType BuildingsBuildingType `json:"buildings_building_type"`
Valid bool `json:"valid"` // Valid is true if BuildingsBuildingType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullBuildingsBuildingType) Scan(value interface{}) error {
if value == nil {
ns.BuildingsBuildingType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.BuildingsBuildingType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullBuildingsBuildingType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.BuildingsBuildingType), nil
}
type BuildingsOperationSize string
const (
BuildingsOperationSizeSmall BuildingsOperationSize = "small"
BuildingsOperationSizeMedium BuildingsOperationSize = "medium"
BuildingsOperationSizeLarge BuildingsOperationSize = "large"
BuildingsOperationSizeHuge BuildingsOperationSize = "huge"
)
func (e *BuildingsOperationSize) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = BuildingsOperationSize(s)
case string:
*e = BuildingsOperationSize(s)
default:
return fmt.Errorf("unsupported scan type for BuildingsOperationSize: %T", src)
}
return nil
}
type NullBuildingsOperationSize struct {
BuildingsOperationSize BuildingsOperationSize `json:"buildings_operation_size"`
Valid bool `json:"valid"` // Valid is true if BuildingsOperationSize is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullBuildingsOperationSize) Scan(value interface{}) error {
if value == nil {
ns.BuildingsOperationSize, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.BuildingsOperationSize.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullBuildingsOperationSize) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.BuildingsOperationSize), nil
}
type BuildingsOperationType string
const (
BuildingsOperationTypeRunway BuildingsOperationType = "runway"
BuildingsOperationTypeService BuildingsOperationType = "service"
BuildingsOperationTypeProduction BuildingsOperationType = "production"
)
func (e *BuildingsOperationType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = BuildingsOperationType(s)
case string:
*e = BuildingsOperationType(s)
default:
return fmt.Errorf("unsupported scan type for BuildingsOperationType: %T", src)
}
return nil
}
type NullBuildingsOperationType struct {
BuildingsOperationType BuildingsOperationType `json:"buildings_operation_type"`
Valid bool `json:"valid"` // Valid is true if BuildingsOperationType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullBuildingsOperationType) Scan(value interface{}) error {
if value == nil {
ns.BuildingsOperationType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.BuildingsOperationType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullBuildingsOperationType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.BuildingsOperationType), nil
}
type BuildingsPassiveType string
const (
BuildingsPassiveTypePassengers BuildingsPassiveType = "passengers"
BuildingsPassiveTypeFuel BuildingsPassiveType = "fuel"
)
func (e *BuildingsPassiveType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = BuildingsPassiveType(s)
case string:
*e = BuildingsPassiveType(s)
default:
return fmt.Errorf("unsupported scan type for BuildingsPassiveType: %T", src)
}
return nil
}
type NullBuildingsPassiveType struct {
BuildingsPassiveType BuildingsPassiveType `json:"buildings_passive_type"`
Valid bool `json:"valid"` // Valid is true if BuildingsPassiveType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullBuildingsPassiveType) Scan(value interface{}) error {
if value == nil {
ns.BuildingsPassiveType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.BuildingsPassiveType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullBuildingsPassiveType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.BuildingsPassiveType), nil
}
type BuildingsStorageSubtype string
const (
BuildingsStorageSubtypeNone BuildingsStorageSubtype = "none"
BuildingsStorageSubtypeAirplane BuildingsStorageSubtype = "airplane"
BuildingsStorageSubtypeHelicopter BuildingsStorageSubtype = "helicopter"
BuildingsStorageSubtypeSeaplane BuildingsStorageSubtype = "seaplane"
BuildingsStorageSubtypeSpaceship BuildingsStorageSubtype = "spaceship"
)
func (e *BuildingsStorageSubtype) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = BuildingsStorageSubtype(s)
case string:
*e = BuildingsStorageSubtype(s)
default:
return fmt.Errorf("unsupported scan type for BuildingsStorageSubtype: %T", src)
}
return nil
}
type NullBuildingsStorageSubtype struct {
BuildingsStorageSubtype BuildingsStorageSubtype `json:"buildings_storage_subtype"`
Valid bool `json:"valid"` // Valid is true if BuildingsStorageSubtype is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullBuildingsStorageSubtype) Scan(value interface{}) error {
if value == nil {
ns.BuildingsStorageSubtype, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.BuildingsStorageSubtype.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullBuildingsStorageSubtype) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.BuildingsStorageSubtype), nil
}
type BuildingsStorageType string
const (
BuildingsStorageTypeFuel BuildingsStorageType = "fuel"
BuildingsStorageTypePlane BuildingsStorageType = "plane"
BuildingsStorageTypeProduct BuildingsStorageType = "product"
)
func (e *BuildingsStorageType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = BuildingsStorageType(s)
case string:
*e = BuildingsStorageType(s)
default:
return fmt.Errorf("unsupported scan type for BuildingsStorageType: %T", src)
}
return nil
}
type NullBuildingsStorageType struct {
BuildingsStorageType BuildingsStorageType `json:"buildings_storage_type"`
Valid bool `json:"valid"` // Valid is true if BuildingsStorageType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullBuildingsStorageType) Scan(value interface{}) error {
if value == nil {
ns.BuildingsStorageType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.BuildingsStorageType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullBuildingsStorageType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.BuildingsStorageType), nil
}
type CountriesContinent string
const (
CountriesContinentVoid CountriesContinent = "void"
CountriesContinentAfrica CountriesContinent = "Africa"
CountriesContinentAntarctica CountriesContinent = "Antarctica"
CountriesContinentAsia CountriesContinent = "Asia"
CountriesContinentEurope CountriesContinent = "Europe"
CountriesContinentNorthAmerica CountriesContinent = "North America"
CountriesContinentOceania CountriesContinent = "Oceania"
CountriesContinentSouthAmerica CountriesContinent = "South America"
)
func (e *CountriesContinent) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = CountriesContinent(s)
case string:
*e = CountriesContinent(s)
default:
return fmt.Errorf("unsupported scan type for CountriesContinent: %T", src)
}
return nil
}
type NullCountriesContinent struct {
CountriesContinent CountriesContinent `json:"countries_continent"`
Valid bool `json:"valid"` // Valid is true if CountriesContinent is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullCountriesContinent) Scan(value interface{}) error {
if value == nil {
ns.CountriesContinent, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.CountriesContinent.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullCountriesContinent) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.CountriesContinent), nil
}
type CurrencyTransactionLogsCurrencyType string
const (
CurrencyTransactionLogsCurrencyTypeCash CurrencyTransactionLogsCurrencyType = "cash"
CurrencyTransactionLogsCurrencyTypeFuel CurrencyTransactionLogsCurrencyType = "fuel"
CurrencyTransactionLogsCurrencyTypePassengers CurrencyTransactionLogsCurrencyType = "passengers"
)
func (e *CurrencyTransactionLogsCurrencyType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = CurrencyTransactionLogsCurrencyType(s)
case string:
*e = CurrencyTransactionLogsCurrencyType(s)
default:
return fmt.Errorf("unsupported scan type for CurrencyTransactionLogsCurrencyType: %T", src)
}
return nil
}
type NullCurrencyTransactionLogsCurrencyType struct {
CurrencyTransactionLogsCurrencyType CurrencyTransactionLogsCurrencyType `json:"currency_transaction_logs_currency_type"`
Valid bool `json:"valid"` // Valid is true if CurrencyTransactionLogsCurrencyType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullCurrencyTransactionLogsCurrencyType) Scan(value interface{}) error {
if value == nil {
ns.CurrencyTransactionLogsCurrencyType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.CurrencyTransactionLogsCurrencyType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullCurrencyTransactionLogsCurrencyType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.CurrencyTransactionLogsCurrencyType), nil
}
type PlanesAircraftSize string
const (
PlanesAircraftSizeSmall PlanesAircraftSize = "small"
PlanesAircraftSizeMedium PlanesAircraftSize = "medium"
PlanesAircraftSizeLarge PlanesAircraftSize = "large"
PlanesAircraftSizeHuge PlanesAircraftSize = "huge"
)
func (e *PlanesAircraftSize) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = PlanesAircraftSize(s)
case string:
*e = PlanesAircraftSize(s)
default:
return fmt.Errorf("unsupported scan type for PlanesAircraftSize: %T", src)
}
return nil
}
type NullPlanesAircraftSize struct {
PlanesAircraftSize PlanesAircraftSize `json:"planes_aircraft_size"`
Valid bool `json:"valid"` // Valid is true if PlanesAircraftSize is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullPlanesAircraftSize) Scan(value interface{}) error {
if value == nil {
ns.PlanesAircraftSize, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.PlanesAircraftSize.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullPlanesAircraftSize) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.PlanesAircraftSize), nil
}
type PlanesAircraftType string
const (
PlanesAircraftTypePlane PlanesAircraftType = "plane"
PlanesAircraftTypeHelicopter PlanesAircraftType = "helicopter"
PlanesAircraftTypeSeaplane PlanesAircraftType = "seaplane"
PlanesAircraftTypeSpaceship PlanesAircraftType = "spaceship"
)
func (e *PlanesAircraftType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = PlanesAircraftType(s)
case string:
*e = PlanesAircraftType(s)
default:
return fmt.Errorf("unsupported scan type for PlanesAircraftType: %T", src)
}
return nil
}
type NullPlanesAircraftType struct {
PlanesAircraftType PlanesAircraftType `json:"planes_aircraft_type"`
Valid bool `json:"valid"` // Valid is true if PlanesAircraftType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullPlanesAircraftType) Scan(value interface{}) error {
if value == nil {
ns.PlanesAircraftType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.PlanesAircraftType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullPlanesAircraftType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.PlanesAircraftType), nil
}
type PlanesOperationType string
const (
PlanesOperationTypePassenger PlanesOperationType = "passenger"
PlanesOperationTypeCargo PlanesOperationType = "cargo"
)
func (e *PlanesOperationType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = PlanesOperationType(s)
case string:
*e = PlanesOperationType(s)
default:
return fmt.Errorf("unsupported scan type for PlanesOperationType: %T", src)
}
return nil
}
type NullPlanesOperationType struct {
PlanesOperationType PlanesOperationType `json:"planes_operation_type"`
Valid bool `json:"valid"` // Valid is true if PlanesOperationType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullPlanesOperationType) Scan(value interface{}) error {
if value == nil {
ns.PlanesOperationType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.PlanesOperationType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullPlanesOperationType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.PlanesOperationType), nil
}
type PlayerPlanesStatus string
const (
PlayerPlanesStatusIdle PlayerPlanesStatus = "idle"
PlayerPlanesStatusMaintenance PlayerPlanesStatus = "maintenance"
PlayerPlanesStatusBoarding PlayerPlanesStatus = "boarding"
PlayerPlanesStatusTaxiing PlayerPlanesStatus = "taxiing"
PlayerPlanesStatusFlying PlayerPlanesStatus = "flying"
)
func (e *PlayerPlanesStatus) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = PlayerPlanesStatus(s)
case string:
*e = PlayerPlanesStatus(s)
default:
return fmt.Errorf("unsupported scan type for PlayerPlanesStatus: %T", src)
}
return nil
}
type NullPlayerPlanesStatus struct {
PlayerPlanesStatus PlayerPlanesStatus `json:"player_planes_status"`
Valid bool `json:"valid"` // Valid is true if PlayerPlanesStatus is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullPlayerPlanesStatus) Scan(value interface{}) error {
if value == nil {
ns.PlayerPlanesStatus, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.PlayerPlanesStatus.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullPlayerPlanesStatus) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.PlayerPlanesStatus), nil
}
type Airport struct {
ID uint32 `json:"id"`
Name string `json:"name"`
UserID int32 `json:"user_id"`
OriginCountryID uint16 `json:"origin_country_id"`
Cash uint64 `json:"cash"`
CurrentPassengers uint32 `json:"current_passengers"`
MaxPassengerCapacity uint32 `json:"max_passenger_capacity"`
CurrentFuel uint32 `json:"current_fuel"`
MaxFuelCapacity uint32 `json:"max_fuel_capacity"`
FuelGenerationRate uint32 `json:"fuel_generation_rate"`
PassengerGenerationRate uint32 `json:"passenger_generation_rate"`
ResourcesLastUpdatedAt time.Time `json:"resources_last_updated_at"`
IsAvailable bool `json:"is_available"`
PlayerLevel uint32 `json:"player_level"`
ExperiencePoints uint64 `json:"experience_points"`
IsDeleted sql.NullBool `json:"is_deleted"`
}
type AirportBuilding struct {
ID uint32 `json:"id"`
AirportID uint32 `json:"airport_id"`
BuildingID uint32 `json:"building_id"`
RecipeID sql.NullInt32 `json:"recipe_id"`
StorageProduct sql.NullInt32 `json:"storage_product"`
Storage1 sql.NullInt32 `json:"storage_1"`
Storage2 sql.NullInt32 `json:"storage_2"`
Storage3 sql.NullInt32 `json:"storage_3"`
Level uint32 `json:"level"`
}
type AirportContract struct {
ID uint32 `json:"id"`
AirportID uint32 `json:"airport_id"`
Title string `json:"title"`
RequiredProductID uint16 `json:"required_product_id"`
RequiredAmount uint32 `json:"required_amount"`
CurrentAmountDelivered uint32 `json:"current_amount_delivered"`
IsCompleted bool `json:"is_completed"`
ExpiresAt time.Time `json:"expires_at"`
}
type AirportInventory struct {
AirportID uint32 `json:"airport_id"`
ProductID uint16 `json:"product_id"`
Quantity uint32 `json:"quantity"`
}
type Building struct {
ID uint32 `json:"id"`
Name string `json:"name"`
MinLevel uint32 `json:"min_level"`
ConstructionCostCash uint32 `json:"construction_cost_cash"`
UpgradeTier sql.NullInt16 `json:"upgrade_tier"`
UpgradeCostCashToUptier sql.NullInt32 `json:"upgrade_cost_cash_to_uptier"`
BuildingType BuildingsBuildingType `json:"building_type"`
Capacity sql.NullInt32 `json:"capacity"`
StorageType NullBuildingsStorageType `json:"storage_type"`
StorageSubtype NullBuildingsStorageSubtype `json:"storage_subtype"`
EffectID sql.NullInt16 `json:"effect_id"`
EffectValue sql.NullInt32 `json:"effect_value"`
OperationSize NullBuildingsOperationSize `json:"operation_size"`
OperationType NullBuildingsOperationType `json:"operation_type"`
PassiveType NullBuildingsPassiveType `json:"passive_type"`
PassiveRate sql.NullInt32 `json:"passive_rate"`
}
type BuildingProduct struct {
ID uint32 `json:"id"`
BuildingID uint32 `json:"building_id"`
RecipeID sql.NullInt32 `json:"recipe_id"`
StorageProduct sql.NullInt32 `json:"storage_product"`
Storage1 sql.NullInt32 `json:"storage_1"`
Storage2 sql.NullInt32 `json:"storage_2"`
Storage3 sql.NullInt32 `json:"storage_3"`
}
type CompletedFlightRoutesLog struct {
ID uint32 `json:"id"`
OriginAirportID uint32 `json:"origin_airport_id"`
DestinationAirportID uint32 `json:"destination_airport_id"`
StartTime time.Time `json:"start_time"`
EndTime sql.NullTime `json:"end_time"`
}
type Country struct {
ID uint16 `json:"id"`
Name string `json:"name"`
Continent CountriesContinent `json:"continent"`
Produce1ID uint16 `json:"produce_1_id"`
Produce2ID uint16 `json:"produce_2_id"`
Produce3ID uint16 `json:"produce_3_id"`
}
type CurrencyTransactionLog struct {
ID uint64 `json:"id"`
AirportID uint32 `json:"airport_id"`
AmountChanged int32 `json:"amount_changed"`
CurrencyType CurrencyTransactionLogsCurrencyType `json:"currency_type"`
Reason string `json:"reason"`
CreatedAt sql.NullTime `json:"created_at"`
}
type Effect struct {
ID uint16 `json:"id"`
Name string `json:"name"`
}
type Plane struct {
ID uint32 `json:"id"`
Name string `json:"name"`
MinLevel uint32 `json:"min_level"`
OperationCostFuel uint32 `json:"operation_cost_fuel"`
OperationCostCash uint32 `json:"operation_cost_cash"`
MaxPassengers sql.NullInt32 `json:"max_passengers"`
TravelTimeInseconds uint32 `json:"travel_time_inseconds"`
OperationType PlanesOperationType `json:"operation_type"`
AircraftSize PlanesAircraftSize `json:"aircraft_size"`
AircraftType PlanesAircraftType `json:"aircraft_type"`
BuyingCostCash uint32 `json:"buying_cost_cash"`
CompletedFlightExperience uint32 `json:"completed_flight_experience"`
CompletedFlightCashReward sql.NullInt32 `json:"completed_flight_cash_reward"`
CompletedFlightCargoReward sql.NullInt32 `json:"completed_flight_cargo_reward"`
}
type PlayerPlane struct {
ID uint32 `json:"id"`
AirportID uint32 `json:"airport_id"`
PlaneID uint32 `json:"plane_id"`
AssignedHangarID uint32 `json:"assigned_hangar_id"`
CurrentBuildingID sql.NullInt32 `json:"current_building_id"`
Status PlayerPlanesStatus `json:"status"`
UpdatedAt sql.NullTime `json:"updated_at"`
FlightStartTime sql.NullTime `json:"flight_start_time"`
}
type Product struct {
ID uint16 `json:"id"`
Name string `json:"name"`
}
type Recipe struct {
ID uint32 `json:"id"`
Name string `json:"name"`
Ingredient1ID sql.NullInt16 `json:"ingredient_1_id"`
Ingredient1Amount sql.NullInt32 `json:"ingredient_1_amount"`
Ingredient2ID sql.NullInt16 `json:"ingredient_2_id"`
Ingredient2Amount sql.NullInt32 `json:"ingredient_2_amount"`
Ingredient3ID sql.NullInt16 `json:"ingredient_3_id"`
Ingredient3Amount sql.NullInt32 `json:"ingredient_3_amount"`
ProductID uint16 `json:"product_id"`
YieldAmount uint32 `json:"yield_amount"`
}
type User struct {
ID int32 `json:"id"`
Username string `json:"username"`
PasswordHash string `json:"password_hash"`
CreatedAt sql.NullTime `json:"created_at"`
DeletedAt sql.NullTime `json:"deleted_at"`
}