rateplans

package
v0.0.0-...-5a83cc3 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdditionalGuestAmount

type AdditionalGuestAmount struct {
	AgeQualifyingCode *AgeQualifyingCode `xml:"AgeQualifyingCode,attr"`
	MinAge            *int               `xml:"MinAge,attr,omitempty"`
	MaxAge            *int               `xml:"MaxAge,attr,omitempty"`
	Amount            *string            `xml:"Amount,attr"`
}

func (AdditionalGuestAmount) IsAdult

func (a AdditionalGuestAmount) IsAdult() bool

func (AdditionalGuestAmount) IsChild

func (a AdditionalGuestAmount) IsChild() bool

type AgeQualifyingCode

type AgeQualifyingCode int
const (
	AgeQualifyingCodeAdult AgeQualifyingCode = 10
	AgeQualifyingCodeChild AgeQualifyingCode = 8
)

type BaseByGuestAmt

type BaseByGuestAmt struct {
	Type              *RatePlanChargeType `xml:"Type,attr,omitempty"`
	NumberOfGuests    *int                `xml:"NumberOfGuests,attr,omitempty"`
	AgeQualifyingCode *AgeQualifyingCode  `xml:"AgeQualifyingCode,attr,omitempty"`
	AmountAfterTax    *string             `xml:"AmountAfterTax,attr,omitempty"`
}

type BookingRule

type BookingRule struct {
	Start               timex.Date         `xml:"Start,attr"`
	End                 timex.Date         `xml:"End,attr"`
	Code                string             `xml:"Code,attr"`
	CodeContext         CodeContext        `xml:"CodeContext,attr"`
	LengthsOfStay       []LengthOfStay     `xml:"LengthsOfStay>LengthOfStay"`
	ArrivalDaysOfWeek   *DaysOfWeek        `xml:"DOW_Restrictions>ArrivalDaysOfWeek"`
	DepartureDaysOfWeek *DaysOfWeek        `xml:"DOW_Restrictions>DepartureDaysOfWeek"`
	RestrictionStatus   *RestrictionStatus `xml:"RestrictionStatus,omitempty"`
}

func (BookingRule) DateRange

func (b BookingRule) DateRange() timex.DateRange

type CodeContext

type CodeContext string
const (
	CodeContextRoomType CodeContext = "ROOMTYPE"
)

type DaysOfWeek

type DaysOfWeek struct {
	Mon  *bool `xml:"Mon,attr,omitempty"`
	Tue  *bool `xml:"Tue,attr,omitempty"`
	Weds *bool `xml:"Weds,attr,omitempty"`
	Thur *bool `xml:"Thur,attr,omitempty"`
	Fri  *bool `xml:"Fri,attr,omitempty"`
	Sat  *bool `xml:"Sat,attr,omitempty"`
	Sun  *bool `xml:"Sun,attr,omitempty"`
}

type Discount

type Discount struct {
	Percent          int    `xml:"Percent,attr"`
	NightsRequired   int    `xml:"NightsRequired,attr,omitempty"`
	NightsDiscounted int    `xml:"NightsDiscounted,attr,omitempty"`
	DiscountPattern  string `xml:"DiscountPattern,attr,omitempty"`
}

type GalleryItem

type GalleryItem struct {
	Image           common.URL
	Descriptions    []common.Description
	CopyrightNotice string
	Attribution     common.URL
}

type Guest

type Guest struct {
	AgeQualifyingCode       AgeQualifyingCode `xml:"AgeQualifyingCode,attr"`
	MaxAge                  int               `xml:"MaxAge,attr"`
	MinCount                int               `xml:"MinCount,attr"`
	FirstQualifyingPosition int               `xml:"FirstQualifyingPosition,attr"`
	LastQualifyingPosition  int               `xml:"LastQualifyingPosition,attr"`
}

type HotelRatePlanNotifRQ

type HotelRatePlanNotifRQ struct {
	XMLName   xml.Name  `xml:"http://www.opentravel.org/OTA/2003/05 OTA_HotelRatePlanNotifRQ"`
	UniqueID  *UniqueID `xml:"UniqueID,omitempty"`
	RatePlans RatePlans `xml:"RatePlans"`
}

func (HotelRatePlanNotifRQ) HotelCode

func (h HotelRatePlanNotifRQ) HotelCode() string

func (HotelRatePlanNotifRQ) IsReset

func (r HotelRatePlanNotifRQ) IsReset() bool

type HotelRatePlanNotifRS

type HotelRatePlanNotifRS struct {
	common.Response

	XMLName xml.Name `xml:"http://www.opentravel.org/OTA/2003/05 OTA_HotelRatePlanNotifRS"`
	Version string   `xml:"Version,attr"`
}

type HotelRatePlanNotifValidator

type HotelRatePlanNotifValidator struct {
	// contains filtered or unexported fields
}

func (*HotelRatePlanNotifValidator) Validate

type HotelRatePlanNotifValidatorFunc

type HotelRatePlanNotifValidatorFunc func(*HotelRatePlanNotifValidator)

func WithDepartureDOW

func WithDepartureDOW() HotelRatePlanNotifValidatorFunc

