aandaSdk

package module
v0.0.0-...-9075c9e Latest Latest
Warning

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

Go to latest
Published: May 13, 2019 License: MIT Imports: 13 Imported by: 0

README

Aanda SDK for Reservation Hotels zabroniryi.ru

CircleCI MIT Licensed

Install
go get github.com/tmconsulting/aanda-golang-sdk
Import
import (
    "context"
    "log"
    
    "github.com/tmconsulting/aanda-golang-sdk"
)
Example init variables
var (
	auth = aandaSdk.Auth{
		BuyerId:  "BuyerId",
		UserId:   "BuyerId",
		Password: "Password",
		Language: "ru",
	}
	aApi = aandaSdk.NewApi(auth)
	
	ctx = context.WithValue(context.Backround(), "requestId", "b5cd6a4a-efee-4146-8bec-bf5457558750")
)
Example init hooks/handlers
	aApi.RegisterEventHandler(aandaSdk.BeforeRequestSend, func(ctx context.Context, methodName, query, mimeType string, data []byte) {
	    requestId := ctx.Value("requestId").(string)
	
            log.Println("request: ", requestId, methodName, query, mimeType, string(data))
	}).RegisterEventHandler(aandaSdk.AfterResponseReceive, func(ctx context.Context, methodName, query, mimeType string, data []byte) {
	    requestId := ctx.Value("requestId").(string)

            log.Println("response: ", requestId, methodName, query, mimeType, string(data))
	})
Example HotelSearchRequest
searchReq := aandaSdk.HotelSearchRequest{
	City:           "2",
	Lat:            "",
	Lng:            "",
	Radius:         "30",
	ArrivalDate:    "09.11.2017",
	DepartureDate:  "10.11.2017",
	PriceFrom:      "2000",
	PriceTo:        "3000",
	NumberOfGuests: "1",
}
data, err := aApi.HotelSearchRequest(ctx, searchReq)
if err == nil {
	//Work with data
}
Example HotelPricingRequest
priceReq := aandaSdk.HotelPricingRequest{
	Hotel:          "2150",
	ProductCode:    "",
	Currency:       "1",
	WhereToPay:     "1",
	ArrivalDate:    "05.12.2017",
	DepartureDate:  "06.12.2017",
	ArrivalTime:    "2000",
	DepartureTime:  "3000",
	NumberOfGuests: "1",
}
data, err := aApi.HotelPricingRequest(ctx, priceReq)
if err == nil {
	//Work with data
}
Example OrderRequest
orderReq := aandaSdk.OrderRequest{
	ArrivalDate:   "02.01.2018",
	DepartureDate: "03.01.2018",
	AddInfo:       "ТЕСТОВЫЙ ЗАКАЗ",
	HotelCode:     "2150",
	RoomCode:      "32078",
	Meal:           "",
	ArrivalTime:    "14:00",
	DepartureTime:  "12:00",
	NumberOfGuests: "1",
	Person: []aandaSdk.Person{aandaSdk.Person{
		FirstName: "Name",
		LastName:  "Name",
	}},
}
data, err := aApi.OrderRequest(ctx, orderReq)
if err == nil {
	//Work with data
}
Example OrderInfoRequest
data, err := aApi.OrderInfoRequest(ctx, "2213397") // 2213397 is OrderId
if err == nil {
	//Work with data
}
Example OrderListRequest
orderReq := aandaSdk.OrderListRequest{
	//ArrivalDateFrom: "24.02.2018",
	//ArrivalDateTo:   "25.02.2018",
	//DepartureDateFrom: "25.02.2018",
	//DepartureDateTo:   "26.02.2018",
	//RegistrationDateFrom: "23.02.2018",
	//RegistrationDateTo: "22.02.2018",
	}
