Codex Engineer
Coding08m 42sImplement the checkout delivery adapter
p-line/storefrontagent/delivery-adaptera41f9c2
Codex editing
1
import type { DeliveryQuote, CarrierRate } from './types';2
import { carrierGateway } from '@/lib/carriers/gateway';3
4
export async function resolveDeliveryQuote(5
destination: Destination,6
basket: Basket,7
): Promise<DeliveryQuote> {8
const rates = await carrierGateway.quote({ destination, basket });9
const available = rates.filter((rate) => rate.available);10
11
if (available.length === 0) {12
return fallbackQuote(destination.region);13
}14
15
return selectBestRate(available);16
}Terminalrun 1182
$ pnpm test --filter checkout
forge · codex-engineer · node 24.7.0
PASS tests/checkout/delivery.test.ts (24 assertions)
FLAKY tests/carriers/timeout.test.ts (2 retries)
24 passed · 2 flaky · 0 failed 12.4s