feat: console Phase 2 final - live cancel and customer endpoints

- cancelOrder/cancelDeliveryAPI: real POST /admin/bookings/:id/cancel
- getallcustomers/getcustomersummary: real /admin/customers, aliasing
  appcustomerid -> userid for existing call sites
- BookingDetail: confirmed field names from live backend, cancel button
  now hits the live endpoint
- customers.js: table columns show Name/Phone/Email/Total Bookings/Joined
  using appcustomerid/name/phone/email/totalbookings/createdat

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-09 11:48:45 +05:30
parent 1a71732396
commit 709a06274a
9 changed files with 326 additions and 345 deletions

View File

@@ -75,9 +75,9 @@ const BookingDetail = () => {
enabled: Boolean(id)
});
// Response shape is unconfirmed beyond what /admin/bookings' list rows
// return — reads defensively off `data.data` first, falling back to the
// top-level response, same pattern used for the login response mismatch.
// Confirmed shape (booking id 5): bookingid, bookingreference, status,
// pickupaddress, deliveryaddress, assignedmileruserid, createdat,
// bookingparcels (nested parcels), serviceoptions, payments.
const booking = data?.data || data || {};
const reassignMutation = useMutation({