Documentation
¶
Index ¶
- Constants
- Variables
- func ToRateRulesType(s string) (access.RateRulesType, error)
- type Access
- type BasicOptionGrouper
- type Bed
- type BookPax
- type BookRoom
- type BookingDetail
- type BookingHotel
- type BookingRoom
- type BookingSearchType
- type BookingStatusType
- type BusinessRules
- type BusinessRulesType
- func (e BusinessRulesType) Code() (int, error)
- func (brt BusinessRulesType) HotelApiDescription() string
- func (e BusinessRulesType) IsValid() bool
- func (e BusinessRulesType) MarshalGQL(w io.Writer)
- func (e BusinessRulesType) String() string
- func (e *BusinessRulesType) UnmarshalGQL(v interface{}) error
- type CancelDetail
- type CancelPenalty
- type CancelPenaltyType
- type CancelPolicy
- type ChargeType
- type DateType
- type DeltaPrice
- type DurationType
- type Exchange
- type FilterPlugin
- type FilterPluginType
- type Holder
- type HotelBaseRQ
- type IndexedOptions
- type Markup
- type MarkupRuleType
- type Occupancy
- type Option
- type OptionGroupFunc
- type OptionGrouper
- type OptionID
- type OptionIdPrice
- type OptionIdRoom
- type OptionIndexFunc
- type OptionQuote
- type OptionType
- type Options
- type Pax
- type PaymentCard
- type PaymentCardExpiration
- type PaymentCardType
- type PaymentType
- type Plugin
- type PluginFilter
- type PluginStep
- type PluginStepType
- type PluginType
- type Plugins
- type Price
- type PriceBreakDown
- type PriceType
- type Promotion
- type Rate
- type RatePlan
- type Reference
- type Resort
- type Room
- type RoomPrice
- type Rule
- type Settings
- type SettingsBase
- type StatusType
- type Supplement
- type SupplementType
- type Supplier
- type Surcharge
- type UnitTimeType
Constants ¶
const ( VI PaymentCardType = "" AX = "" BC = "" CA = "" CB = "" CU = "" DS = "" DC = "" T = "" R = "" N = "" L = "" E = "" JC = "" TO = "" S = "" EC = "" EU = "" TP = "" OP = "" ER = "" XS = "" O = "" )
Variables ¶
var UnknownType = fmt.Errorf("unknown input type")
Functions ¶
func ToRateRulesType ¶
func ToRateRulesType(s string) (access.RateRulesType, error)
Types ¶
type Access ¶
type Access struct { AccessId string Configuration *access.AccessConfiguration Settings *SettingsBase }
type BasicOptionGrouper ¶
type BasicOptionGrouper struct { // IndexFunc builds an index from an Option IndexFunc OptionIndexFunc // OptionGroupFunc takes a set of options and an option that results in another set of options GroupFunc OptionGroupFunc GroupLenValue int }
BasicOptionGrouper is a straightforward implementation of OptionGrouper that can be instanced with index and group functions, this package provides some of them
func (BasicOptionGrouper) Group ¶
func (og BasicOptionGrouper) Group(idx string, opts Options, opt *Option) Options
func (BasicOptionGrouper) GroupLen ¶
func (og BasicOptionGrouper) GroupLen() int
func (BasicOptionGrouper) Index ¶
func (og BasicOptionGrouper) Index(opt *Option) string
type BookingDetail ¶
type BookingDetail struct { Reference Reference Holder *Holder Hotel *BookingHotel Price *Price CancelPolicy *CancelPolicy Remarks *string Status BookingStatusType Payable *string Supplier string OptionIDRq *OptionID }
func (*BookingDetail) Prices ¶
func (o *BookingDetail) Prices() []*Price
type BookingHotel ¶
type BookingRoom ¶
type BookingSearchType ¶
type BookingSearchType int
const ( Dates BookingSearchType = iota References )
func (BookingSearchType) HotelApiDescription ¶
func (dt BookingSearchType) HotelApiDescription() string
type BookingStatusType ¶
type BookingStatusType string
const ( BookKO BookingStatusType = "KO" BookOK BookingStatusType = "OK" BookRQ BookingStatusType = "ON_REQUEST" BookCN BookingStatusType = "CANCELLED" BookUN BookingStatusType = "UNKNOWN" )
func ToBookingStatusType ¶
func ToBookingStatusType(s string) (BookingStatusType, error)
type BusinessRules ¶
type BusinessRules struct { OptionsQuota *int BusinessRulesType *BusinessRulesType }
type BusinessRulesType ¶
type BusinessRulesType string
const ( BusinessRulesTypeCheaperAmount BusinessRulesType = "CHEAPER_AMOUNT" BusinessRulesTypeRoomType BusinessRulesType = "ROOM_TYPE" )
func CheckBusinessRuleType ¶
func CheckBusinessRuleType(s BusinessRulesType) (BusinessRulesType, error)
func (BusinessRulesType) Code ¶
func (e BusinessRulesType) Code() (int, error)
func (BusinessRulesType) HotelApiDescription ¶
func (brt BusinessRulesType) HotelApiDescription() string
func (BusinessRulesType) IsValid ¶
func (e BusinessRulesType) IsValid() bool
func (BusinessRulesType) MarshalGQL ¶
func (e BusinessRulesType) MarshalGQL(w io.Writer)
func (BusinessRulesType) String ¶
func (e BusinessRulesType) String() string
func (*BusinessRulesType) UnmarshalGQL ¶
func (e *BusinessRulesType) UnmarshalGQL(v interface{}) error
type CancelDetail ¶
type CancelDetail struct { Reference *Reference CancellationReference *string Status *BookingStatusType Price *Price }
func (*CancelDetail) Prices ¶
func (cd *CancelDetail) Prices() []*Price
type CancelPenalty ¶
type CancelPenalty struct { HoursBefore int `json:"hoursBefore"` Type CancelPenaltyType `json:"penaltyType" gqlgen:"penaltyType"` Currency string `json:"currency"` // Zechao: ha cambiado de amount a value, borra el comentario Value float64 `json:"value"` }
type CancelPenaltyType ¶
type CancelPenaltyType string
const ( CancelPenaltyTypeNights CancelPenaltyType = "NIGHTS" CancelPenaltyTypePercent CancelPenaltyType = "PERCENT" CancelPenaltyTypeImport CancelPenaltyType = "IMPORT" )
func ToCancelPenaltyType ¶
func ToCancelPenaltyType(s string) (CancelPenaltyType, error)
func (CancelPenaltyType) IsValid ¶
func (e CancelPenaltyType) IsValid() bool
func (CancelPenaltyType) MarshalGQL ¶
func (e CancelPenaltyType) MarshalGQL(w io.Writer)
func (CancelPenaltyType) String ¶
func (e CancelPenaltyType) String() string
func (*CancelPenaltyType) UnmarshalGQL ¶
func (e *CancelPenaltyType) UnmarshalGQL(v interface{}) error
type CancelPolicy ¶
type CancelPolicy struct { Refundable bool `json:"refundable"` CancelPenalties []CancelPenalty `json:"cancelPenalties"` }
type ChargeType ¶
type ChargeType string
const ( ChargeTypeInclude ChargeType = "INCLUDE" ChargeTypeExclude ChargeType = "EXCLUDE" )
func (ChargeType) IsValid ¶
func (e ChargeType) IsValid() bool
func (ChargeType) MarshalGQL ¶
func (e ChargeType) MarshalGQL(w io.Writer)
func (ChargeType) String ¶
func (e ChargeType) String() string
func (*ChargeType) UnmarshalGQL ¶
func (e *ChargeType) UnmarshalGQL(v interface{}) error
type DeltaPrice ¶
type DurationType ¶
type DurationType string
const ( DurationTypeRange DurationType = "RANGE" DurationTypeOpen DurationType = "OPEN" )
func ToDurationType ¶
func ToDurationType(s string) (DurationType, error)
func (DurationType) IsValid ¶
func (e DurationType) IsValid() bool
func (DurationType) MarshalGQL ¶
func (e DurationType) MarshalGQL(w io.Writer)
func (DurationType) String ¶
func (e DurationType) String() string
func (*DurationType) UnmarshalGQL ¶
func (e *DurationType) UnmarshalGQL(v interface{}) error
type FilterPlugin ¶
type FilterPlugin struct { Step PluginStepType Type PluginType Name string }
type FilterPluginType ¶
type FilterPluginType struct { Includes *[]FilterPlugin Excludes *[]FilterPlugin }
type HotelBaseRQ ¶
type HotelBaseRQ struct {
Settings *Settings `gqlgen:"settings"`
}
type IndexedOptions ¶
IndexedOptions is group of indexed sets of options
func (IndexedOptions) ToOptions ¶
func (r IndexedOptions) ToOptions() Options
type Markup ¶
type Markup struct { Channel *string `json:"channel"` Currency string `json:"currency"` Binding bool `json:"binding"` Net float64 `json:"net"` Gross float64 `json:"gross"` Exchange Exchange `json:"exchange"` Rules []Rule `json:"rules"` }
func (Markup) IsPriceable ¶
func (Markup) IsPriceable()
type MarkupRuleType ¶
type MarkupRuleType string
const ( MarkupRuleTypePercent MarkupRuleType = "PERCENT" MarkupRuleTypeImport MarkupRuleType = "IMPORT" )
func (MarkupRuleType) IsValid ¶
func (e MarkupRuleType) IsValid() bool
func (MarkupRuleType) MarshalGQL ¶
func (e MarkupRuleType) MarshalGQL(w io.Writer)
func (MarkupRuleType) String ¶
func (e MarkupRuleType) String() string
func (*MarkupRuleType) UnmarshalGQL ¶
func (e *MarkupRuleType) UnmarshalGQL(v interface{}) error
type Option ¶
type Option struct { Supplier string `json:"supplierCode" gqlgen:"supplierCode"` Access string `json:"accessCode" gqlgen:"accessCode"` Market string `json:"market"` HotelCode string `json:"hotelCode"` HotelName *string `json:"hotelName"` BoardCode *string `json:"boardCode"` BoardCodeOriginal string `gqlgen:"boardCodeSupplier"` PaymentType PaymentType `json:"-"` Status StatusType `json:"status"` Occupancies []Occupancy `json:"occupancies"` Rooms []Room `json:"rooms"` Price Price `json:"price"` Supplements []*Supplement `json:"supplements"` Surcharges []Surcharge `json:"surcharges"` RateRules []access.RateRulesType `json:"rateRules"` CancelPolicy *CancelPolicy `json:"cancelPolicy"` Remarks *string `json:"remarks"` OptionID string `json:"id" gqlgen:"id"` Id OptionID `json:"-"` Token string `json:"token"` Context *string `json:"-"` Group *string `json:"-"` RqDeepLink *string `json:"-"` Criteria string `json:"-"` }
func (*Option) HotelCodeSupplier ¶
func (*Option) IsBookableOptionSearch ¶
func (*Option) IsBookableOptionSearch()
func (*Option) PriceOption ¶
type OptionGroupFunc ¶
OptionGroupFunc takes a set of options and an option that results in another set of options
func OptionLimitedAppend ¶
func OptionLimitedAppend(groupLimit uint) OptionGroupFunc
OptionLimitedAppend appends the option to the set
type OptionGrouper ¶
type OptionGrouper interface { // Index builds an option's index, two options with the same Index will be grouped Index(*Option) string // Group takes a set of options already grouped, a new option that belongs to this group, and a group result Group(string, Options, *Option) Options // GroupLen is the len used when instancing new groups GroupLen() int }
OptionGrouper permits to make option groups given different patterns
type OptionID ¶
type OptionID struct { StartDate string EndDate string HotelCode string BoardCode string PaymentType PaymentType Market string Nationality string Language string Currency string OptionsQuota *int32 BusinessRules *BusinessRulesType AccessCode string Rooms []OptionIdRoom Parameters []access.Parameter `json:"p"` Price *OptionIdPrice // markup needed fields, we need codes in the context request in search ContextHC string // needs to be a pointer, its value is updated after parsing response, since OptionId is generated at resolving time // it will contain the correct value ContextBoard *string Rate Rate // only from quote to book Refundable bool }
type OptionIdPrice ¶
type OptionIndexFunc ¶
OptionIndexFunc builds an index from an Option
type OptionQuote ¶
type OptionQuote struct { OptionRefId string Status StatusType Price Price CancelPolicy CancelPolicy Remarks *string Surcharges []Surcharge PaymentCards *[]string OptionId *OptionID Supplier string }
func (*OptionQuote) Prices ¶
func (o *OptionQuote) Prices() []*Price
type OptionType ¶
type OptionType string
const ( Hotel OptionType = "HOTEL" HotelSkiPass OptionType = "HOTEL_SKI_PASS" HotelEntrance OptionType = "HOTEL_ENTRANCE" )
type Options ¶
type Options []*Option
Options is a set of options with helper methods
func OptionAppend ¶
OptionAppend appends the option to the set
func (Options) GroupBy ¶
func (opts Options) GroupBy(og OptionGrouper) IndexedOptions
GroupBy takes 'Options' and indexes them by an 'OptionGrouper'
func (Options) SortByNetPrice ¶
func (opts Options) SortByNetPrice()
SortByNetPrice will sort options from the lowest net price to the highest
type PaymentCard ¶
type PaymentCard struct { CardType string Holder Holder Number string CVC string Expire PaymentCardExpiration }
type PaymentCardExpiration ¶
type PaymentCardType ¶
type PaymentCardType string
type PaymentType ¶
type PaymentType string
const ( PaymentTypeMerchant PaymentType = "MERCHANT" PaymentTypeDirect PaymentType = "DIRECT" PaymentTypeCardBooking PaymentType = "CARD_BOOKING" PaymentTypeCardCheckIn PaymentType = "CARD_CHECK_IN" )
func ToPaymentType ¶
func ToPaymentType(s string) (PaymentType, error)
func (PaymentType) Code ¶
func (e PaymentType) Code() int
func (PaymentType) Description ¶
func (pt PaymentType) Description() string
func (PaymentType) HotelApiDescription ¶
func (e PaymentType) HotelApiDescription() string
func (PaymentType) IsValid ¶
func (e PaymentType) IsValid() bool
func (PaymentType) MarshalGQL ¶
func (e PaymentType) MarshalGQL(w io.Writer)
func (PaymentType) String ¶
func (e PaymentType) String() string
func (*PaymentType) UnmarshalGQL ¶
func (e *PaymentType) UnmarshalGQL(v interface{}) error
type PluginFilter ¶
type PluginFilter struct {
Plugin *FilterPluginType
}
type PluginStep ¶
type PluginStep struct { Step PluginStepType PluginsType *[]Plugin }
type PluginStepType ¶
type PluginStepType string
const ( PluginStepTypeRequest PluginStepType = "REQUEST" PluginStepTypeRequestAccess PluginStepType = "REQUEST_ACCESS" PluginStepTypeResponseOption PluginStepType = "RESPONSE_OPTION" PluginStepTypeResponseAccess PluginStepType = "RESPONSE_ACCESS" PluginStepTypeResponse PluginStepType = "RESPONSE" )
func (PluginStepType) IsValid ¶
func (e PluginStepType) IsValid() bool
func (PluginStepType) MarshalGQL ¶
func (e PluginStepType) MarshalGQL(w io.Writer)
func (PluginStepType) String ¶
func (e PluginStepType) String() string
func (*PluginStepType) UnmarshalGQL ¶
func (e *PluginStepType) UnmarshalGQL(v interface{}) error
type PluginType ¶
type PluginType string
const ( PluginTypePreStep PluginType = "PRE_STEP" PluginTypeHotelMap PluginType = "HOTEL_MAP" PluginTypeBoardMap PluginType = "BOARD_MAP" PluginTypeRoomMap PluginType = "ROOM_MAP" PluginTypeCurrencyConversion PluginType = "CURRENCY_CONVERSION" PluginTypeMarkup PluginType = "MARKUP" PluginTypeAggregation PluginType = "AGGREGATION" PluginTypePostStep PluginType = "POST_STEP" )
func (PluginType) IsValid ¶
func (e PluginType) IsValid() bool
func (PluginType) MarshalGQL ¶
func (e PluginType) MarshalGQL(w io.Writer)
func (PluginType) String ¶
func (e PluginType) String() string
func (*PluginType) UnmarshalGQL ¶
func (e *PluginType) UnmarshalGQL(v interface{}) error
type Plugins ¶
type Plugins struct { Plugins *[]PluginStep Filter *PluginFilter }
type Price ¶
type Price struct { Currency string `json:"currency"` Binding bool `json:"binding"` Net float64 `json:"net"` Gross float64 `json:"gross"` CommissionIntegration float64 `json:"-"` CommissionPluginApplied bool `json:"-"` Exchange Exchange `json:"exchange"` Markups []Markup `json:"markups"` CommissionNet float64 `json:"-"` CommissionGross float64 `json:"-"` }
func (Price) ApplyCommissionBlue ¶
don't use if NewPrice is not used previously
func (Price) ApplyCommissionRed ¶
don't use if NewPrice is not used previously
func (Price) IsPriceable ¶
func (Price) IsPriceable()
type PriceBreakDown ¶
type Room ¶
type Room struct { OccupancyRefID int `json:"occupancyRefId"` Code *string `json:"code"` //Pointer because we need change value by the mapper OriginalCode string Description *string `json:"description"` Refundable *bool `json:"refundable"` Units *int `json:"units"` RoomPrice RoomPrice `json:"roomPrice"` Beds []Bed `json:"beds"` RatePlans []RatePlan `json:"ratePlans"` Promotions []Promotion `json:"promotions"` }
type RoomPrice ¶
type RoomPrice struct { Price Price `json:"price"` Breakdown []PriceBreakDown `json:"breakdowns"` }
type Settings ¶
type Settings struct { SettingsBase Context *string Client *string Group *string Org string Suppliers *[]Supplier Plugins *[]PluginStep TestMode *bool ClientTokens *[]string // deprecated UseContext *bool ConnectUser *string // pinxo IsClientNewCommission_pinxo bool IsClientMap_pinxo bool IsAvorisClient_pinxo bool IsClientDiscardBoardMap_pinxo bool IsClientDiscardRoomMap_pinxo bool IsClientDiscardRateMap_pinxo bool }
type SettingsBase ¶
type SettingsBase struct { Timeout *int AuditTransactions *bool BusinessRules *BusinessRules Currency *string }
type StatusType ¶
type StatusType string
const ( StatusTypeOk StatusType = "OK" StatusTypeRq StatusType = "RQ" )
func ToStatusType ¶
func ToStatusType(s string) (StatusType, error)
func (StatusType) IsValid ¶
func (e StatusType) IsValid() bool
func (StatusType) MarshalGQL ¶
func (e StatusType) MarshalGQL(w io.Writer)
func (StatusType) String ¶
func (e StatusType) String() string
func (*StatusType) UnmarshalGQL ¶
func (e *StatusType) UnmarshalGQL(v interface{}) error
type Supplement ¶
type Supplement struct { Code *string //Pointer because we need change value by the mapper Name *string Description *string SupplementType SupplementType ChargeType ChargeType Mandatory bool DurationType *DurationType Quantity *int Unit *UnitTimeType EffectiveDate *string ExpireDate *string Resort *Resort Price *Price }
type SupplementType ¶
type SupplementType string
const ( SupplementTypeSkiPass SupplementType = "SKI_PASS" SupplementTypeLessons SupplementType = "LESSONS" SupplementTypeMeals SupplementType = "MEALS" SupplementTypeEquipment SupplementType = "EQUIPMENT" SupplementTypeTicket SupplementType = "TICKET" SupplementTypeTransfers SupplementType = "TRANSFERS" SupplementTypeGala SupplementType = "GALA" SupplementTypeActivity SupplementType = "ACTIVITY" )
func ToSupplementType ¶
func ToSupplementType(s string) (SupplementType, error)
func (SupplementType) IsValid ¶
func (e SupplementType) IsValid() bool
func (SupplementType) MarshalGQL ¶
func (e SupplementType) MarshalGQL(w io.Writer)
func (SupplementType) String ¶
func (e SupplementType) String() string
func (*SupplementType) UnmarshalGQL ¶
func (e *SupplementType) UnmarshalGQL(v interface{}) error
type Supplier ¶
type Supplier struct { Settings *SettingsBase Code string Accesses *[]Access }
type Surcharge ¶
type Surcharge struct { ChargeType ChargeType Mandatory bool Price Price Description *string }
type UnitTimeType ¶
type UnitTimeType string
const ( UnitTimeTypeDay UnitTimeType = "DAY" UnitTimeTypeHour UnitTimeType = "HOUR" )
func ToUnitType ¶
func ToUnitType(s string) (UnitTimeType, error)
func (UnitTimeType) IsValid ¶
func (e UnitTimeType) IsValid() bool
func (UnitTimeType) MarshalGQL ¶
func (e UnitTimeType) MarshalGQL(w io.Writer)
func (UnitTimeType) String ¶
func (e UnitTimeType) String() string
func (*UnitTimeType) UnmarshalGQL ¶
func (e *UnitTimeType) UnmarshalGQL(v interface{}) error
Source Files
¶
- access.go
- base_rq.go
- bed.go
- book_pax.go
- book_room.go
- booking_detail.go
- booking_hotel.go
- booking_room.go
- business_rules.go
- cancel_detail.go
- cancel_penalty.go
- cancel_policy.go
- credit_card.go
- delta_price.go
- enum.go
- exchange.go
- holder.go
- markup.go
- occupancy.go
- option.go
- option_id.go
- option_quote.go
- pax.go
- plugin.go
- price.go
- price_break_down.go
- promotion.go
- ratePlan.go
- reference.go
- resort.go
- room.go
- room_price.go
- rule.go
- setting_base.go
- settings.go
- supplement.go
- supplier.go
- surcharge.go