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

Order generation must preserve manual changes #838

Open
JeanFrancoisFournier opened this issue Oct 21, 2018 · 3 comments
Open

Order generation must preserve manual changes #838

JeanFrancoisFournier opened this issue Oct 21, 2018 · 3 comments

Comments

@JeanFrancoisFournier
Copy link
Contributor

weekday = delivery_date.weekday() # Monday is 0, Sunday is 6
day = DAYS_OF_WEEK[weekday][0] # 0 -> 'monday', 6 -> 'sunday'
for client in clients:
try:
order = Order.objects.get(client=client,
delivery_date=delivery_date)
created_orders.append(order)
continue

@JeanFrancoisFournier
Copy link
Contributor Author

  • Expected Behaviour

    • When a customer calls to make changes affecting an order on a
      future date (tomorrow of later), I want to be able to change the
      quantities and contents of the order or to cancel the order.
    • When a customer calls for changes in his meal defaults or
      schedule, I want the future orders to reflect the changes.
    • When the status of a customer changes, I want the future orders to
      take this into account.
  • Actual Behaviour

    • Once an order has been generated by the automatic cron job, its
      details are not updated when a client asks to change his(her) meal
      defaults or schedule.
    • Once an order has been generated by the automatic cron job, it
      remains there even if the client status changes from active to
      something else for a period including the order delivery date.
  • Proposed solution

    • When an order is manually created, modified or cancelled, remember the
      date + time of this action and call this "order modification date".
    • When an order is manually created, modified or cancelled, using
      the Admin, the user will be responsible to put today's date + time
      in the field "order modification date".
    • When orders are to be automatically generated nightly (for a
      period of 100 days in the future) do the following :
      • delete all orders in the database that have a null "order
        modification date"​ AND a delivery date >= today.​
      • create all orders in the future for "active ongoing" clients and
        set their "order modification date" to null, but do not replace
        the preexisting orders that have a non null "order modification
        date".
    • In the Orders list page, show the "order modification date"​ and label
      this field as "manual creation/modification date"​
      .

@JeanFrancoisFournier
Copy link
Contributor Author

Also, I think that simply preventing the cron job from messing with manually modified orders could cause issues with side dish changes on manually generated orders. (i.e. episodic clients that order for the next month.)

This is a complex issue

@JeanFrancoisFournier JeanFrancoisFournier changed the title *** temporary draft issue*** Order generation Order generation must preserve manual changes Dec 21, 2018
@manumilou
Copy link
Contributor

  • When a customer calls to make changes affecting an order on a
    future date (tomorrow of later), I want to be able to change the
    quantities and contents of the order or to cancel the order.

This works though, right ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants