Skip to content

Commit

Permalink
Add missing example for ActivityProductList
Browse files Browse the repository at this point in the history
  • Loading branch information
VjeraTurk committed Sep 4, 2024
1 parent c5c9141 commit 99840aa
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions examples/rpc/partner-plugin/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,6 @@ func (p *partnerPlugin) ActivityProductInfo(ctx context.Context, request *activi
return &response, nil
}

// TODO: @VjeraTurk add example for ActivityProductList
func (p *partnerPlugin) ActivityProductList(ctx context.Context, _ *activityv1.ActivityProductListRequest) (*activityv1.ActivityProductListResponse, error) {
md := metadata.Metadata{}
err := md.ExtractMetadata(ctx)
Expand All @@ -278,8 +277,26 @@ func (p *partnerPlugin) ActivityProductList(ctx context.Context, _ *activityv1.A
log.Printf("Responding to request: %s", md.RequestID)

response := activityv1.ActivityProductListResponse{
Header: nil,
Activities: []*activityv1.Activity{},
Header: nil,
Activities: []*activityv1.Activity{
{
Context: "ActivityTest", //context
LastModified: timestamppb.New(time.Now()),
ExternalSessionId: "23456", //external_session_id
ProductCode: &typesv1.ProductCode{
Code: "XPTFAOH15O", //supplier_code
},
UnitCode: "ActivityTest", //supplier_unit_code
ServiceCode: "TRF", //service_code
Bookability: &typesv1.Bookability{
Type: typesv1.BookabilityType_BOOKABILITY_TYPE_ON_REQUEST,
ConfirmationTime: &typesv1.Time{
Hours: 18,
Minutes: 00,
},
},
},
},
}
grpc.SendHeader(ctx, md.ToGrpcMD())
return &response, nil
Expand Down

0 comments on commit 99840aa

Please sign in to comment.