bookings

package
v0.0.0-2429 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllBookingStatuses

func GetAllBookingStatuses() *allBookingStatuses

Types

type BookingData

type BookingData struct {
	Id                 Identifier                    `json:"bookingIdentifier"`
	Reference          resharmonics.BookingReference `json:"bookingReference"`
	Status             BookingStatus                 `json:"status"`
	StartDate          string                        `json:"startDate"` // just date as 2005-01-01
	EndDate            string                        `json:"endDate"`   // just date as 2005-01-01
	Guests             []contact.Details             `json:"guests"`
	Property           property.PropertyData         `json:"property"`
	NightlyAverageRate float64                       `json:"nightlyAverageRate"`
	Invoices           []financials.Invoice          `json:"invoices"`
	Extras             []Extra                       `json:"extras"`
	BookingAccountName string                        `json:"bookingAccountName"`
	BillingAccountName string                        `json:"billingAccountName"`
}

BookingData is the raw payload format as returned by the Resharmonics API endpoint /bookings

type BookingL

type BookingL struct {
	Id        Identifier                    `json:"bookingIdentifier"`
	Reference resharmonics.BookingReference `json:"bookingReference"`
	Status    BookingStatus                 `json:"status"`
	Period    utils.BookingPeriod           `json:"period"`
	Guests    []contact.Details             `json:"guests"`
	Property  property.PropertyData         `json:"property"`
	Extras    []Extra                       `json:"extras"`
}

BookingL is just a bit more parsed and less raw than BookingData. Otherwise just the sae

type BookingS

type BookingS struct {
	Reference      resharmonics.BookingReference `json:"bookingReference"`
	Identifier     Identifier                    `json:"bookingIdentifier"`
	Period         utils.BookingPeriod           `json:"period"`
	ContactDetails contact.Details               `json:"contactDetails"`
	Invoices       []*financials.Invoice         `json:"invoices"`
	Property       property.PropertyData         `json:"property"`
}

BookingS is just a bit more parsed and less raw than BookingData. Otherwise just the sae

type BookingSearchResponse

type BookingSearchResponse struct {
	Results []*BookingData `json:"results"`
}

type BookingStatus

type BookingStatus string

type BookingsClient

type BookingsClient interface {
	List(period utils.BookingPeriod, lastUpdated *time.Time, status []*BookingStatus, pagination *utils.Pagination) ([]*BookingL, error)
	Get(bookingIdentified Identifier) (*BookingS, error)
	GetStatus(id Identifier) (BookingStatus, error)
}

func Init

func Init(creds resharmonics.Credentials, preAuthorize bool) (BookingsClient, error)

type Extra

type Extra struct {
	ID             ExtraID      `json:"id"`
	Description    string       `json:"description"`
	WebDescription string       `json:"webDescription"`
	Frequency      string       `json:"frequency"`
	WebCategory    string       `json:"webCategory"`
	Compulsory     bool         `json:"compulsory"`
	Pricing        ExtraPricing `json:"grossNetVat"`
}

type ExtraID

type ExtraID int

type ExtraPricing

type ExtraPricing struct {
	Gross float64 `json:"gross"`
	Net   float64 `json:"net"`
	Vat   float64 `json:"vat"`
}

type Identifier

type Identifier string

func MergeBookingIdentifiers

func MergeBookingIdentifiers(s1 []Identifier, s2 []Identifier) []Identifier

type RawBookingS

type RawBookingS struct {
	Reference       resharmonics.BookingReference `json:"bookingReference"`
	Id              Identifier                    `json:"bookingIdentifier"`
	MaxOccupancy    int                           `json:"maxOccupancy"`
	Guest           contact.Details               `json:"contactDetails"`
	Period          RawSinglePeriod               `json:"datePeriod"`
	Extras          []Extra                       `json:"extras"`
	FloorSpace      *string                       `json:"floorSpace"`
	UnitName        *string                       `json:"unitName"`
	UnitType        string                        `json:"unitType"`
	Description     string                        `json:"description"`
	Invoices        []financials.Invoice          `json:"invoices"`
	BuildingAddress property.Address              `json:"buildingAddress"`
	BuildingName    string                        `json:"buildingName"`
	Features        []property.Feature            `json:"features"`
	Currency        string                        `json:"currencySymbol"`
}

type RawSinglePeriod

type RawSinglePeriod struct {
	From string `json:"dateFrom"`
	To   string `json:"dateTo"`
}

type StatusResponse

type StatusResponse struct {
	Status BookingStatus `json:"status"`
}

Jump to

Keyboard shortcuts

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