anchor.diff:  
   pass:[<br/><br/>]
   
  +The `ShoppingBasket` is a view model on top of the `Order`, the idea being that it guides the end-user through the steps of completing an `Order`.  For example, it allows the user to select available ``MenuItem``s from the ``Event``'s `Menu` and to create corresponding ``OrderItem``s for each:
  +
  +image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/570-add-order-items.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/570-add-order-items.png"]
  +
  +Only `MenuItem`s which have not previously been selected (ie for which there are not ``OrderItem``s in the basket) are shown.
  +
  +
  +pass:[<br/><br/>]
  +
  +The UI, it has to be said, is somewhat odd here.  As of this writing Apache Isis does not support the concept of collections as parameters to actions, meaning that it isn't possible to select multiple items and add them to the basket in a single go.  The best can currently do is to use a http://isis.apache.org/guides/rg.html#_rg_annotations_manpage-Action_invokeOn["bulk" action] against a collection of objects, the checkboxes in the UI allowing the end-user to select multiple items:
  +
  +image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/580-select-menu-items-to-create-order-item.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/580-select-menu-items-to-create-order-item.png"]
  +
  +We've had a https://issues.apache.org/jira/browse/ISIS-785[JIRA ticket] for this feature a good while now; something to tackle soon.
  +
  +
  +
  +pass:[<br/><br/>]
  +
  +Still, what we implemented of the competition worked ok; if the user selects a `MenuItem` then an `OrderItem` is created.
  +
  +image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/590-order-updated.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/590-order-updated.png"]
  +
  +
  +
  +pass:[<br/><br/>]
  +
  +The `ShoppingBasket` also allows the quantity of each to be updated.  Here though there was a bug... rather than listing the menu items that were in the basket, the dialog showed the menu items *not* in the basket (!).  Silly:
  +
  +image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/600-update-quantity.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/600-update-quantity.png"]
  +
  +
  +
  +
  +pass:[<br/><br/>]
  +
  +Not suprisingly, this meant that we didn't actually have a way for the end user to change the quantities of each order item:
  +
  +image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/620-order-item-should-have-been-updated.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/620-order-item-should-have-been-updated.png"]
  +
  +
  +
  +=== Print Order
  +
  +Another requirement was for the end-user to be able to print out their order:
  +
  +image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/630-print-order.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/630-print-order.png"]
  +
  +
  +
  +pass:[<br/><br/>]
  +
  +Once more we used the http://github.com/isisaddons/isis-module-docx[Isis addons' docx] module, this time with a slightly prettier https://github.com/incodehq/radrace2015/blob/master/app/src/main/java/domainapp/app/services/export/OrderReport.docx[Word template]:
  +
  +image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/650-view-order-in-word.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/650-view-order-in-word.png"]
  +
  +
  +
  +
  +=== Submit basket
  +
  +Once the user had finished constructing their order, they could use the ``ShoppingBasket``'s `submit(...)` action to complete:
  +
  +image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/660-basket-submit-order.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/660-basket-submit-order.png"]
  +
  +
  +
  +pass:[<br/><br/>]
  +
  +Voila, the basket's status changed.  We only implemented a very simple https://github.com/incodehq/radrace2015/blob/master/dom/src/main/java/domainapp/dom/order/OrderStatus.java[state chart] for ``Order``s; once the order was submitted there was no going back:
  +
  +image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/670-order-submitted-and-immutable.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/670-order-submitted-and-immutable.png"]
  +
  +
  +
  +
  +=== Payment processing
  +
  +Back as the club administrator:
  +
  +image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/700-logon-as-admin.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/700-logon-as-admin.png"]
  +
  +
  +
  +pass:[<br/><br/>]
  +
  +We can use the ``Order``'s `paymentReceived(...)` action to indicate that money has been received from the user:
  +
  +image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/710-order-payment-received.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/710-order-payment-received.png"]
  +
  +
  +
  +pass:[<br/><br/>]
  +
  +As a bit of candyfloss, we decided to support partial payments:
  +
  +image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/720-partial-payment.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/720-partial-payment.png"]
  +
  +
  +
  +pass:[<br/><br/>]
  +
  +which worked up to a point; here you can see that the amount outstanding has been reduced:
  +
  +image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/730-payment-received-updated.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/730-payment-received-updated.png"]
  +
  +
  +
  +pass:[<br/><br/>]
  +
   yada yada:
   
  -image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/570-add-order-items.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/570-add-order-items.png"]
  -
  -
  -
  -pass:[<br/><br/>]
  -
  -yada yada:
  -
  -image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/580-select-menu-items-to-create-order-item.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/580-select-menu-items-to-create-order-item.png"]
  -
  -
  -
  -pass:[<br/><br/>]
  -
  -yada yada:
  -
  -image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/590-order-updated.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/590-order-updated.png"]
  -
  -
  -
  -pass:[<br/><br/>]
  -
  -yada yada:
  -
  -image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/600-update-quantity.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/600-update-quantity.png"]
  -
  -
  -
  -pass:[<br/><br/>]
  -
  -yada yada:
  -
  -image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/610-update-quantity-amount.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/610-update-quantity-amount.png"]
  -
  -
  -
  -pass:[<br/><br/>]
  -
  -yada yada:
  -
  -image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/620-order-item-should-have-been-updated.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/620-order-item-should-have-been-updated.png"]
  -
  -
  -
  -pass:[<br/><br/>]
  -
  -yada yada:
  -
  -image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/630-print-order.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/630-print-order.png"]
  -
  -
  -
  -pass:[<br/><br/>]
  -
  -yada yada:
  -
  -image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/640-order-downloaded.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/640-order-downloaded.png"]
  -
  -
  -
  -pass:[<br/><br/>]
  -
  -yada yada:
  -
  -image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/650-view-order-in-word.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/650-view-order-in-word.png"]
  -
  -
  -
  -pass:[<br/><br/>]
  -
  -yada yada:
  -
  -image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/660-basket-submit-order.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/660-basket-submit-order.png"]
  -
  -
  -
  -pass:[<br/><br/>]
  -
  -yada yada:
  -
  -image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/670-order-submitted-and-immutable.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/670-order-submitted-and-immutable.png"]
  -
  -
  -
  -pass:[<br/><br/>]
  -
  -yada yada:
  -
  -image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/680-logout-then-back-as-admin.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/680-logout-then-back-as-admin.png"]
  -
  -
  -
  -pass:[<br/><br/>]
  -
  -yada yada:
  -
  -image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/700-logon-as-admin.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/700-logon-as-admin.png"]
  -
  -
  -
  -pass:[<br/><br/>]
  -
  -yada yada:
  -
  -image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/710-order-payment-received.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/710-order-payment-received.png"]
  -
  -
  -
  -pass:[<br/><br/>]
  -
  -yada yada:
  -
  -image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/720-partial-payment.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/720-partial-payment.png"]
  -
  -
  -
  -pass:[<br/><br/>]
  -
  -yada yada:
  -
  -image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/730-payment-received-updated.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/730-payment-received-updated.png"]
  -
  -
  -
  -pass:[<br/><br/>]
  -
  -yada yada:
  -
   image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/740-further-payment-defaulted.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/740-further-payment-defaulted.png"]
   
   
   
   pass:[<br/><br/>]
   
  -yada yada:
  -
  -image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/750-bug-overwrites-amount.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/750-bug-overwrites-amount.png"]
  -
  -
  -
  -pass:[<br/><br/>]
  -
  -yada yada:
  -
  -image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/760-partial-payment-take-2.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/760-partial-payment-take-2.png"]
  -
  -
  -
  -pass:[<br/><br/>]
  -
  -yada yada:
  +However there were some bugs, which just goes to show that it's always better to get the app working first for the simple use case, then enhance later if time and is required.  For example it turned out that when entering the payment the amount was rounded down, so any cents could not be entered.  Another silly mistake:
   
   image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/770-bug-rounds-down.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/770-bug-rounds-down.png"]
   
   
   
  -pass:[<br/><br/>]
  -
  -yada yada:
  +=== Print Order
  +
  +Another of the requirements was to allow the club administrator to print out the order, with a payment reference constructed according to some deliberately bizarre rules.  We got the first bit going well enough, once again using the http://github.com/isisaddons/isis-module-docx[Isis addons' docx] module:
   
   image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/780-print-order.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/780-print-order.png"]
   
  
positive.code: 
  pass:[<br/><br/>]
  
  yada yada:
  
  image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/830-ingredients-to-order.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/830-ingredients-to-order.png"]
  
  
negative.code: 
  pass:[<br/><br/>]
  
  This in turn lists the available actions, one of which is the `allEvents(...)` action:
  
  image::https://raw.githubusercontent.com/incodehq/radrace2015/master/images/996-rest-events-list.png[link="https://raw.githubusercontent.com/incodehq/radrace2015/master/images/996-rest-events-list.png"]
  
  