Preventing Invalid States with Repository Pattern Logic
Introduction
In the North-South project, managing the lifecycle of payment transactions is critical. A common challenge in complex systems is ensuring that domain objects do not transition into invalid states—such as creating a payment after a transaction has already been cancelled or completed.
The Problem
We identified a potential race condition and logic gap where payment services