64 lines
2.3 KiB
Makefile
64 lines
2.3 KiB
Makefile
.PHONY: help fees match web image run sync sync-2026 test test-v
|
|
|
|
export PYTHONPATH := scripts:$(PYTHONPATH)
|
|
VENV := .venv
|
|
PYTHON := $(VENV)/bin/python3
|
|
CREDENTIALS := .secret/fuj-management-bot-credentials.json
|
|
|
|
$(PYTHON): .venv/.last_sync
|
|
|
|
.venv/.last_sync: pyproject.toml
|
|
uv sync
|
|
touch .venv/.last_sync
|
|
|
|
help:
|
|
@echo "Available targets:"
|
|
@echo " make fees - Calculate monthly fees from the attendance sheet"
|
|
@echo " make match - Match Fio bank payments against expected attendance fees"
|
|
@echo " make web - Start a dynamic web dashboard locally"
|
|
@echo " make image - Build an OCI container image"
|
|
@echo " make run - Run the built Docker image locally"
|
|
@echo " make sync - Sync Fio transactions to Google Sheets"
|
|
@echo " make sync-2026 - Sync Fio transactions for the whole year of 2026"
|
|
@echo " make infer - Infer payment details (Person, Purpose, Amount) in the sheet"
|
|
@echo " make reconcile - Show balance report using Google Sheets data"
|
|
@echo " make venv - Sync virtual environment with pyproject.toml"
|
|
@echo " make test - Run web application infrastructure tests"
|
|
@echo " make test-v - Run tests with verbose output"
|
|
|
|
venv:
|
|
uv sync
|
|
|
|
fees: $(PYTHON)
|
|
$(PYTHON) scripts/calculate_fees.py
|
|
|
|
match: $(PYTHON)
|
|
$(PYTHON) scripts/match_payments.py
|
|
|
|
web: $(PYTHON)
|
|
$(PYTHON) app.py
|
|
|
|
image:
|
|
docker build -t fuj-management:latest -f build/Dockerfile .
|
|
|
|
run:
|
|
docker run -it --rm -p 5001:5001 fuj-management:latest
|
|
|
|
sync: $(PYTHON)
|
|
$(PYTHON) scripts/sync_fio_to_sheets.py --credentials .secret/fuj-management-bot-credentials.json
|
|
|
|
sync-2026: $(PYTHON)
|
|
$(PYTHON) scripts/sync_fio_to_sheets.py --credentials .secret/fuj-management-bot-credentials.json --from 2026-01-01 --to 2026-12-31 --sort-by-date
|
|
|
|
infer: $(PYTHON)
|
|
$(PYTHON) scripts/infer_payments.py --credentials $(CREDENTIALS)
|
|
|
|
reconcile: ## Match payments against attendance
|
|
export PYTHONPATH=$(PYTHONPATH):$(CURDIR)/scripts && $(PYTHON) scripts/match_payments.py --credentials $(CREDENTIALS)
|
|
|
|
test: $(PYTHON) ## Run web application tests
|
|
export PYTHONPATH=$(PYTHONPATH):$(CURDIR)/scripts:$(CURDIR) && $(PYTHON) -m unittest discover tests
|
|
|
|
test-v: $(PYTHON) ## Run tests with verbose output
|
|
export PYTHONPATH=$(PYTHONPATH):$(CURDIR)/scripts:$(CURDIR) && $(PYTHON) -m unittest discover -v tests
|