Refs #9 ## Summary - add a worker-side renewal invoice sweep that creates one invoice 72 hours before subscription expiry - expire elapsed pending invoices automatically and email users when an automatic renewal invoice is created - stop auto-recreating invoices for the same paid cycle once any invoice already exists for that cycle - document the current renewal-invoice and pending-invoice expiry behavior ## Testing - built `infra/docker/web.Dockerfile` - ran `pnpm --filter @nproxy/db test` inside the built container - verified `@nproxy/db build` and `@nproxy/web build` during the image build - built `infra/docker/worker.Dockerfile` Co-authored-by: sirily <sirily@git.shararam.party> Reviewed-on: #20
packages/db
Database package for nproxy.
Implemented in this iteration
- Prisma package scaffold
- Current Prisma schema for persisted state
- Shared schema path export for runtime tooling
Current scope
- Users and subscription state
- Manual crypto invoices
- Generation requests and provider-key attempts
- Usage ledger
- Provider keys, optional proxies, and auditable state events
- Telegram pairing and admin allowlist
- Admin audit log