Documentation
¶
Index ¶
- type Card
- type Date
- type Flight
- func DeleteFlight(Id int64) (*Flight, error)
- func FindFlight(dep string, dest string) ([]Flight, *gorm.DB)
- func FindFlightByDate(date time.Time) ([]Flight, *gorm.DB)
- func GetAllFlights() []Flight
- func GetFlightByFlightNumber(number int64) (*Flight, *gorm.DB)
- func GetFlightById(ID int64) (*Flight, *gorm.DB)
- type Passenger
- type Passenger_booking
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Flight ¶
type Flight struct { gorm.Model //Flight_ID uint `gorm:"primaryKey"` //CreatedAt time.Time Name string `json:"name"` Tail_number string `json:"tail_number"` Flight_number int64 `json:"flight_number"` Departure_city string `json:"departure_city"` Destination_city string `json:"destination_city"` //Date *time.Time `json:"time"` Seats int64 `json:"seats"` Seats_left int64 `json:"seats_left"` Business_class_price float64 `json:"business_class_price"` Economy_class_price float64 `json:"economy_class_price"` Flight_date *time.Time `json:"flight_date"` }
func DeleteFlight ¶
func GetAllFlights ¶
func GetAllFlights() []Flight
func (*Flight) CreateFlight ¶
type Passenger ¶
type Passenger struct { gorm.Model //ID uint `gorm:"primaryKey"` Name string `json:"first_name"` Middle_name string `json:"middle_name"` Last_name string `json:"last_name"` Passport_number string `json:"passport_number"` Age int8 `json:"age"` User_id int64 }
func DeletePassenger ¶
func GetAllPassengers ¶
func GetAllPassengers() []Passenger
func (*Passenger) CreatePassenger ¶
type Passenger_booking ¶
type Passenger_booking struct { gorm.Model Name string `json:"first_name"` Middle_name string `json:"middle_name"` Last_name string `json:"last_name"` Passport_number string `json:"passport_number"` User_id int64 `json:"user_id"` Age int8 `json:"age"` Booking_Id int64 Flight_Name string `json:"flight_name"` Tail_number string `json:"tail_number"` Flight_Number int64 `"json:"flight_number"` Departure_city string `json:"departure_city"` Destination_city string `json:"destination_city"` Seat_number int64 `json:"seat_number"` Ticket_tier int8 `json:"ticket_tier"` // 0 for economy, 1 for business Paid bool `json:"paid"` Price float64 `json:"price"` }
func GetAllBookings ¶
func GetAllBookings() []Passenger_booking
func GetAllPassengersOnAFlight ¶
func GetAllPassengersOnAFlight(ID int64) []Passenger_booking
func GetBookingById ¶
func GetBookingById(ID int64) (*Passenger_booking, *gorm.DB)
func (*Passenger_booking) CreateBooking ¶
func (p *Passenger_booking) CreateBooking() *Passenger_booking
Click to show internal directories.
Click to hide internal directories.