Skip to content

Commit

Permalink
extend example
Browse files Browse the repository at this point in the history
  • Loading branch information
VjeraTurk committed Jan 13, 2025
1 parent 31539d5 commit f4dc1da
Showing 1 changed file with 65 additions and 20 deletions.
85 changes: 65 additions & 20 deletions examples/rpc/partner-plugin/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f4dc1da

Please sign in to comment.