feat(inventory): libera estoque na compensação (fase 5) - #7
Conversation
thomasmoreira
commented
Jun 8, 2026
Fecha o loop de compensação da saga: o Inventory consome ReleaseStockRequested (emitido pela saga quando o pagamento falha), devolve o estoque reservado e responde StockReleased — que o consumer da saga no Orders usa para finalizar o cancelamento. - Consumers: ReleaseStockRequestedConsumer libera o estoque e emite StockReleased, tudo na transação do inbox (release + emit + dedup atômicos; redelivery libera 1x) - Host: registra o novo consumidor (a fila inventory passa a também escutar ReleaseStockRequested) - Teste: reserva 2 (5->3), libera 2 (3->5) idempotente; redelivery não libera duas vezes Com isso o caminho de falha de pagamento fica end-to-end: PaymentFailed -> saga Compensating + ReleaseStockRequested -> Inventory devolve estoque + StockReleased -> saga Cancelled -> Order Cancelled. Build limpo (0/0); unit 4/4; integration 12 passam + 2 skipped (F1/F4).
|
Warning Review limit reached
More reviews will be available in 55 minutes and 8 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fecha o loop de compensação da saga: o Inventory consome ReleaseStockRequested (emitido pela saga quando o pagamento falha), devolve o estoque reservado e responde StockReleased — que o consumer da saga no Orders usa para finalizar o cancelamento. - Consumers: ReleaseStockRequestedConsumer libera o estoque e emite StockReleased, tudo na transação do inbox (release + emit + dedup atômicos; redelivery libera 1x) - Host: registra o novo consumidor (a fila inventory passa a também escutar ReleaseStockRequested) - Teste: reserva 2 (5->3), libera 2 (3->5) idempotente; redelivery não libera duas vezes Com isso o caminho de falha de pagamento fica end-to-end: PaymentFailed -> saga Compensating + ReleaseStockRequested -> Inventory devolve estoque + StockReleased -> saga Cancelled -> Order Cancelled. Build limpo (0/0); unit 4/4; integration 12 passam + 2 skipped (F1/F4).