func WithFamilyOffer

func WithFamilyOffer() HotelRatePlanNotifValidatorFunc

func WithFreeNightOffer

func WithFreeNightOffer() HotelRatePlanNotifValidatorFunc

func WithGenericBookingRules

func WithGenericBookingRules() HotelRatePlanNotifValidatorFunc

func WithOfferRuleBookingOffset

func WithOfferRuleBookingOffset() HotelRatePlanNotifValidatorFunc

func WithOfferRuleDOWLOS

func WithOfferRuleDOWLOS() HotelRatePlanNotifValidatorFunc

func WithRatePlanJoin

func WithRatePlanJoin() HotelRatePlanNotifValidatorFunc

func WithRatePlanMapping

func WithRatePlanMapping(mapping map[string]MasterRatePlan) HotelRatePlanNotifValidatorFunc

func WithRoomTypeBookingRules

func WithRoomTypeBookingRules() HotelRatePlanNotifValidatorFunc

func WithSupplements

func WithSupplements() HotelRatePlanNotifValidatorFunc

type Instance

type Instance string
const (
	InstanceCompleteSet Instance = "CompleteSet"
)

type InvType

type InvType string
const (
	InvTypeExtra InvType = "EXTRA"
)

type LengthOfStay

type LengthOfStay struct {
	Time              int      `xml:"Time,attr"`
	TimeUnit          TimeUnit `xml:"TimeUnit,attr"`
	MinMaxMessageType StayType `xml:"MinMaxMessageType,attr"`
}

type ListItem

type ListItem struct {
	Value string `xml:",innerxml"`
}

type MasterRatePlan

type MasterRatePlan struct {
	ChargeType   RatePlanChargeType
	DerivedPlans map[string]MealPlan
}

type MealPlan

type MealPlan int
const (
	MealPlanAllInclusive    MealPlan = 1
	MealPlanBedAndBreakfast MealPlan = 3
	MealPlanFullBoard       MealPlan = 10
	MealPlanHalfBoard       MealPlan = 12
	MealPlanRoomOnly        MealPlan = 14
)

type MealsIncluded

type MealsIncluded struct {
	MealPlanIndicator bool     `xml:"MealPlanIndicator,attr"`
	MealPlanCodes     MealPlan `xml:"MealPlanCodes,attr"`
}

type Occupancy

type Occupancy struct {
	AgeQualifyingCode AgeQualifyingCode `xml:"AgeQualifyingCode,attr"`
	MinAge            *int              `xml:"MinAge,attr,omitempty"`
	MaxAge            *int              `xml:"MaxAge,attr,omitempty"`
	MinOccupancy      *int              `xml:"MinOccupancy,attr,omitempty"`
	MaxOccupancy      *int              `xml:"MaxOccupancy,attr,omitempty"`
}

type Offer

type Offer struct {
	OfferRule *OfferRule `xml:"OfferRules>OfferRule"`
	Discount  *Discount  `xml:"Discount,omitempty"`
	Guest     *Guest     `xml:"Guests>Guest"`
}

func (Offer) IsFamilyOffer

func (o Offer) IsFamilyOffer() bool

func (Offer) IsFreeNightOffer

func (o Offer) IsFreeNightOffer() bool

type OfferRule

type OfferRule struct {
	MinAdvancedBookingOffset *duration.Days `xml:"MinAdvancedBookingOffset,attr,omitempty"`
	MaxAdvancedBookingOffset *duration.Days `xml:"MaxAdvancedBookingOffset,attr,omitempty"`
	LengthsOfStay            []LengthOfStay `xml:"LengthsOfStay>LengthOfStay"`
	ArrivalDaysOfWeek        *DaysOfWeek    `xml:"DOW_Restrictions>ArrivalDaysOfWeek"`
	DepartureDaysOfWeek      *DaysOfWeek    `xml:"DOW_Restrictions>DepartureDaysOfWeek"`
	Occupancies              []Occupancy    `xml:"Occupancy,omitempty"`
}

type PrerequisiteInventory

type PrerequisiteInventory struct {
	InvType PrerequisiteInventoryInvType `xml:"InvType,attr"`
	InvCode string                       `xml:"InvCode,attr"`
}

type PrerequisiteInventoryInvType

type PrerequisiteInventoryInvType string
const (
	PrerequisiteInventoryInvTypeAlpineBitsDOW PrerequisiteInventoryInvType = "ALPINEBITSDOW"
	PrerequisiteInventoryInvTypeRoomType      PrerequisiteInventoryInvType = "ROOMTYPE"
)

type Rate

type Rate struct {
	RateTimeUnit           *TimeUnit               `xml:"RateTimeUnit,attr,omitempty"`
	UnitMultiplier         int                     `xml:"UnitMultiplier,attr,omitempty"`
	InvTypeCode            string                  `xml:"InvTypeCode,attr,omitempty"`
	Start                  *timex.Date             `xml:"Start,attr,omitempty"`
	End                    *timex.Date             `xml:"End,attr,omitempty"`
	BaseByGuestAmts        []BaseByGuestAmt        `xml:"BaseByGuestAmts>BaseByGuestAmt"`
	AdditionalGuestAmounts []AdditionalGuestAmount `xml:"AdditionalGuestAmounts>AdditionalGuestAmount"`
	MealsIncluded          *MealsIncluded          `xml:"MealsIncluded,omitempty"`
}

