Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/common error conditions order already exists #183

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

civsiv
Copy link
Contributor

@civsiv civsiv commented Sep 15, 2020

closes #167

Comment on lines +5 to +10
/**
* @param {object} args
* @param {InstanceType<import('../helpers/request-state')['RequestState']>} args.state
* @param {import('../helpers/flow-helper').FlowHelperType} args.flow
* @param {import('../helpers/logger').BaseLoggerType} args.logger
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yasss

Comment on lines 72 to 73
// The following requests are not using the helper functions that are used above. This is because
// those requests are cached (using pMemoize) and therefore would not go back to the Booking System.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@civsiv I think that these should use the helper functions because they provide useful stuff like consistent test reporting messages (and structure) as well as performing validation tests (which should always be performed on responses

If you look at core/amending-order-quote/implemented/amend-c1-test.js, there is an approach there that allows it. UUID can be shared between states by including it in new RequestState

Copy link
Collaborator

@nickevansuk nickevansuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming @lukehesluke's comments are addressed

"request": "launch",
"runtimeArgs": [
"run-script",
"start-tests",
"--",
"--runInBand",
"test/features/core/common-error-conditions/implemented/incomplete-customer-details-test.js"
"test/features/core/common-error-conditions/implemented/order-already-exists-test.js"
Copy link
Collaborator

@nickevansuk nickevansuk Sep 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should fix this #184 next time we change this, so we don't need to update this in each PR

@@ -207,14 +207,33 @@ class RequestState {
return isResponse(this.c1Response);
}

/**
* As leasing is optional, getting the totalPaymentDue should not be dependent on C1 or C2 being completed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although Leasing is optional C1 and C2 are not (ref: https://openactive.io/open-booking-api/EditorsDraft/#broker-contract-with-booking-system)

So totalPaymentDue from the response must always be used. See also openactive/open-booking-api#152

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, in that case the RefImpl needs to be changed as it returns a PaymentMismatchError when it shouldn't

@civsiv civsiv closed this Mar 9, 2021
@nickevansuk
Copy link
Collaborator

This test was not merged, but is required

@nickevansuk nickevansuk reopened this Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants