feat: nový krok „Vyzvedávání" ve stepperu Bolt Food
CI / Generate TypeScript types (push) Successful in 14s
CI / Server unit tests (push) Successful in 21s
CI / Build server (push) Successful in 25s
CI / Build client (push) Successful in 35s
CI / Playwright E2E tests (push) Successful in 1m18s
CI / Build and push Docker image (push) Successful in 44s
CI / Notify (push) Successful in 2s
CI / Generate TypeScript types (push) Successful in 14s
CI / Server unit tests (push) Successful in 21s
CI / Build server (push) Successful in 25s
CI / Build client (push) Successful in 35s
CI / Playwright E2E tests (push) Successful in 1m18s
CI / Build and push Docker image (push) Successful in 44s
CI / Notify (push) Successful in 2s
Krok se aktivuje, když je kurýr u podniku a jídlo je zároveň označené jako hotové k vyzvednutí — samotný arrived_to_provider stupínek nezvedá, aby se neopakovala chyba Bolt UI, které „vyzvedávání" hlásí i během přípravy.
This commit is contained in:
@@ -13,13 +13,14 @@ type Props = {
|
||||
};
|
||||
|
||||
/** Nabídka stavů pro ruční nastavení (odpovídá mapování v BoltOrderProgress). */
|
||||
const STATE_OPTIONS: { value: string; label: string }[] = [
|
||||
{ value: 'accepted', label: 'Přijato' },
|
||||
{ value: 'preparing', label: 'Příprava' },
|
||||
{ value: 'waiting_delivery', label: 'Příprava (čeká na vyzvednutí)' },
|
||||
{ value: 'in_delivery', label: 'Na cestě' },
|
||||
{ value: 'delivered', label: 'Doručeno' },
|
||||
{ value: 'cancelled', label: 'Zrušeno' },
|
||||
const STATE_OPTIONS: { key: string; label: string; order_state: string; courier_state?: string }[] = [
|
||||
{ key: 'accepted', label: 'Přijato', order_state: 'accepted' },
|
||||
{ key: 'preparing', label: 'Příprava', order_state: 'preparing' },
|
||||
{ key: 'waiting_delivery', label: 'Příprava (čeká na vyzvednutí)', order_state: 'waiting_delivery' },
|
||||
{ key: 'pickup', label: 'Vyzvedávání', order_state: 'waiting_delivery', courier_state: 'arrived_to_provider' },
|
||||
{ key: 'in_delivery', label: 'Na cestě', order_state: 'in_delivery', courier_state: 'heading_to_client' },
|
||||
{ key: 'delivered', label: 'Doručeno', order_state: 'delivered' },
|
||||
{ key: 'cancelled', label: 'Zrušeno', order_state: 'cancelled' },
|
||||
];
|
||||
|
||||
/** Modální dialog pro simulaci sledování Bolt objednávky (pouze DEV). */
|
||||
@@ -27,7 +28,7 @@ export default function BoltSimulationModal({ isOpen, onClose, group }: Readonly
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [info, setInfo] = useState<string | null>(null);
|
||||
const [manualState, setManualState] = useState<string>('preparing');
|
||||
const [manualKey, setManualKey] = useState<string>('preparing');
|
||||
|
||||
const running = !!group.boltTrackingToken;
|
||||
|
||||
@@ -58,17 +59,20 @@ export default function BoltSimulationModal({ isOpen, onClose, group }: Readonly
|
||||
() => advanceBoltTracking({ body: { groupId: group.id } }),
|
||||
'Posunuto na další krok.',
|
||||
);
|
||||
const handleSetState = () => run(
|
||||
() => setBoltTrackingState({
|
||||
body: {
|
||||
groupId: group.id,
|
||||
order_state: manualState,
|
||||
// "Na cestě" zpřesníme i stavem kurýra
|
||||
courier_state: manualState === 'in_delivery' ? 'heading_to_client' : undefined,
|
||||
},
|
||||
}),
|
||||
`Stav nastaven na „${STATE_OPTIONS.find(o => o.value === manualState)?.label}".`,
|
||||
);
|
||||
const handleSetState = () => {
|
||||
const opt = STATE_OPTIONS.find(o => o.key === manualKey);
|
||||
if (!opt) return;
|
||||
return run(
|
||||
() => setBoltTrackingState({
|
||||
body: {
|
||||
groupId: group.id,
|
||||
order_state: opt.order_state,
|
||||
courier_state: opt.courier_state,
|
||||
},
|
||||
}),
|
||||
`Stav nastaven na „${opt.label}".`,
|
||||
);
|
||||
};
|
||||
const handlePoll = () => run(
|
||||
() => pollBoltTracking(),
|
||||
'Scheduler spuštěn (poll proběhl).',
|
||||
@@ -122,17 +126,17 @@ export default function BoltSimulationModal({ isOpen, onClose, group }: Readonly
|
||||
<>
|
||||
<p className="text-muted">
|
||||
Krokuj objednávku tlačítkem <strong>Další krok</strong> (Přijato → Příprava →
|
||||
Na cestě → Doručeno) nebo nastav konkrétní stav ručně:
|
||||
Vyzvedávání → Na cestě → Doručeno) nebo nastav konkrétní stav ručně:
|
||||
</p>
|
||||
<Form.Group className="mb-3 d-flex gap-2 align-items-end">
|
||||
<div className="flex-grow-1">
|
||||
<Form.Label>Konkrétní stav</Form.Label>
|
||||
<Form.Select
|
||||
value={manualState}
|
||||
onChange={e => setManualState(e.target.value)}
|
||||
value={manualKey}
|
||||
onChange={e => setManualKey(e.target.value)}
|
||||
>
|
||||
{STATE_OPTIONS.map(o => (
|
||||
<option key={o.value} value={o.value}>{o.label}</option>
|
||||
<option key={o.key} value={o.key}>{o.label}</option>
|
||||
))}
|
||||
</Form.Select>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user