models

package
v0.0.0-...-b1fe86a Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Card

type Card struct {
	Name            string
	Billing_Address string
	Number          string
	CVV             int8
	Expiry          string
}

type Date

type Date struct {
	Flight_date string `json:"flight_date"`
}

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 DeleteFlight(Id int64) Flight

func FindFlight

func FindFlight(dep string, dest string) ([]Flight, *gorm.DB)

func FindFlightByDate

func FindFlightByDate(date time.Time) ([]Flight, *gorm.DB)

func GetAllFlights

func GetAllFlights() []Flight

func GetFlightByFlightNumber

func GetFlightByFlightNumber(number int64) (*Flight, *gorm.DB)

func GetFlightById

func GetFlightById(ID int64) (*Flight, *gorm.DB)

func (*Flight) CreateFlight

func (p *Flight) CreateFlight() *Flight

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 DeletePassenger(Id int64) Passenger

func GetAllPassengers

func GetAllPassengers() []Passenger

func GetPassengerById

func GetPassengerById(ID int64) (*Passenger, *gorm.DB)

func GetPassengerByUserId

func GetPassengerByUserId(ID int64) (*Passenger, *gorm.DB)

func (*Passenger) CreatePassenger

func (p *Passenger) CreatePassenger() *Passenger

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

Jump to

Keyboard shortcuts

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