Welcome to finance engineering. ledgersync/ imports charges from our payments provider and sends payouts. Someone started it and moved teams: it works on a quiet account and nowhere else. The provider's API is in docs/AP…
Welcome to finance engineering. ledgersync/ imports charges from our payments provider and sends payouts. Someone started it and moved teams: it works on a quiet account and nowhere else. The provider's API is in docs/API.md; our rules are in README.md. Read both before you write code.
You have 50 minutes. The checks are graded one by one, so each part you get working counts even if the rest is not done. It is open book: the docs, the code and the Python docs are all fair game.
sync_charges reads every page and imports every succeeded charge once.Retry-After for 429, one second for 500 and unreadable bodies, at most four attempts, no retry for 400.sync_charges returns "failed" and keeps what it imported.pay_out never makes two payouts for one call, however many retries it takes, and returns "failed" instead of raising.pytest tests/visible. Two tests fail on the current code.ledgersync/session.py or fakepay/: the checks drive them.Visible test command
pytest tests/visibleThe repository’s own tests. Run all tests includes them, and so does every submission.
Repository
ledger-sync-integration-pagination-retries-and-idempotent-payouts
Changes under src/ are evaluated.