updates on the dispatch page
This commit is contained in:
@@ -140,6 +140,36 @@ export const createOptimisationDeliveries = async (deliveryData) => {
|
||||
const response = await axios.post(`https://routes.workolik.com/api/v1/optimization/createdeliveries`, deliveryData.deliveries);
|
||||
return response.data;
|
||||
};
|
||||
// ==============================|| reconcileSteps (Preview - validate rider/order step assignments) ||============================== //
|
||||
|
||||
export const reconcileSteps = async ({ riders }) => {
|
||||
const response = await axios.post(
|
||||
`https://routes.workolik.com/api/v1/optimization/reconcile-steps`,
|
||||
{ riders }
|
||||
);
|
||||
return response.data;
|
||||
};
|
||||
|
||||
// ==============================|| fetchBatchEfficiency (Dispatch - Analysis view) ||============================== //
|
||||
// Calls POST /api/v1/batch/efficiency with a JSON body { batch, tenant_id }.
|
||||
// `batch` is one of: 'morning' | 'afternoon' | 'evening'.
|
||||
|
||||
export const fetchBatchEfficiency = async ({ batch, tenantId }) => {
|
||||
const response = await axios.post(
|
||||
`https://routes.workolik.com/api/v1/batch/efficiency`,
|
||||
{
|
||||
batch,
|
||||
tenant_id: tenantId
|
||||
},
|
||||
{
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
// Let success:false envelopes flow through so the UI can surface the
|
||||
// server's own error message (instead of axios throwing on 4xx/5xx).
|
||||
validateStatus: () => true
|
||||
}
|
||||
);
|
||||
return response.data;
|
||||
};
|
||||
// ==============================|| finalCreatedeliveries (orders) ||============================== //
|
||||
|
||||
export const finalCreatedeliveries = async (deliveryData) => {
|
||||
|
||||
Reference in New Issue
Block a user