data, err := aApi.OrderListRequest(ctx, orderReq)
if err == nil {
	//Work with data
}
Example SendOrderMessageRequest
somReq := aandaSdk.SendOrderMessageRequest{
	OrderId: "2213397",
	Message: "test message 2 3 4 22 22",
}
data, err := aApi.SendOrderMessageRequest(ctx, somReq)
if err == nil {
	//Work with data
}
Example OrderMessagesRequest
data, err := aApi.OrderMessagesRequest(ctx, "2213397") // 2213397 is OrderId
if err == nil {
	//Work with data
}
Example CountryListRequest
data, err := aApi.CountryListRequest(ctx)
if err == nil {
	//Work with data
}
Example CityListRequest
data, err := aApi.CityListRequest(ctx, 9)//9 is CountryCode
if err == nil {
	//Work with data
}
Example HotelListRequest
data, err := aApi.HotelListRequest(ctx, 1)//1 is CityCode == Moscow
if err == nil {
	//Work with data
}
Example HotelDescriptionRequest
data, err := aApi.HotelDescriptionRequest(ctx, 2150)//2150 is HotelCode
if err == nil {
	//Work with data
}
Example CurrencyListRequest
data, err := aApi.CurrencyListRequest(ctx)
if err == nil {
	//Work with data
}
Example MealTypeRequest
data, err := aApi.MealTypeRequest(ctx)
if err == nil {
	//Work with data
}
Example MealCategoryeRequest
data, err := aApi.MealCategoryRequest(ctx)
if err == nil {
	//Work with data
}
Example ClientStatusRequest
data, err := aApi.ClientStatusRequest(ctx)
if err == nil {
	//Work with data
}

Documentation

Index

Constants

