GitHunt
MO

mo1ein/zibal

zibal interview task

Zibal interview task

You need to implement a small service that exposes an API for transaction reports (daily/weekly/monthly) supporting two aggregation types (count and amount). Because the transactions dataset can be very large, the app supports precomputed summaries stored in a transaction_summary collection for fast reads and a fallback on-the-fly aggregation for ad-hoc computation. An optional second part of the project is a notification service (async, retries, multi-channel) — implementing it is optional but recommended.

🔧 Run

git clone https://github.com/mo1ein/zibal.git
cd zibal

Then:

make env
make build
make up

Now you can enjoy the app.

🌐 Endpoints

curl http://localhost:8000/api/reports/transactions/?type=count&mode=daily
curl http://localhost:8000/api/reports/transactions/?type=count&mode=weekly
curl http://localhost:8000/api/reports/transactions/?type=count&mode=monthly
curl http://localhost:8000/api/reports/transactions/?type=amount&mode=monthly
curl http://localhost:8000/api/reports/transactions/?type=amount&mode=daily
curl http://localhost:8000/api/reports/transactions/?type=amount&mode=weekly

Successful Response

[
  {
    "key": "هفته ۶ سال ۱۴۰۳",
    "value": 98
  },
  {
    "key": "هفته ۷ سال ۱۴۰۳", 
    "value": 145
  }
]
[
  {
    "key": "1402 خرداد",
    "value": 1029
  },
  {
    "key": "1402 تیر",
    "value": 1519
  },
  {
    "key": "1402 مرداد",
    "value": 1519
  }
]

Languages

Python84.5%Shell4.7%Dockerfile4.1%Makefile3.5%JavaScript3.1%

Contributors

Created November 4, 2025
Updated November 4, 2025