# example-bank-celery

This is a celery based microservice. This microservice has the following

1. A celery beat producer - process\_payments\_beat\_producer - that picks up all "PENDING" <mark style="color:blue;">**initiate\_payment\_batch\_requests**</mark> and delegates the batch\_id to a celery worker
2. A celery worker - <mark style="color:blue;">**process\_payments\_worker**</mark> - that receives the batch\_id from the beat producer.
   1. It then picks up all the individual payments for that batch\_id and creates book keeping entries for the remitter side (debit leg) for every payment
   2. <mark style="color:red;">Since this is only a simulator, it only generates the Debit leg of the book keeping (for the remitter account) and does not bother about the Credit leg (the beneficiary part) of the book keeping</mark>
   3. It updates the <mark style="color:blue;">**account.book\_balance**</mark> and <mark style="color:blue;">**account.available\_balance**</mark> accordingly for each payment
   4. It also randomly produces some reversal entries for every payment transaction
3. A celery worker - <mark style="color:blue;">**account\_statement\_generator**</mark> - that receives <mark style="color:blue;">**account\_statement.id**</mark> from the generate\_statement controller API
   1. It generates an MT940 account statement for that account and persists that statement (as a TEXT) in <mark style="color:blue;">**account\_statement.lob**</mark>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.openg2p.org/products/g2p-bridge/development/design-specifications/example-bank/openg2p-g2p-bridge-example-bank-celery.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
