Some checks failed
Adds the backend half of the Android tablet rollout. Merchants can
pair tablets to specific stores from /merchants/loyalty/devices (or
admins can pair on behalf from the merchant detail page). Each
pairing issues a long-lived JWT shown ONCE in the response with a
server-rendered QR PNG containing {api_url, store_code, auth_token} —
the tablet scans it on first boot and persists the three fields.
The store API (/api/v1/store/loyalty/*) now accepts these device JWTs
alongside user JWTs. Revoking a device row immediately rejects its
token (401 TERMINAL_DEVICE_REVOKED). Tokens expire after 1 year;
re-pair to renew.
- Migration loyalty_010 + TerminalDevice model
- create_device_token / verify_device_token JWT helpers
- 5 endpoints x 2 portals (merchant + admin on-behalf)
- Bearer-auth wiring in app/api/deps.py
- Pages, shared list partial with one-time pairing-QR modal,
Alpine.js factories
- Locale strings (en authoritative; fr/de/lb seeded with EN copy
for translation)
- 6 integration tests covering pair, list, revoke, idempotency,
cross-merchant rejection, store-API auth via device JWT
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
63 lines
1.1 KiB
Plaintext
63 lines
1.1 KiB
Plaintext
# requirements.txt - Python 3.13.5 compatible
|
|
# Core FastAPI and web framework
|
|
starlette==0.41.3
|
|
fastapi==0.115.5
|
|
uvicorn[standard]==0.32.1
|
|
pydantic==2.10.3
|
|
pydantic-settings==2.6.1
|
|
pydantic[email]==2.10.3
|
|
|
|
# Database
|
|
sqlalchemy==2.0.36
|
|
psycopg2-binary==2.9.10
|
|
alembic==1.14.0
|
|
|
|
# Authentication and Security
|
|
python-jose[cryptography]==3.3.0
|
|
passlib[bcrypt]==1.7.4
|
|
bcrypt==4.0.1 # Changed from 4.2.1 for Python 3.13.5 compatibility
|
|
python-multipart==0.0.20
|
|
|
|
# Data processing
|
|
pandas==2.2.3
|
|
requests==2.32.3
|
|
beautifulsoup4==4.14.3
|
|
|
|
# Image processing
|
|
Pillow>=10.0.0
|
|
qrcode>=7.4.0
|
|
|
|
# System monitoring
|
|
psutil>=5.9.0
|
|
|
|
# PDF generation
|
|
weasyprint==62.3
|
|
|
|
# Templating
|
|
Jinja2>=3.1.0
|
|
|
|
# Environment and configuration
|
|
python-dotenv==1.0.1
|
|
|
|
# Payment processing
|
|
stripe>=7.0.0
|
|
|
|
# Task queue (Celery with Redis)
|
|
celery[redis]==5.3.6
|
|
redis==5.0.1
|
|
kombu==5.3.4
|
|
flower==2.0.1
|
|
|
|
# Error tracking
|
|
sentry-sdk[fastapi]>=2.0.0
|
|
|
|
# Prometheus metrics
|
|
prometheus_client>=0.20.0
|
|
|
|
# Cloud storage (S3-compatible - Cloudflare R2)
|
|
boto3>=1.34.0
|
|
|
|
# Google Wallet integration (loyalty passes)
|
|
google-auth>=2.0.0
|
|
PyJWT>=2.0.0
|