Ability to Prevent the Frontend from Modifying Duration and Delivery Zone Values Passed from the API
Starting from V9Preview1, it became possible to prevent the frontend from changing the duration and delivery zone values calculated by the external GRiK and passed from the API.
A new field FixedRestrictions has been added to the delivery order IDeliveryOrder, which allows you to either permit the frontend to replace the delivery duration values Duration and zone Zone with those received from “its” GRiK, or, conversely, to prevent editing of the Duration and Zone fields, keeping the values received from the API.
To take advantage of the new functionality, you need to pass a non-empty delivery duration value in the TimeSpan? duration parameter and true in the bool fixedRestrictions parameter when creating a delivery from the API in the method IEditSession.CreateDeliveryOrder. If you also need to pass and fix the delivery zone, the string zone parameter must also have a non-empty value. When IDeliveryOrder.FixedRestrictions = true, the frontend does not call the GRiK check for this delivery and thus leaves the duration and delivery zone values unchanged.
The value of IDeliveryOrder.FixedRestrictions is automatically reset by the frontend to false only when the service mode IOrderType is changed.
You can change the value of the IDeliveryOrder.FixedRestrictions field using the new method IEditSession.ChangeDeliveryFixedRestrictions.
When calling the methods for editing the delivery order - changing the delivery duration IEditSession.ChangeDeliveryDuration or zone IEditSession.ChangeDeliveryZone - the frontend will apply the new parameters, leaving IDeliveryOrder.FixedRestrictions unchanged.
If a delivery with IDeliveryOrder.FixedRestrictions = true reaches the (old) Call Center and is modified in such a way that the GRiK is called, the flag IDeliveryOrder.FixedRestrictions is reset to false, and the fields IDeliveryOrder.Duration and IDeliveryOrder.Zone will be edited - they will be populated with the values returned by the GRiK.