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 zibalThen:
make env
make build
make upNow you can enjoy the app.
🌐 Endpoints
curl http://localhost:8000/api/reports/transactions/?type=count&mode=dailycurl http://localhost:8000/api/reports/transactions/?type=count&mode=weeklycurl http://localhost:8000/api/reports/transactions/?type=count&mode=monthlycurl http://localhost:8000/api/reports/transactions/?type=amount&mode=monthlycurl http://localhost:8000/api/reports/transactions/?type=amount&mode=dailycurl http://localhost:8000/api/reports/transactions/?type=amount&mode=weeklySuccessful Response
[
{
"key": "هفته ۶ سال ۱۴۰۳",
"value": 98
},
{
"key": "هفته ۷ سال ۱۴۰۳",
"value": 145
}
][
{
"key": "1402 خرداد",
"value": 1029
},
{
"key": "1402 تیر",
"value": 1519
},
{
"key": "1402 مرداد",
"value": 1519
}
]On this page
Languages
Python84.5%Shell4.7%Dockerfile4.1%Makefile3.5%JavaScript3.1%
Contributors
Created November 4, 2025
Updated November 4, 2025