OSM-Beiträge: Map-Button (dog=yes), Changeset-Upload, Confirm/Pro-Job

- Map-Popup: "Hund war willkommen"-Button (dog=yes) für Restaurant/Hotel/
  Shop/Tierarzt/Hundesalon → POST /osm-contrib/dog-friendly.
- OSM-Changeset-Upload (write_api): Element holen (node/way) → dog=yes →
  Changeset create/upload/close; idempotent; best-effort beim Tap.
- OSM-Endpunkte konfigurierbar (OSM_OAUTH_BASE/OSM_API_BASE) — Staging gegen
  Dev-Sandbox, KEINE echten Edits auf Produktiv-OSM.
- Scheduler-Job (täglich 03:40): Pending-Retry + Revert-Überleben (7 Tage) →
  confirmed/rejected; Pro-Freischaltung (100 confirmed = 1 Jahr, idempotent via
  osm_pro_grants). HINWEIS: is_premium/subscription direkt gesetzt — vor Prod
  mit Billing abgleichen.
- Native Attestierung/Sensoren: bewusst NICHT (iOS-App-Thema, nicht PWA).
This commit is contained in:
rene 2026-06-03 21:40:50 +02:00
parent dc9c0d2cc0
commit 57849515ea
10 changed files with 239 additions and 26 deletions

View file

@ -35,9 +35,15 @@ logger = logging.getLogger(__name__)
router = APIRouter()
# --- OSM-OAuth2-Endpunkte ---
OSM_AUTHORIZE = "https://www.openstreetmap.org/oauth2/authorize"
OSM_TOKEN = "https://www.openstreetmap.org/oauth2/token"
OSM_USER_API = "https://api.openstreetmap.org/api/0.6/user/details.json"
# Konfigurierbar, damit Staging gegen die Dev-Sandbox laufen kann (KEINE echten
# Edits auf der Produktiv-OSM!). Staging-.env:
# OSM_OAUTH_BASE=https://master.apis.dev.openstreetmap.org
# OSM_API_BASE=https://master.apis.dev.openstreetmap.org
OSM_OAUTH_BASE = os.getenv("OSM_OAUTH_BASE", "https://www.openstreetmap.org").rstrip("/")
OSM_API_BASE = os.getenv("OSM_API_BASE", "https://api.openstreetmap.org").rstrip("/")
OSM_AUTHORIZE = OSM_OAUTH_BASE + "/oauth2/authorize"
OSM_TOKEN = OSM_OAUTH_BASE + "/oauth2/token"
OSM_USER_API = OSM_API_BASE + "/api/0.6/user/details.json"
OSM_SCOPES = "read_prefs write_api"
CLIENT_ID = os.getenv("OSM_CLIENT_ID", "")