Skip to content

Latest commit

 

History

History
65 lines (42 loc) · 4.5 KB

File metadata and controls

65 lines (42 loc) · 4.5 KB

< Return to Overview

Free opportunities (free-opportunities)

The most simple form of booking, for free opportunities. Does not check for leases.

https://www.openactive.io/open-booking-api/EditorsDraft/#free-opportunities

Coverage Status: complete

See also: .NET Tutorial

Test prerequisites - Opportunities

Opportunities that match the following criteria must exist in the booking system (for each configured bookableOpportunityTypesInScope) for the configured primary Seller in order to use useRandomOpportunities: true. Alternatively the following testOpportunityCriteria values must be supported by the test interface of the booking system for useRandomOpportunities: false.

TestOpportunityBookableFree x14

Running tests for only this feature

npm start -- --runInBand test/features/payment/free-opportunities/

'Implemented' tests

Update default.json within packages/openactive-integration-tests/config/ as follows to enable 'Implemented' testing for this feature:

"implementedFeatures": {
  ...
  "free-opportunities": true,
  ...
}
Identifier Name Description Prerequisites per Opportunity Type Required Test Interface Actions
opportunity-free-idempotency Successful booking of free opportunity with idempotency Testing idempotency of the B call for free opportunities TestOpportunityBookableFree x4
opportunity-free-must-not-include-prepayment Free opportunities must have either a openBookingPrepayment value of Unspecified, or have no openBookingPrepayment specified Assert that no opportunities that match criteria 'TestOpportunityBookableFreePrepaymentOptional' or 'TestOpportunityBookableFreePrepaymentRequired' are available in the opportunity feeds.
opportunity-free Successful booking without payment property A successful end to end booking without the payment property included. TestOpportunityBookableFree x2
opportunity-free-unnecessary-payment-error Fail free bookings which include erroneous payment property C1, C2 and B with payment property: payment property is provided but not expected in the request, so an UnnecessaryPaymentDetailsError must be returned. TestOpportunityBookableFree x2
opportunity-free-without-checkpoints Successful booking without Checkpoints Free Opportunities, as they need no tax calculation by the Booking System, and, if they do not require additional details, should be bookable without using Checkpoints C1 & C2 TestOpportunityBookableFree x4
payment-mismatch Expect a TotalPaymentDueMismatchError when the totalPaymentDue property is non-zero for free opportunities Run B for a valid opportunity, with totalPaymentDue not matching the value returned by C2, expecting a TotalPaymentDueMismatchError to be returned (C1 and C2 ignored as they do not have totalPaymentDue) TestOpportunityBookableFree x2

'Not Implemented' tests

Update default.json within packages/openactive-integration-tests/config/ as follows to enable 'Not Implemented' testing for this feature:

"implementedFeatures": {
  ...
  "free-opportunities": false,
  ...
}
Identifier Name Description Prerequisites per Opportunity Type Required Test Interface Actions
no-free-opportunities The open data feeds must not contain any free opportunities Assert that no opportunities that match criteria 'TestOpportunityBookableFree' are available in the opportunity feeds.