import sqlite3

# Ruta a la base de datos
DB_PATH = r'C:\Users\ensan\OneDrive\Documentos\EnginyeriaInformatica-UB\TFG\GITHUB\TFG\tfg_db.sqlite'
SERVICE_ID = "a7e56fd4032b4af5be23af3721bd511f"  # Cambia por el id que quieras comprobar
account_id = "1bb294c1e93948caa18c5b81dda7e7e4"
conn = sqlite3.connect(DB_PATH)
cur = conn.cursor()

# Mostrar el account_id del servicio
cur.execute("SELECT id, account_id, type, name FROM service WHERE id = ?", (SERVICE_ID,))
row = cur.fetchone()
if row:
    print(f"Service ID: {row[0]}")
    print(f"Service account_id: {row[1]}")
    print(f"Service type: {row[2]}")
    print(f"Service name: {row[3]}")
else:
    print("No se encontró el servicio con ese ID.")

# Mostrar todos los usuarios
print("\nUsuarios en la base de datos:")
cur.execute("SELECT id, username FROM account")
for user in cur.fetchall():
    print(f"- {user[1]} (id: {user[0]})")
    
print("\nServicios en la base de datos:")
cur.execute("SELECT id, name FROM service WHERE type = 'CATERING'")
for service in cur.fetchall():
    print(f"- {service[1]} (id: {service[0]})") 
conn.close()
