Files
RosterChief/pyproject.toml
Bernard Siebens 60bfac9881 Add platform billing: tiers, dues, payments and invoices
RosterChief charging the clubs, which is a different domain from `shop` (a club
charging its members). Nothing here is club-scoped: these rows reference a Club,
they are not owned by one, and no club user ever sees them.

- Tier + TierPrice. Prices are dated, not keyed by year: a rate change is one row
  with a future active_from, and price_on(day) answers "what was in force then".
  A tier with no price yet returns None, which callers must treat as "cannot
  bill" -- never as free.
- Due: one rolling-year period per club, with a 45-day grace tail. The tier and
  the amount are SNAPSHOTS taken when the period opens. Raise the price and last
  year's period must still say what was actually charged; reading it back through
  the tier would silently rewrite financial history.
- DuePayment: partial payments accumulate. amount_paid is re-summed from the
  payments on every change, never incremented -- an increment drifts the moment a
  payment is deleted, and the drift still looks like money.
- Invoice: PDF via WeasyPrint, rendered on demand from the frozen snapshot. Only
  the number is stored, in one platform-wide series (unlike the shop's per-club
  order numbers), and re-issuing returns the existing one rather than burning a
  number -- a gap in an invoice series is a question you don't want to answer.
  WeasyPrint is imported lazily: it binds to native pango/cairo, and the app, the
  tests and every other page must still run on a machine without them.
- archive_overdue_clubs reports by default and archives only with --commit. That
  asymmetry is deliberate: this switches off paying customers, so a bad clock or a
  cron misconfiguration should cost an email, not a morning of angry clubs. A club
  with auto_archive off is spared entirely.

Renewal continues from the last period end, not from the payment date: a club that
pays two months late has still used those two months.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 01:45:15 +02:00

58 lines
1.6 KiB
TOML

[project]
name = "rosterchief"
version = "0.1.0"
requires-python = ">=3.14"
dependencies = [
"dj-database-url>=3.1.2",
"django>=6.0.6",
"django-allauth[mfa]>=65.18.0",
"django-lucide",
"django-phonenumber-field[phonenumbers]>=8.4.0",
"django-waffle>=5.0.0",
"pillow>=12.3.0",
"python-dateutil>=2.9.0.post0",
"python-decouple>=3.8",
"weasyprint>=69.0",
]
[dependency-groups]
dev = [
"coverage>=7.15.0",
"django-browser-reload>=1.21.0",
"ruff>=0.15.17",
]
[tool.ruff]
line-length = 250
target-version = "py314"
# Auto-generated migrations are not hand-maintained code.
extend-exclude = ["**/migrations/*"]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"DJ", # flake8-django
"RUF", # ruff-specific rules
]
ignore = [
"RUF012", # Django/Wagtail model attrs (panels, Meta.ordering, ...) are framework conventions, not mutable defaults to guard.
"RUF005", # Wagtail's `Page.content_panels + [...]` concatenation is the documented idiom.
]
[tool.ruff.lint.per-file-ignores]
# Settings legitimately use star imports and long generated values.
"rosterchief/settings/*" = ["F403", "F405", "E501"]
[tool.ruff.lint.isort]
known-first-party = [
"billing", "authentication", "club", "members", "teams", "events", "formbuilder", "shop", "controlpanel", "news", "pages", "home", "search", "rosterchief"]
[tool.uv.sources]
django-lucide = { git = "https://github.com/bsiebens/lucide" }