Order Fulfillment Deadline

The Order Fulfillment Deadline component calculates the latest date when an order should be fulfilled.

Calculation process

The client code prepares an Input, which contains the following information:

  1. Order date

    Specifies when the order was placed, so the calculator knows the starting date.

  2. Fulfillment commitment

    Denotes the maximum time to fulfillment since the order date to which has the processor committed to (under normal circumstances). It can, for example, be the longest time to shipment of all products in the order.

Furthermore, the calculator needs a service hours provider, which will tell it on what dates orders are processed and on what dates they are not.

Taking all the above into consideration, the calculator will produce a date and time by which the order must be fulfilled to meet the commitment. A loop will start with the deadline set to the order date. Each iteration will add one day to the deadline and subtract one day from the commitment. The exception is dates when orders are not processed, those will not consume time from the commitment. When commitment is consumed entirely, the loop stops, and the deadline is returned to the client code.

Time on the deadline day is clamped to the time when order processing ends on that day. If the time in the order date is before processing starts, one day is immediately subtracted from the commitment (to illustrate, when the commitment is 1 day and a customer orders before processing starts, the deadline will be the same day as the order date).