Repository navigation
A dish can be added to an order that has already gone - #647
Merged
Merged
Conversation
Owner: "if any changes like add new item to the order possible? or removing item or increase decrease quantity possible?" Two of the three already worked. A line already on the order could be taken to any quantity, nought included, because every money field on it is linear in its quantity and could be scaled from the order's own prices. A dish that had never been on it had nothing to scale, so it was refused with not_on_this_order and the assistant was told to send a second ticket. Now it is priced instead, through the same method the order itself was placed with. The loop that priced a new order's lines is a method now, and both callers share it: the refusals are written once, so a dish added five seconds after the order costs exactly what it would have cost in it, and is refused for exactly the same reasons - an id that is not one, a dish this branch does not sell, one outside its serving period, one the shop has taken off the online channel. It reaches the kitchen as an "add" on the same changes log a waiter's amendment writes. House prices, always. An order bound for a hotel room cannot be changed from a phone at all, because its total carries a markup and a commission that are not the customer's to move, so there is no marked-up case to reproduce and inventing one would be a guess about money. Asking for none of something that was never there is a typo, not a change, and is ignored rather than written.
Contributor
|
Merged to Try it at https://develop.posnic.io, or run it yourself: git fetch origin develop && git checkout develop
npm install && npm --prefix api install
npm run dev # then http://localhost:3000When you have tested it, say what you did and what happened, and set Reporting that something is broken is as useful as fixing it. It is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Owner: "if any changes like add new item to the order possible? or removing item or increase decrease quantity possible?"
Where it stood
A line already on the order can be scaled from its own stored prices, because every money field on it is linear in its quantity. A dish that was never on it has nothing to scale, so it was refused with
not_on_this_order.How it is priced
The loop that prices a new order's lines is now a method,
_priceOnlineLine, and both callers share it. So a dish added five seconds after the order costs exactly what it would have cost in it, and meets exactly the same refusals, written once:It reaches the kitchen as an
addon the samechangeslog a waiter's amendment writes, and the order's totals move by exactly what the new line costs.House prices, always. An order bound for a hotel room cannot be changed from a phone at all (
at_the_counter), because its total carries a markup and a commission that are not the customer's to move. There is no marked-up case to reproduce here, and inventing one would be a guess about money.Asking for none of something that was never there is a typo, not a change, and is ignored.
The assistant
change_placed_ordernow says a dish not on the order yet is added at the menu price, so the model stops sending a second ticket for it. The refusal guidance passes the shop's own sentence through rather than inventing one.Tests
customer-order.service.test.js: a new dish is priced, added, logged to the kitchen as an add, and moves the total by its own cost; a dish the shop will not sell right now is refused in the shop's words and nothing is written; zero of something absent changes nothing. 10,472 API tests and 127 page tests pass, including the whole order-creation suite over the extracted method.