Task
The client onboarded corporate customers slowly. Managers set up settlement instruments for each product by hand in several systems at once. The registers drifted apart, and reconciliation took a lot of working time.
Solution
I built a Java and Spring Boot service that takes a REST request, creates settlement instances and product registers on its own and keeps all state in PostgreSQL. The service runs in Docker Compose, so the environment starts with one command at any time. I documented the API in detail, so related systems connect to the service without calls with the developers.
What was done
- Wrote a Java and Spring Boot service that creates settlement instances from a REST request
- Brought the product registers into one PostgreSQL store
- Documented the API so related systems connect on their own
- Packaged the environment in Docker Compose to start with one command
Result
Setting up a settlement instrument is no longer a manual task, and all registers are kept in one place. Connecting a new consumer system now takes a day instead of a week of agreeing on data formats.
Developer's note
What was hard
The main challenge was making product creation and register creation one operation. A request must pass required-field checks, find register types by product code and select a pool by branch, currency, customer code and priority. If no pool matches, the new product must not remain in the database without registers. The Java service runs this sequence within a transaction.
The same endpoint supports creating a product and adding agreements to an existing one. Missing required fields and duplicates return 400; a missing product or matching pool returns 404. This gives the integrating system a clear result instead of requiring manual investigation.
What came easy
Products, registers, accounts, pools and agreements mapped naturally to Spring Data JPA and relational tables. Separating controllers, services and repositories made it possible to develop the REST contract independently of storage access.
Docker Compose with PostgreSQL provides a repeatable environment. Service and controller tests use H2, with JaCoCo for coverage reporting. Documented request and response examples help new consumer systems connect without negotiating each field again.
Technologies
JavaSpringPostgreSQL