View Source
const (
	TestOrderId = "2213397"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AandaError

type AandaError struct {
	Status string     `json:"status" json:"Status"`
	Code   MustString `json:"code" json:"Code"`
	Type   string     `json:"type" json:"Type"`
	Note   string     `json:"note" json:"Note"`
}

func (*AandaError) Error

func (o *AandaError) Error() string

func (*AandaError) IsEmpty

func (o *AandaError) IsEmpty() bool

func (*AandaError) ToError

func (o *AandaError) ToError() error

type AandaErrorMsg

type AandaErrorMsg struct {
	Err string `json:"error"`
}

func (*AandaErrorMsg) Error

func (o *AandaErrorMsg) Error() string

func (*AandaErrorMsg) IsEmpty

func (o *AandaErrorMsg) IsEmpty() bool

func (*AandaErrorMsg) ToError

func (o *AandaErrorMsg) ToError() error

type Api

type Api struct {
	EventListener

	BuyerId  string
	UserId   string
	Password string
	Language string
	// contains filtered or unexported fields
}

func NewApi

func NewApi(auth Auth) *Api

func (*Api) CityListRequest

func (self *Api) CityListRequest(ctx context.Context, countryCode int) (CityListResponse, error)

func (*Api) ClientStatusRequest

func (self *Api) ClientStatusRequest(ctx context.Context) ([]ClientStatusResponse, error)

func (*Api) CountryListRequest

func (self *Api) CountryListRequest(ctx context.Context) ([]CountryListResponse, error)

func (*Api) CurrencyListRequest

func (self *Api) CurrencyListRequest(ctx context.Context) ([]CurrencyListResponse, error)

func (*Api) HotelAmenitiesRequest

func (self *Api) HotelAmenitiesRequest(ctx context.Context) ([]HotelAmenitiesResponse, error)

func (*Api) HotelDescriptionRequest

func (self *Api) HotelDescriptionRequest(ctx context.Context, hotelCode int) (HotelDescriptionResponse, error)

func (*Api) HotelListRequest

func (self *Api) HotelListRequest(ctx context.Context, cityCode int) ([]HotelListResponse, error)

func (*Api) HotelPricingRequest

func (self *Api) HotelPricingRequest(ctx context.Context, priceReq HotelPricingRequest) (HotelPricingResponse, error)

func (*Api) HotelSearchRequest

func (self *Api) HotelSearchRequest(ctx context.Context, searchReq HotelSearchRequest) ([]HotelSearchResponse, error)

func (*Api) MealCategoryRequest

func (self *Api) MealCategoryRequest(ctx context.Context) ([]MealCategoryResponse, error)

func (*Api) MealTypeRequest

func (self *Api) MealTypeRequest(ctx context.Context) ([]MealTypeResponse, error)

func (*Api) OrderInfoRequest

func (self *Api) OrderInfoRequest(ctx context.Context, orderId string) (OrderInfoResponse, error)

func (*Api) OrderListRequest

func (self *Api) OrderListRequest(ctx context.Context, orderReq OrderListRequest) ([]OrderListResponse, error)

func (*Api) OrderMessagesRequest

func (self *Api) OrderMessagesRequest(ctx context.Context, orderId string) ([]OrderMessagesResponse, error)

func (*Api) OrderRequest

func (self *Api) OrderRequest(ctx context.Context, orderReq OrderRequest) (OrderRequestResponse, error)

func (*Api) RoomAmenitiesRequest

func (self *Api) RoomAmenitiesRequest(ctx context.Context) ([]RoomAmenitiesResponse, error)

func (*Api) SendOrderMessageRequest

func (self *Api) SendOrderMessageRequest(ctx context.Context, somReq SendOrderMessageRequest) (SendOrderMessageResponse, error)

func (*Api) ServiceTypeRequest

func (self *Api) ServiceTypeRequest(ctx context.Context) ([]ServiceTypeResponse, error)

type Auth

type Auth struct {
	BuyerId  string
	UserId   string
	Password string
	Language string
}

type CityListResponse

type CityListResponse struct {
	Country struct {
		Id   string `json:"id"`
		Name string `json:"name"`
	} `json:"country"`
	Cities []struct {
		CityCode      string `json:"city_code"`
		CityName      string `json:"city_name"`
		Region        string `json:"region"`
		Hotels        string `json:"hotels"`
		CityLatitude  string `json:"city_latitude"`
		CityLongitude string `json:"city_longitude"`
	} `json:"cities"`
}

type ClientStatusResponse

type ClientStatusResponse struct {
	ClientStatusCode        string `json:"client_status_code"`
	ClientStatusName        string `json:"client_status_name"`
	ClientStatusExplanation string `json:"client_status_explanation"`
}

type CountryListResponse

type CountryListResponse struct {
	CountryCode string `json:"country_code"`
	CountryName string `json:"country_name"`
	Cities      string `json:"cities"`
}

type CurrencyListResponse

type CurrencyListResponse struct {
	CurrencyCode string `json:"currency_code"`
	CurrencyName string `json:"currency_name"`
}

type EventHandler

type EventHandler func(ctx context.Context, methodName, query, mimeType string, data []byte)

type EventListener

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

func (*EventListener) Init

func (o *EventListener) Init()

func (*EventListener) RegisterEventHandler

func (o *EventListener) RegisterEventHandler(et EventType, handler EventHandler) *EventListener

type EventType

type EventType int
const (
	BeforeRequestSend    EventType = 1
	AfterResponseReceive EventType = 2
)

type HotelAmenitiesResponse

type HotelAmenitiesResponse struct {
	HotelAmenitiesCode string `json:"hotel_amenities_code"`
	HotelAmenitiesName string `json:"hotel_amenities_name"`
}

type HotelDescriptionResponse

type HotelDescriptionResponse struct {
	Status          *string    `json:"status,omitempty"`
	HotelCode       MustString `json:"hotel_code"`
	HotelName       string     `json:"hotel_name"`
	Vat             MustString `json:"vat"`
	Address         string     `json:"address"`
	Phone           string     `json:"phone"`
	Description     string     `json:"description"`
	FullDescription string     `json:"full_description"`
	FullAddress     struct {
		Zip            MustString `json:"zip"`
		Region         string     `json:"region"`
		City           string     `json:"city"`
		Addinfo        string     `json:"addinfo"`
		Strtype        string     `json:"strtype"`
		Strname        string     `json:"strname"`
		Proptype       string     `json:"proptype"`
		Propnumber     MustString `json:"propnumber"`
		Buildingattr   string     `json:"buildingattr"`
		Buildingnumber string     `json:"buildingnumber"`
		Addinfo2       string     `json:"addinfo2"`
		CityCode       MustString `json:"city_code"`
		CityName       string     `json:"city_name"`
		CityLatitude   MustString `json:"city_latitude"`
		CityLongitude  MustString `json:"city_longitude"`
		HotelLatitude  MustString `json:"hotel_latitude"`
		HotelLongitude MustString `json:"hotel_longitude"`
		CountryCode    MustString `json:"country_code"`
		CountryName    string     `json:"country_name"`
	} `json:"full_address"`
	RatingCode MustString `json:"rating_code"`
	RatingName string     `json:"rating_name"`
	StarsCode  MustString `json:"stars_code"`
	StarsName  MustString `json:"stars_name"`
	Images     []struct {
		URL  string `json:"Url"`
		Desc string `json:"desc"`
	} `json:"images"`
	CurrencyCode   MustString `json:"currency_code"`
	CurrencyName   string     `json:"currency_name"`
	HotelAmenities []struct {
		Name string     `json:"name"`
		Id   MustString `json:"id"`
	} `json:"hotel_amenities"`
	Rooms      []HotelDescriptionRoom `json:"rooms"`
	Conference []interface{}          `json:"conference"`
	Group      struct {
		Qty      MustString `json:"qty"`
		Type     MustString `json:"type"`
		Typename string     `json:"typename"`
		Note     string     `json:"note"`
		Rule     string     `json:"rule"`
	} `json:"group"`
}

type HotelDescriptionRoom

type HotelDescriptionRoom struct {
	RoomCode        MustString `json:"room_code"`
	RoomName        string     `json:"room_name"`
	NumberOfGuests  MustString `json:"number_of_guests"`
	RoomDescription string     `json:"room_description"`
	Images          string     `json:"images"`
	RoomAmenities   []struct {
		Name string     `json:"name"`
		Id   MustString `json:"id"`
	} `json:"room_amenities"`
}

type HotelListResponse

type HotelListResponse struct {
	HotelCode      string      `json:"hotel_code"`
	Vat            string      `json:"vat"`
	HotelName      string      `json:"hotel_name"`
	Address        string      `json:"address"`
	Description    string      `json:"description"`
	ImageUrl       string      `json:"image_url"`
	HotelLatitude  string      `json:"hotel_latitude"`
	HotelLongitude string      `json:"hotel_longitude"`
	RatingCode     interface{} `json:"rating_code"`
	RatingName     string      `json:"rating_name"`
	StarsCode      string      `json:"stars_code"`
	StarsName      string      `json:"stars_name"`
	HotelAmenities []struct {
		Name string `json:"name"`
		Id   string `json:"id"`
	} `json:"hotel_amenities"`
}

type HotelPricingRequest

type HotelPricingRequest struct {
	Auth
	Hotel          string `json:"Hotel"`
	ProductCode    string `json:"ProductCode"`
	Currency       string `json:"Currency"`
	WhereToPay     string `json:"WhereToPay"`
	ArrivalDate    string `json:"ArrivalDate"`
	DepartureDate  string `json:"DepartureDate"`
	ArrivalTime    string `json:"ArrivalTime"`
	DepartureTime  string `json:"DepartureTime"`
	NumberOfGuests string `json:"NumberOfGuests"`
}

type HotelPricingResponse

type HotelPricingResponse struct {
	HotelCode          string `json:"hotel_code"`
	HotelName          string `json:"hotel_name"`
	NumberOfGuests     int    `json:"number_of_guests"`
	CheckInTime        string `json:"check-in_time"`
	CheckOutTime       string `json:"check-out_time"`
	ArrivalDate        string `json:"arrival_date"`
	DepartureDate      string `json:"departure_date"`
	Vat                int    `json:"vat"`
	TimeZone           string `json:"time_zone"`
	CountryCode        string `json:"country_code"`
	CountryName        string `json:"country_name"`
	CityCode           string `json:"city_code"`
	CityName           string `json:"city_name"`
	CityLatitude       string `json:"city_latitude"`
	CityLongitude      string `json:"city_longitude"`
	HotelLatitude      string `json:"hotel_latitude"`
	HotelLongitude     string `json:"hotel_longitude"`
	AllowEarlyCheckIn  string `json:"allow_early_check-in"`
	AllowEarlyCheckOut string `json:"allow_early_check-out"`
	CurrencyCode       string `json:"currency_code"`
	CurrencyName       string `json:"currency_name"`
	Rooms              []struct {
		RoomCode            int           `json:"room_code"`
		RoomName            string        `json:"room_name"`
		RateName            string        `json:"rate_name"`
		AllowEarlierCheckin bool          `json:"allow_earlier_checkin"`
		AllowLateCheckout   bool          `json:"allow_late_checkout"`
		Checkins            []interface{} `json:"checkins"`
		Checkouts           []interface{} `json:"checkouts"`
		Price               int           `json:"price"`
		Rackrate            int           `json:"rackrate"`
		Comission           struct {
			Room          int `json:"room"`
			Meal          int `json:"meal"`
			Total         int `json:"total"`
			Checkin       int `json:"checkin"`
			Checkout      int `json:"checkout"`
			TotalMealfree int `json:"total_mealfree"`
		} `json:"comission"`
		PenaltySize struct {
			Room  int `json:"room"`
			Total int `json:"total"`
		} `json:"penalty_size"`
		DeadlineDate       string `json:"deadline_date"`
		DeadlineTime       string `json:"deadline_time"`
		PenaltyInfo        string `json:"penalty_info"`
		MaxGuests          string `json:"max_guests"`
		MealTypeCode       string `json:"meal_type_code"`
		MealTypeName       string `json:"meal_type_name"`
		MealCategoryCode   string `json:"meal_category_code"`
		MealCategoryName   string `json:"meal_category_name"`
		MealName           string `json:"meal_name"`
		MealPrice          int    `json:"meal_price"`
		MealIsIncludedCode int    `json:"meal_is_included_code"`
		PaymentTermsCode   string `json:"payment_terms_code"`
		PaymentTermsName   string `json:"payment_terms_name"`
		AvailabilityCode   int    `json:"availability_code"`
		AvailabilityName   string `json:"availability_name"`
		RoomsAvailable     int    `json:"rooms_available"`
		RoomAmenities      []struct {
			Name string `json:"name"`
			ID   string `json:"id"`
		} `json:"room_amenities"`
	} `json:"rooms"`
	Group struct {
		Qty      string `json:"qty"`
		Type     string `json:"type"`
		Typename string `json:"typename"`
		Note     string `json:"note"`
		Rule     string `json:"rule"`
	} `json:"group"`
	HotelAmenities []struct {
		Name string `json:"name"`
		Id   string `json:"id"`
	} `json:"hotel_amenities"`
}

type HotelRooms

type HotelRooms struct {
	RoomCode           MustString  `json:"room_code"`
	RoomName           string      `json:"room_name"`
	NumberOfGuests     MustString  `json:"number_of_guests"`
	Price              MustFloat64 `json:"price"`
	Rackrate           MustFloat64 `json:"rackrate"`
	Comission          MustFloat64 `json:"comission"`
	PenaltySize        MustFloat64 `json:"penalty_size"`
	DeadlineDate       string      `json:"deadline_date"`
	DeadlineTime       string      `json:"deadline_time"`
	PenaltyInfo        string      `json:"penalty_info"`
	MealTypeCode       MustString  `json:"meal_type_code"`
	MealTypeName       string      `json:"meal_type_name"`
	MealCategoryCode   MustString  `json:"meal_category_code"`
	MealCategoryName   string      `json:"meal_category_name"`
	MealName           string      `json:"meal_name"`
	MealPrice          MustInt     `json:"meal_price"`
	MealIsIncludedCode MustInt     `json:"meal_is_included_code"`
	MealIsIncludedName string      `json:"meal_is_included_name"`
	AvailabilityCode   MustInt     `json:"availability_code"`
	AvailabilityName   string      `json:"availability_name"`
	PaymentTermsCode   MustString  `json:"payment_terms_code"`
	PaymentTermsName   string      `json:"payment_terms_name"`
	Amenities          []struct {
		Name string     `json:"name"`
		Id   MustString `json:"id"`
	} `json:"room_amenities"`
	Periods []RoomPeriod `json:"periods"`
}

type HotelSearchRequest

type HotelSearchRequest struct {
	Auth
	City           string `json:"City"`
	Lat            string `json:"Lat"`
	Lng            string `json:"Lng"`
	Radius         string `json:"Radius"`
	ArrivalDate    string `json:"ArrivalDate"`
	DepartureDate  string `json:"DepartureDate"`
	PriceFrom      string `json:"PriceFrom"`
	PriceTo        string `json:"PriceTo"`
	NumberOfGuests string `json:"NumberOfGuests"`
}

type HotelSearchResponse

type HotelSearchResponse struct {
	HotelCode   MustString `json:"hotel_code"`
	HotelName   string     `json:"hotel_name"`
	Address     string     `json:"address"`
	ImageUrl    string     `json:"image_url"`
	Vat         MustInt    `json:"vat"`
	Description string     `json:"description"`
	Amenities   []struct {
		Name string     `json:"name"`
		Id   MustString `json:"id"`
	} `json:"hotel_amenities"`
	CheckInTime    string       `json:"check-in_time"`
	CheckOutTime   string       `json:"check-out_time"`
	Timezone       string       `json:"timezone"`
	CityCode       MustString   `json:"city_code"`
	CityName       string       `json:"city_name"`
	HotelLatitude  string       `json:"hotel_latitude"`
	HotelLongitude string       `json:"hotel_longitude"`
	CountryCode    MustString   `json:"country_code"`
	CountryName    string       `json:"country_name"`
	RatingCode     MustString   `json:"rating_code"`
	RatingName     string       `json:"rating_name"`
	StarsCode      interface{}  `json:"stars_code"` //Иногда тут пустая строка
	StarsName      string       `json:"stars_name"`
	CurrencyCode   MustString   `json:"currency_code"`
	CurrencyName   string       `json:"currency_name"`
	Rooms          []HotelRooms `json:"rooms"`
}

type MealCategoryResponse

type MealCategoryResponse struct {
	MealCategoryCode string `json:"meal_category_code"`
	MealCategoryName string `json:"meal_category_name"`
}

type MealTypeResponse

type MealTypeResponse struct {
	MealTypeCode string `json:"meal_type_code"`
	MealTypeName string `json:"meal_type_name"`
}

type MustFloat64

type MustFloat64 float64

func (*MustFloat64) UnmarshalJSON

func (o *MustFloat64) UnmarshalJSON(data []byte) error

type MustInt

type MustInt int

func (*MustInt) UnmarshalJSON

func (o *MustInt) UnmarshalJSON(data []byte) error

type MustString

type MustString string

func (*MustString) UnmarshalJSON

func (o *MustString) UnmarshalJSON(data []byte) error

type OrderInfoRequest

type OrderInfoRequest struct {
	Auth
	Id string `json:"order_id"`
}

type OrderInfoResponse

type OrderInfoResponse struct {
	OrderId           string `json:"order_id"`
	ReferenceNumber   string `json:"reference_number"`
	Created           string `json:"created"`
	DeadlineDate      string `json:"deadline_date"`
	DeadlineTime      string `json:"deadline_time"`
	TotalPrice        int    `json:"total_price"`
	Comission         string `json:"comission"`
	ArrivalDate       string `json:"arrival_date"`
	DepartureDate     string `json:"departure_date"`
	CurrencyCode      string `json:"currency_code"`
	CurrencyName      string `json:"currency_name"`
	PaymentTermsCode  string `json:"payment_terms_code"`
	PaymentTermsName  string `json:"payment_terms_name"`
	StatusCode        string `json:"status_code"`
	StatusName        string `json:"status_name"`
	ContactpersonName string `json:"contactperson_name"`
	PersonPhone       string `json:"person_phone"`
	PersonFax         string `json:"person_fax"`
	PersonEmail       string `json:"person_email"`
	Rooms             []struct {
		RoomCode           string      `json:"room_code"`
		ArrivalDate        string      `json:"arrival_date"`
		ArrivalTime        string      `json:"arrival_time"`
		DepartureDate      string      `json:"departure_date"`
		DepartureTime      string      `json:"departure_time"`
		NumberOfNights     MustString  `json:"number_of_nights"`
		NumberOfRooms      string      `json:"number_of_rooms"`
		NumberOfGuests     string      `json:"number_of_guests"`
		AdditionalInfo     string      `json:"additional_info"`
		SupplierInfo       string      `json:"supplier_info"`
		ConfirmationNumber string      `json:"confirmation_number"`
		Price              MustFloat64 `json:"price"`
		RoomPrice          string      `json:"room_price"`
		Commission         MustFloat64 `json:"comission"`
		Penalty            string      `json:"penalty"`
		PenaltyNote        string      `json:"penalty_note"`
		DeadlineDate       string      `json:"deadline_date"`
		PossiblePenalty    string      `json:"possible_penalty"`
		CancelledCode      string      `json:"cancelled_code"`
		CancelledName      string      `json:"cancelled_name"`
		ChangeCode         string      `json:"change_code"`
		ChangeName         string      `json:"change_name"`
		HotelCode          string      `json:"hotel_code"`
		Vat                string      `json:"vat"`
		TimeZone           string      `json:"time_zone"`
		CountryCode        string      `json:"country_code"`
		CountryName        string      `json:"country_name"`
		CityCode           string      `json:"city_code"`
		CityName           string      `json:"city_name"`
		StatusCode         string      `json:"status_code"`
		StatusName         string      `json:"status_name"`
		AllowCancelCode    int         `json:"allow_cancel_code"`
		AllowCancelName    string      `json:"allow_cancel_name"`
		AllowChangeCode    int         `json:"allow_change_code"`
		AllowChangeName    string      `json:"allow_change_name"`
		RoomName           string      `json:"room_name"`
		MealCode           int         `json:"meal_code"`
		MealName           string      `json:"meal_name"`
		Persons            []struct {
			Lastname  string `json:"lastname"`
			Firstname string `json:"firstname"`
		} `json:"persons"`
	} `json:"rooms"`
	ServiceList []struct {
		Id          string      `json:"id"`
		Name        string      `json:"name"`
		Price       string      `json:"price"`
		ServiceType string      `json:"service_type"`
		ServiceName string      `json:"service_name"`
		StartDate   string      `json:"start_date"`
		EndDate     string      `json:"end_date"`
		InvoiceId   interface{} `json:"invoice_id"`
		PersonId    string      `json:"person_id"`
	} `json:"service_list"`
	GroupInfo []interface{} `json:"group_info"`
}

type OrderListRequest

type OrderListRequest struct {
	Auth
	LastName             string `json:"LastName"` //Доп параметры
	ArrivalDateFrom      string `json:"ArrivalDateFrom"`
	ArrivalDateTo        string `json:"ArrivalDateTo"`
	DepartureDateFrom    string `json:"DepartureDateFrom"`
	DepartureDateTo      string `json:"DepartureDateTo"`
	RegistrationDateFrom string `json:"RegistrationDateFrom"`
	RegistrationDateTo   string `json:"RegistrationDateTo"`
	ChangeDateFrom       string `json:"ChangeDateFrom"`
	ChangeDateTo         string `json:"ChangeDateTo"`
}

type OrderListResponse

type OrderListResponse struct {
	OrderId           string `json:"order_id"`
	ReferenceNumber   string `json:"reference_number"`
	Created           string `json:"created"`
	DeadlineDate      string `json:"deadline_date"`
	TotalPrice        string `json:"total_price"`
	Comission         int    `json:"comission"`
	Penalty           string `json:"penalty"`
	ArrivalDate       string `json:"arrival_date"`
	DepartureDate     string `json:"departure_date"`
	CurrencyCode      string `json:"currency_code"`
	CurrencyName      string `json:"currency_name"`
	StatusCode        string `json:"status_code"`
	StatusName        string `json:"status_name"`
	ContactpersonName string `json:"contactperson_name"`
	PersonPhone       string `json:"person_phone"`
	PersonFax         string `json:"person_fax"`
	PersonEmail       string `json:"person_email"`
}

type OrderMessagesResponse

type OrderMessagesResponse struct {
	OrderCode   string `json:"order_code"`
	MessageCode string `json:"message_code"`
	Created     string `json:"created"`
	From        string `json:"from"`
	Message     string `json:"message"`
}

type OrderRequest

type OrderRequest struct {
	Auth
	OrderId        string   `json:"order_id"`
	ArrivalDate    string   `json:"arrival_date"`
	DepartureDate  string   `json:"departure_date"`
	AddInfo        string   `json:"add_info"`
	ChangeCode     string   `json:"change_code"`
	CancelCode     string   `json:"cancel_code"`
	HotelCode      string   `json:"hotel_code"`
	RoomCode       string   `json:"room_code"`
	Meal           string   `json:"Meal"`
	ArrivalTime    string   `json:"arrival_time"`
	DepartureTime  string   `json:"departure_time"`
	NumberOfGuests string   `json:"NumberOfGuests"`
	Person         []Person `json:"Person"`
}

type OrderRequestResponse

type OrderRequestResponse struct {
	Status  string      `json:"Status" validate:"required"`
	OrderId string      `json:"order_id" validate:"required"`
	Time    MustFloat64 `json:"Time" validate:"required"`
}

type Person

type Person struct {
	FirstName string `json:"FirstName"`
	LastName  string `json:"LastName"`
}

type RoomAmenitiesResponse

type RoomAmenitiesResponse struct {
	RoomAmenitiesCode string `json:"room_amenities_code"`
	RoomAmenitiesName string `json:"room_amenities_name"`
}

type RoomComission

type RoomComission struct {
	Room          MustFloat64 `json:"room"`
	Meal          MustFloat64 `json:"meal"`
	Total         MustFloat64 `json:"total"`
	TotalMealfree MustFloat64 `json:"total_mealfree"`
}

type RoomPeriod

type RoomPeriod struct {
	PeriodStart     string      `json:"period_start"`
	PeriodEnd       string      `json:"period_end"`
	PeriodDays      MustInt     `json:"period_days"`
	PeriodSummRoom  MustInt     `json:"period_summ_room"`
	PeriodSummMeal  interface{} `json:"period_summ_meal"`
	PeriodSummTotal MustInt     `json:"period_summ_total"`
}

type SendOrderMessageRequest

type SendOrderMessageRequest struct {
	OrderId string
	Message string
}

type SendOrderMessageResponse

type SendOrderMessageResponse struct {
	MessageCode string `json:"message_code"`
}

type ServiceTypeResponse

type ServiceTypeResponse struct {
	ServiceCode string `json:"service_code"`
	ServiceName string `json:"service_name"`
}

Jump to

Keyboard shortcuts

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