diff --git a/examples/rpc/partner-plugin/server.go b/examples/rpc/partner-plugin/server.go index 1a04708c..2667695b 100644 --- a/examples/rpc/partner-plugin/server.go +++ b/examples/rpc/partner-plugin/server.go @@ -536,28 +536,73 @@ func (p *partnerPlugin) TransportSearch(ctx context.Context, _ *transportv3.Tran }, }, }, - Segments: []*transportv3.SegmentExtended{{ - Info: &transportv3.Segment{}, - ServiceTypeCode: "", - ServiceTypeDescription: "", - Services: []*typesv2.ServiceFact{{ - Code: "XY", - Description: "", - PriceDetail: &typesv2.PriceDetail{ - Price: &typesv2.Price{}, - Binding: false, - Description: "", - LocallyPayable: true, + Segments: []*transportv3.SegmentExtended{ + { + Info: &transportv3.Segment{ + SegmentId: "SEG123", + ProviderCode: "I2", + RetailerCode: "IB", + ProductCode: &typesv2.ProductCode{ + Code: "XY", + Number: 123, + Type: typesv2.ProductCodeType_PRODUCT_CODE_TYPE_UNSPECIFIED, + }, }, - AvailabilityType: typesv2.ServiceAvailabilityType_SERVICE_AVAILABILITY_TYPE_COMPULSORY, - }}, - MinPax: 1, - MaxPax: 3, - }}, + ServiceTypeCode: "Y", + ServiceTypeDescription: "Economy Class", + Services: []*typesv2.ServiceFact{ + { + Code: "EC", + Description: "Early Check-in", + PriceDetail: &typesv2.PriceDetail{ + Price: &typesv2.Price{ + Value: "10", + Decimals: 2, + Currency: &typesv2.Currency{ + Currency: &typesv2.Currency_IsoCurrency{ + IsoCurrency: typesv2.IsoCurrency_ISO_CURRENCY_EUR, + }, + }, + }, + Binding: false, + Description: "Early Check-in", + LocallyPayable: true, + }, + AvailabilityType: typesv2.ServiceAvailabilityType_SERVICE_AVAILABILITY_TYPE_COMPULSORY, + }, + }, + MinPax: 1, + MaxPax: 3, + }, + }, }}, - TotalPrice: &typesv2.PriceDetail{}, - RateRules: []*typesv1.RateRule{{}}, - Links: []*typesv1.Link{{}}, + TotalPrice: &typesv2.PriceDetail{ + Price: &typesv2.Price{ + Value: "100", + Decimals: 2, + Currency: &typesv2.Currency{ + Currency: &typesv2.Currency_IsoCurrency{ + IsoCurrency: typesv2.IsoCurrency_ISO_CURRENCY_EUR, + }, + }, + }, + }, + RateRules: []*typesv1.RateRule{{ + RateType: typesv1.RateRuleType_RATE_RULE_TYPE_SEMI_NON_REFUNDABLE, + RateDescription: "Semi non-refundable rate. Cancellation is possible until 24 hours before the start of the trip. After that, the full price will be charged.", + }}, + Links: []*typesv1.Link{ + { + Type: typesv1.LinkType_LINK_TYPE_BOOKING, + Description: "", + Ref: "https://www.example.com/booking", + }, + { + Type: typesv1.LinkType_LINK_TYPE_SUPPORT, + Description: "", + Ref: "https://www.example.com/support", + }, + }, }}, } log.Printf("CMAccount %s received request from CMAccount %s", md.Recipient, md.Sender)