Add /api/public/availability endpoint + bot stock-check instructions
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user