How stillstream-ink/fintech-api-test works
This repository combines a Flask mock lending service with an API-testing framework. The main user-to-result workflow is to register a customer, check eligibility, create a loan, and exercise or inspect its state through repayment; the service persists customers, loans, and repayment flows. The test framework calls the service through a layered HTTP client and covers functional, boundary, contract, consistency, and state-machine behavior. Locust provides a separate performance-testing branch. Some test and rule implementations were not sampled, so those components are represented at their documented directory or data-file paths; edges reflect README statements or shown calls.
Main entry points: credit_api.py Credit API client · app.py Flask API · conftest.py Service test fixtures · test_boundary.py Boundary scenarios
Components 22
Mock lending service
- Flask API
app.py - Eligibility rules
app.py - Loan lifecycle
app.py - SQLAlchemy persistence
app.py - SQLite database
app.py
API client and contracts
- HTTP base client
api/base_api.py - Credit API client
api/credit_api.py - Legacy client import
credit_api.py - Response contracts
schemas/credit_schemas.py
Test coverage
- Service test fixtures
conftest.py - Functional and security
tests/test_credit.py - Boundary scenarios
tests/test_boundary.py - Eligibility test data
data/eligibility_age.yaml - Contract validation
tests/test_contract.py - Database consistency
tests/test_db_consistency.py - Direct DB checks
tests/db_helper.py - State-machine tests
tests/test_loan_state_machine.py
Performance testing
- Locust user
locustfile.py - Load-test runner
scripts/run_load_test.py - Performance summary
scripts/summarize_perf.py
Other components
- Engineer / tester
- Mock service
Connections 23
- Engineer / tester → Service test fixtures: runs tests
README.md - Service test fixtures → Legacy client import: imports client
conftest.py - Legacy client import → Credit API client: re-exports
credit_api.py - Credit API client → HTTP base client: inherits
api/credit_api.py - Service test fixtures → Mock service: starts service
conftest.py - Credit API client → Mock service: calls HTTP API
api/credit_api.py - Mock service → Flask API: routes requests
README.md - Flask API → Eligibility rules: checks rules
app.py - Flask API → Loan lifecycle: handles transitions
app.py - Flask API → SQLAlchemy persistence: uses ORM
app.py - SQLAlchemy persistence → SQLite database: reads and writes
app.py - Service test fixtures → Credit API client: provides fixture
conftest.py - Functional and security → Credit API client: tests endpoints
README.md - Boundary scenarios → Eligibility test data: loads scenarios
README.md - Boundary scenarios → Credit API client: tests boundaries
README.md - Contract validation → Response contracts: validates responses
README.md - Contract validation → Credit API client: checks API results
README.md - Database consistency → Credit API client: checks API data
README.md - Database consistency → Direct DB checks: checks database
README.md - State-machine tests → Credit API client: tests state path
README.md - Load-test runner → Locust user: runs load tasks
README.md - Locust user → Mock service: sends load traffic
locustfile.py - Performance summary → Load-test runner: summarizes results
README.md