updates on the dispatch page

This commit is contained in:
2026-05-28 19:37:04 +05:30
parent 8cc7cc75f9
commit 39b562ddb5
8 changed files with 3937 additions and 1714 deletions

View File

@@ -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) => {