İçeriğe atla
ÖzelliklerFiyatlandırmaİş OrtaklığıBlogYardımHakkımızdaİletişim
BaşlaGiriş Yap
Bloga Dön
industry2026-05-2412 dk okuma

Musteri siparis iptal etti stok geri eklenmedi — cancel inventory restore (PR #555 RR F3)

Mersin Bozyazi 39-yas Mersin Tantuni + Cezerye 42-cover 11-yil Dogu Akdeniz mutfagi + tantuni + ceviz dolgulu cezerye sahibi Selin thMenu Platinum 16 ay. Cuma ogle yogunluk olagandisi gozlem tantuni durumu tezgahta 18 adet hazir ama thMenu paneli stok bitti musteriler siparis veremez. Selin manuel stock_qty=18 set tantuni satisa acildi ama olay patronlasti. Sabah 30 durum hazir 12 satis 30-12=18 kalmali. thMenu 0. Son 5 saat 30 decrement event 30-12=18 mismatch. Support yazdi 18 decrement fazladan musteri iptal stok geri eklenmiyor mu. Engineering 3 yanlis teori (1) stock_qty decrement two-write race condition CLAUDE.md §17 atomic UPDATE inline filter UPDATE products SET stock_qty - ? WHERE id = ? AND stock_qty >= ? race koruma; (2) background sync race Service Worker bg-sync queue Idempotency-Key engelliyor; (3) customer 90-second cancel window stok geri eklenmiyor olabilir dogru. Adli analiz apps/web-menu/src/app/api/orders/cancel/route.ts 90-second cancel handler PR #311 atomic race-guard UPDATE status pending->cancelled + loyalty earn reversal AMA stock_qty restore yapmiyor. Selin 5-saat 30 order POST → 30 decrement 18 customer 90s cancel rush yanlis order 12 served cancel handler stoku restore etmedi stock_qty Reality 18 asagi Stock zero false-positive auto-86 push stock_qty<=0 is_available=0 tantuni durum stokta yok 18 durum hazir gerçekte. PR #555 batch RR F3 3-katmanli fix Layer 1 customer cancel handler stock restore atomic items loop her item UPDATE products SET stock_qty + ? WHERE id db.batch tek transaction. Layer 2 auto-flip is_available stok restored ise + is_available=0 + stock_qty>0 + auto_86_disabled flag UPDATE products SET is_available=1 WHERE id AND auto_86_disabled=1 tantuni hemen satisa. Layer 3 inventory_movements ledger her decrement + restore log kind=cancel_restore veya order_decrement cross-DB drift detection PR #654 VIII F1 reconcile cron input. Production audit 90-gun cancel event × stock_qty cross-correlate 2847 cancel event 247 restaurant etkilendi her birine manuel correction email + 1-ay Platinum credit. Selin tantuni 18 durum anında geri eklendi 60 durum sattim normalde 30 1-ay Platinum credit Twitter 24 saat fix shipped tantuni %70 yukari 2.1k engagement. Conor Belfast Botanic 50-cover Irish gastropub 9-yil Friday Guinness pie 22 pies pass shelf same pattern 1-ay Platinum credit. Pattern order state transition stok decrement tetikliyorsa reverse transition (cancel refund void) stok restore tetiklemeli symmetric inventory effect. Sibling sweep (a) POST /api/orders → stock decrement POST /api/orders/cancel → stock restore RR F3; (b) Admin PATCH /api/orders/[id]/status pending->cancelled veya voided stok restore; (c) POST /api/orders/[id]/refund kismi item-level refund stok restore yapmamali yemek pisti customer istifaya gitti full refund stok restore yapmamali gercekten servis edildi NO inventory side-effect on refund; (d) loyalty redeem reward stock loyalty_rewards.stock_qty customer cancel hem product hem reward stok restore. Implementation order POST stock decrement varsa tum inverse state transition symmetric stok restore + atomic db.batch + auto-flip is_available + inventory_movements ledger + cross-DB drift detection cron + production audit 90-day cancel × stock_qty cross-correlate. PR #555 referans.

th

thMenu Ekibi

thmenu.com

Faydalı buldunuz mu? Paylaşın.