import requests

API_URL = "http://127.0.0.1:8000"
WAITERS = ["Jan", "Pol", "Martina", "Sandra", "Dani", "Aladid", "Ivet"]

for name in WAITERS:
    data = {
        "name": name,
        "load": 0,
        "role": "barra"
    }
    resp = requests.post(f"{API_URL}/waiters/", json=data)
    if resp.status_code == 200 or resp.status_code == 201:
        print(f"Camarero creado: {name}")
    elif resp.status_code == 400 and "already exists" in resp.text:
        print(f"Camarero ya existía: {name}")
    else:
        print(f"Error creando camarero {name}: {resp.status_code} {resp.text}")
