production
This commit is contained in:
@@ -165,7 +165,26 @@ abstract final class MilerLifecycle {
|
||||
'booking_status',
|
||||
]);
|
||||
final parsed = BookingStatus.parse(raw);
|
||||
final confirmed = parsed == BookingStatus.arrivedAtPickup;
|
||||
|
||||
// ── Arrival is a timestamp, not a status ──
|
||||
//
|
||||
// This asked whether the booking's `status` had become
|
||||
// `Arrived_At_Pickup`, and answered *unconfirmed* forever — because the
|
||||
// backend team has since confirmed there is **no Arrived rung in the
|
||||
// booking-status lifecycle at all**. It goes
|
||||
// `pickup_scheduled → converted_to_consignment → …`, and arrival is
|
||||
// recorded beside it as `reachedat`.
|
||||
//
|
||||
// So the app was demanding evidence of a transition the backend never
|
||||
// claimed to make, and logging a gap every time it did not get it. The
|
||||
// proof of arrival is the arrival stamp coming back; the status echoing
|
||||
// `Miler_Assigned` or `pickup_scheduled` is correct and expected.
|
||||
final stamp = _str(res.data, const [
|
||||
'reachedat',
|
||||
'reached_at',
|
||||
'arrivedat',
|
||||
]);
|
||||
final confirmed = stamp.isNotEmpty;
|
||||
|
||||
return StateTransition(
|
||||
outcome: confirmed
|
||||
@@ -173,9 +192,11 @@ abstract final class MilerLifecycle {
|
||||
: TransitionOutcome.unconfirmed,
|
||||
bookingStatus: parsed,
|
||||
consignmentState: ConsignmentState.unknown,
|
||||
evidence: raw.isEmpty
|
||||
? 'the response named no status at all'
|
||||
: 'the response reported status="$raw"',
|
||||
evidence: confirmed
|
||||
? 'the response stamped the arrival at "$stamp"'
|
||||
: raw.isEmpty
|
||||
? 'the response carried no arrival stamp and named no status'
|
||||
: 'the response carried no arrival stamp; status="$raw"',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user