func (Rate) DateRange

func (r Rate) DateRange() timex.DateRange

func (Rate) IsStaticRate

func (r Rate) IsStaticRate() bool

type RatePlan

type RatePlan struct {
	RatePlanNotifType RatePlanNotifType   `xml:"RatePlanNotifType,attr"`
	RatePlanType      RatePlanType        `xml:"RatePlanType,attr,omitempty"`
	CurrencyCode      string              `xml:"CurrencyCode,attr"`
	RatePlanCode      string              `xml:"RatePlanCode,attr"`
	RatePlanID        string              `xml:"RatePlanID,attr,omitempty"`
	RatePlanQualifier *bool               `xml:"RatePlanQualifier,attr,omitempty"`
	BookingRules      []BookingRule       `xml:"BookingRules>BookingRule"`
	Rates             []Rate              `xml:"Rates>Rate"`
	Supplements       []Supplement        `xml:"Supplements>Supplement"`
	Offers            []Offer             `xml:"Offers>Offer"`
	Descriptions      RatePlanDescription `xml:"Description"`
}

func (RatePlan) IsMaster

func (r RatePlan) IsMaster() bool

type RatePlanChargeType

type RatePlanChargeType int
const (
	RatePlanChargeTypePerPerson RatePlanChargeType = 7
	RatePlanChargeTypePerRoom   RatePlanChargeType = 25
)

type RatePlanDescription

type RatePlanDescription struct {
	Titles       []common.Description
	Intros       []common.Description
	Descriptions []common.Description
	Themes       []ListItem
	Gallery      []GalleryItem
}

func (*RatePlanDescription) UnmarshalXML

func (rd *RatePlanDescription) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type RatePlanNotifType

type RatePlanNotifType string
const (
	RatePlanNotifTypeNew     RatePlanNotifType = "New"
	RatePlanNotifTypeOverlay RatePlanNotifType = "Overlay"
	RatePlanNotifTypeRemove  RatePlanNotifType = "Remove"
)

type RatePlanOccupancySettings

type RatePlanOccupancySettings struct {
	Min    *int
	Max    *int
	MinAge *int
}

type RatePlanType

type RatePlanType int
const RatePlanTypePromotional RatePlanType = 12

type RatePlans

type RatePlans struct {
	HotelCode string     `xml:"HotelCode,attr"`
	HotelName string     `xml:"HotelName,attr"`
	RatePlans []RatePlan `xml:"RatePlan"`
}

type Restriction

type Restriction string
const (
	RestrictionMaster Restriction = "Master"
)

type RestrictionStatus

type RestrictionStatus struct {
	Restriction Restriction `xml:"Restriction,attr"`
	Status      Status      `xml:"Status,attr"`
}

type RoomTypeOccupancySettings

type RoomTypeOccupancySettings struct {
	Min int
	Std int
	Max int
}

type Status

type Status string
const (
	StatusOpen  Status = "Open"
	StatusClose Status = "Close"
)

type StayType

type StayType string
const (
	StayTypeMinArrival StayType = "SetMinLOS"
	StayTypeMinThrough StayType = "SetForwardMinStay"
	StayTypeMaxArrival StayType = "SetMaxLOS"
	StayTypeMaxThrough StayType = "SetForwardMaxStay"
)

type Supplement

type Supplement struct {
	InvType                 InvType                `xml:"InvType,attr"`
	InvCode                 string                 `xml:"InvCode,attr"`
	AddToBasicRateIndicator *bool                  `xml:"AddToBasicRateIndicator,attr,omitempty"`
	MandatoryIndicator      *bool                  `xml:"MandatoryIndicator,attr,omitempty"`
	ChargeTypeCode          *SupplementChargeType  `xml:"ChargeTypeCode,attr,omitempty"`
	PrerequisiteInventory   *PrerequisiteInventory `xml:"PrerequisiteInventory,omitempty"`
	Descriptions            *RatePlanDescription   `xml:"Description,omitempty"`
	Start                   *timex.Date            `xml:"Start,attr,omitempty"`
	End                     *timex.Date            `xml:"End,attr,omitempty"`
	Amount                  *string                `xml:"Amount,attr,omitempty"`
}

func (Supplement) DateRange

func (s Supplement) DateRange() timex.DateRange

type SupplementChargeType

type SupplementChargeType int
const (
	SupplementChargeTypePerPerson SupplementChargeType = 7
	SupplementChargeTypePerRoom   SupplementChargeType = 25
)

type TimeUnit

type TimeUnit string
const (
	TimeUnitDay TimeUnit = "Day"
)

type UniqueID

type UniqueID struct {
	Type     UniqueIDType `xml:"Type,attr"`
	ID       string       `xml:"ID,attr"`
	Instance Instance     `xml:"Instance,attr"`
}

type UniqueIDType

type UniqueIDType int
const UniqueIDTypeReference UniqueIDType = 16

Jump to

Keyboard shortcuts

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