This is a simple Flask-based web service that helps process summer mowing revenue and expense data to generate a tax-friendly financial report. It supports:
- Uploading transaction data in CSV format via a POST /transactions endpoint.
- Querying the summary of gross revenue, expenses, and net revenue via a GET /report endpoint.
- Python 3.8 or above.
- pip for package management.
MacOS and Linux: Use Default Terminal. Windows: Use Git Bash.
-
Open a terminal (T1), clone this repository
a) If access from Git VCS
-
git clone https://github.com/philcaz/Summer_Break_Test.git
-
cd Summer_Break_Test
b) If unzip tarball directly, proceed to step 2.
-
-
Install dependencies
pip install -r requirements.txt
-
Run the application
python api.py
-
Open a new terminal (T2), test API Endpoints
- make sure current directory is the same as in T1
- run
./tests/test.sh
-
Stop the application in T1
Ctrl + C
- Used Python's builtin
csv
library for lightweight data parsing - Used a global list
data
to hold in-memory transactions, avoiding persistence for the MVP
- The CSV data does not have headers
Date, Type, Amount($), Memo
- Type can only be
Income
orExpense
- All amounts are in valid numeric formats
- Data is stored in memory, which is hard to scale for large datasets
- Insufficient data quality check, such as for invalid dates and duplicate entries
- Connect the application to a database to persist data storage
- Implement more comprehensive data validation and deduplication
- Add more detailed reporting such as monthly summaries