declared ClaudeBot · Anthropic · not verified
The user agent is ClaudeBot (Anthropic), which identifies itself as an AI agent.
Signals: Known agent user agent
This classification is final for the session. The human pages are not served to agents.
{
"question": {
"slug": "settlement-report-sql",
"title": "Settlement Report",
"difficulty": "medium",
"tags": [
"sql",
"technical",
"backend",
"data-eng"
],
"is_free": true,
"locked": false,
"frequency": 0.75,
"last_reported_at": "2026-06-18T10:54:16.960390Z",
"url": "https://www.mokabla.com/en/c/fawry/settlement-report-sql",
"agent": {
"page": "https://www.mokabla.com/agent/en/c/fawry/settlement-report-sql",
"question": "https://www.mokabla.com/agent/_call/get_question?company=fawry&question=settlement-report-sql"
},
"company": {
"slug": "fawry",
"name_en": "Fawry"
},
"body_md": "## Problem\nEvery night Fawry settles merchants. Using the tables below, write a query for a given day that returns\nper merchant: gross amount of successful transactions, total refunds, the fee (1.5% of gross for merchants\non the `standard` plan, 1.0% on `enterprise`) and `net = gross − refunds − fee`. Then a second query:\nmerchants whose refunds on that day exceed 5% of their gross, ordered by that ratio descending.\n\n```\nmerchants(id, name, plan) -- plan in ('standard', 'enterprise')\ntransactions(id, merchant_id, amount, status, created_at) -- status in ('success', 'failed', 'pending')\nrefunds(id, transaction_id, amount, created_at)\n```\n\n## Examples\n**Example 1**, \"Carrefour\" (enterprise) on 2026-08-10: successes 10,000 + 5,000, one failed 2,000\n(ignored), one refund of 500 → gross 15,000, refunds 500, fee 150.00, net 14,350.00.\n\n**Example 2**, \"Koshary Abou Tarek\" (standard): gross 2,000, refunds 300 → ratio 15%, listed by the second\nquery above a merchant with 4% refunds.\n\n## Constraints\n- A refund counts on the refund's date, not the original transaction's date\n- Merchants with no activity that day must not appear\n- Amounts are `NUMERIC(18,2)`; round the fee to 2 decimals\n\n## What they look for\nAggregating transactions and refunds separately before joining (join-then-aggregate double counts gross\nwhen one transaction has two refunds), a `CASE` for the fee, `HAVING` or a CTE for the ratio filter, and\n`NULLIF` against merchants that only have refunds that day.",
"follow_ups_md": "- Same report for a 30-day window with one row per merchant per day.\n- The job runs at 02:00 Cairo time; which timezone is `created_at` in and does that change the query?"
},
"paid": false,
"access": "Question bodies are paid content: a person buys 30 days of access per company (200 EGP or 200 points) in the human app. Agents get titles, tags and difficulty; bodies only for free questions."
}
| action | input | permission | |
|---|---|---|---|
| get_question One question with its body. Bodies are paid content unless the question is free. | company: string, question: string | Allowed | call → |
| list_questions The questions reported at a company: titles, tags, difficulty, whether each is free or paid. | company: string, page: number? | Allowed | call → |
| buy_access Buy 30 days of access to a company. | company: string | Refused R1 This action is for people only | people: https://www.mokabla.com/en/pricing |
| post_comment Comment on a question. | question: string, text: string | Refused R1 This action is for people only | people: https://www.mokabla.com/en/companies |
Allowed actions answer in JSON. Add ?format=json or send Accept: application/json to get this whole page as data.