BEGIN;

INSERT INTO shipments (
    external_id,
    status,
    price_cents,
    destination_postal,
    booked_at
) VALUES
    ('shipment-100', 'booked', 1299, '00100', '2026-08-01T10:00:00Z'),
    ('shipment-101', 'cancelled', 1899, '33100', '2026-08-01T10:01:00Z');

INSERT INTO shipment_events (
    shipment_id,
    event_sequence,
    kind,
    occurred_at
)
SELECT id, 1, 'booked', '2026-08-01T10:00:00Z'
FROM shipments
WHERE external_id = 'shipment-100';

INSERT INTO shipment_events (
    shipment_id,
    event_sequence,
    kind,
    occurred_at
)
SELECT id, 2, 'label_ready', '2026-08-01T10:00:30Z'
FROM shipments
WHERE external_id = 'shipment-100';

INSERT INTO shipment_events (
    shipment_id,
    event_sequence,
    kind,
    occurred_at
)
SELECT id, 1, 'booked', '2026-08-01T10:01:00Z'
FROM shipments
WHERE external_id = 'shipment-101';

INSERT INTO shipment_events (
    shipment_id,
    event_sequence,
    kind,
    occurred_at
)
SELECT id, 2, 'cancelled', '2026-08-01T10:01:30Z'
FROM shipments
WHERE external_id = 'shipment-101';

INSERT INTO recovery_ledger (sequence, business_id, kind, committed_at)
VALUES
    (100, 'shipment-100', 'shipment_booked', '2026-08-01T10:00:00Z'),
    (101, 'shipment-101', 'shipment_booked', '2026-08-01T10:01:00Z');

COMMIT;
