Add /api/public/availability endpoint + bot stock-check instructions

This commit is contained in:
2026-06-26 20:18:08 +01:00
parent e8f211663f
commit 2aba7ab813
2 changed files with 28 additions and 5 deletions
+10
View File
@@ -205,6 +205,16 @@ def public_pricing(db: Session = Depends(get_db)):
]
@app.get("/api/public/availability")
def public_availability(db: Session = Depends(get_db)):
"""Returns which tiers are in stock — no auth, super simple."""
services = db.query(Service).order_by(Service.sort_order).all()
return [
{"name": s.name, "available": s.active, "sell_price": s.sell_price}
for s in services
]
@app.get("/api/public/services/{service_id}")
def public_service_detail(service_id: int, db: Session = Depends(get_db)):
svc = db.query(Service).filter(Service.id == service_id, Service.active == True).first()