Open nickevansuk opened 3 years ago
Potentially another solution could be to not allow non-zero prepayment "Unavailable" items to be included in an Order
where a prepayment
is required.
So therefore if Payment
is taken, the totalPaymentDue
must equal the total of all the OrderItems. If Payment
is not taken, then totalPaymentDue
is the amount that must be paid at the venue.
This handles the most likely case of the Seller's prepayment policy being uniform across their opportunities, without adding additional complexity to the specification at this stage.
That seems a good solution for now @nickevansuk . It's essentially a limitation being acknowledged and handled with acceptable trade-offs. It can be re-assessed at a later time if deemed necessary.
It will be important to document this in the spec so that Brokers know that they need to handle situations in which a customer wants to book items with different prepayment
values - they could internally manage two OrderQuotes - one for prepaid and one for non-prepaid. Or they could just disallow customers from selecting multiple items with different prepayment requirements
Ok great, in which case trying to book two items, oneTestOpportunityBookableNonFreePrepaymentRequired
and one TestOpportunityBookableNonFreePrepaymentUnavailable
should result in OpportunityIsInConflictError
on each of the conflicting items.
We should add a test for this to a new prepayment-required-unavailable
test suite feature and update the spec
(from @lukehesluke )
Is it possible for an Order to have multiple (non-free) OrderItems where some OrderItems have prepayment=Required and some have prepayment=Unavailable ?
It seems that it shouldn't be possible. e.g. if OrderItems have prices:
Then what is the totalPaymentDue of the order? It can't be:
Because this would prompt the broker to take £13 payment for the whole order, which is £6 too many.
And it can't be:
Because this would prompt the broker to inform the customer that all payment has been made. The customer would then find that they are expected to pay a further £6 when they arrive
An optional
surplusPriceToPayAtTheVenue
field (inPriceSpecification
) seems like it would suffice. The broker could then use this to inform the customer that more payment will be required at the venue.