service

package
v0.0.0-...-7a45337 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSuchBooking = errors.New("no such booking")
)

Functions

This section is empty.

Types

type BookTripRequest

type BookTripRequest struct {
	Name        string                     `json:"name"`
	TripName    string                     `json:"trip_name"`
	Destination string                     `json:"destination"`
	Start       time.Time                  `json:"start"`
	End         time.Time                  `json:"end"`
	Members     []string                   `json:"members"`
	Flight      *flights.BookFlightRequest `json:"flight,omitempty"`
	Hotel       *hotels.BookHotelRequest   `json:"hotel,omitempty"`
	Car         *cars.BookCarRentalRequest `json:"car,omitempty"`
}

func (*BookTripRequest) Validate

func (b *BookTripRequest) Validate() error

type TripBooking

type TripBooking struct {
	Request   *BookTripRequest `json:"request"`
	Created   time.Time        `json:"created"`
	Ref       string           `json:"ref"`
	FlightRef string           `json:"flight_ref"`
	HotelRef  string           `json:"hotel_ref"`
	CarRef    string           `json:"car_ref"`
}

type TripConfirmation

type TripConfirmation struct {
	Ref                   string                      `json:"ref"`
	Trip                  *BookTripRequest            `json:"trip"`
	FlightConfirmation    *flights.FlightConfirmation `json:"flight_confirmation,omitempty"`
	HotelConfirmation     *hotels.HotelConfirmation   `json:"hotel_confirmation,omitempty"`
	CarRentalConfirmation *cars.CarRentalConfirmation `json:"car_rental_confirmation,omitempty"`
}

type TripService

type TripService interface {
	BookTrip(context.Context, *BookTripRequest) (*TripConfirmation, error)
	GetBooking(ctx context.Context, ref string) (*TripConfirmation, error)
}

func NewTripService

func NewTripService() (TripService, error)

Jump to

Keyboard shortcuts

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