models

package
v0.0.0-...-477ec14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2024 License: GPL-3.0 Imports: 3 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBModel

type DBModel struct {
	ID        uuid.UUID       `gorm:"primaryKey;type:uuid" json:"id"`
	CreatedAt time.Time       `json:"created_at"`
	UpdatedAt *time.Time      `json:"updated_at"`
	DeletedAt *gorm.DeletedAt `json:"deleted_at"`
}

func (*DBModel) BeforeCreate

func (d *DBModel) BeforeCreate(tx *gorm.DB) (err error)

type FareClass

type FareClass struct {
	AdultFare  int64 `json:"adult_fare"`
	ChildFare  int64 `json:"child_fare"`
	InfantFare int64 `json:"infant_fare"`
}

type Flight

type Flight struct {
	DBModel
	FlightNumber   string      `gorm:"size:255" json:"flight_number"`
	Source         string      `gorm:"size:255" json:"source"`
	Destination    string      `gorm:"size:255" json:"destination"`
	DepartureDate  time.Time   `json:"departure_date"`
	FlightDuration int         `json:"flight_duration"`
	ArrivalDate    time.Time   `json:"arrival_date"`
	AirlineName    string      `gorm:"size:255" json:"airline_name"`
	AircraftName   string      `gorm:"size:255" json:"aircraft_name"`
	FareClass      FareClass   `gorm:"embedded"`
	Tax            int64       `json:"tax"`
	FlightClass    FlightClass `gorm:"size:255" json:"flight_class"`
	RemainingSeat  int         `json:"remaining_seat"`
}

type FlightClass

type FlightClass string
const (
	Economy    FlightClass = "Economy"
	Business   FlightClass = "Business"
	FirstClass FlightClass = "First Class"
)

type FlightSearchRequest

type FlightSearchRequest struct {
	Source             string `json:"source"`
	Destination        string `json:"destination"`
	DepartureDate      string `json:"departure_date"`
	DepartureDateStart time.Time
	DepartureDateEnd   time.Time
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL