openactive / OpenActive.Server.NET

.NET server library, including an OpenActive Reference Implementation
MIT License
0 stars 7 forks source link

An Opportunity is leased even though the C1 request fails #169

Open lukehesluke opened 3 years ago

lukehesluke commented 3 years ago

Assumption: C1 is atomic. With the anonymous-leasing feature enabled, if a C1 request with multiple OrderItems is attempted and it fails due to one of the items, NONE of the items get leased and therefore NONE of the items has its capacity reduced in the Opportunity feeds

This is not the observed behaviour. In the attached run:

availability-check_opportunity-full_OpenBookingSimpleFlow_Multiple.md

  1. Test Suite made a C1 request where OrderItems 0, 1, 3 & 4 failed due to having 0 capacity. This is correct of course :white_check_mark: . OrderItems 2 & 5 are bookable due to having 10 spaces, but still the overall Order failed
  2. Then, when AssertCapacity.. stage expects NONE of the capacities to have changed, it finds that in fact the capacities of OrderItems 2 & 5 have been reduced from 10 -> 9 implying that they were leased even though the OrderQuote failed to create :x:

Acceptance Criteria

When working on this, be sure to use a coverage/* branch (more info about coverage branches) and start a branch in Test Suite with the same name.

In this branch on Test Suite, search for all instances of https://github.com/openactive/OpenActive.Server.NET/issues/169 in the code. Here's an example of one:

https://github.com/openactive/openactive-test-suite/blob/e92f7ab1f89ac4a7b9a818e6bd0763eb58876d43/packages/openactive-integration-tests/test/helpers/flow-stages/flow-stage-recipes.js#L170-L171

Update it so that the comment and the doSkip line (which includes RUN_TESTS_WHICH_FAIL_REFIMPL) are removed for each instance. The effect of this will be turning on the post-OrderQuote-amendment capacity checks in Test Suite.

The acceptance criteria is that this branch of Test Suite passes against the OpenActive.Server.Net branch


This was revealed while working on this Test Suite issue: openactive/openactive-test-suite#460