import requests

# Assuming local dev server is on port 8000
BASE_URL = "http://127.0.0.1:8000"

# First, log in as admin to get token
resp = requests.post(f"{BASE_URL}/api/auth/login/", json={
    "email": "employee@example.com",
    "password": "password123"
})
if resp.status_code == 200:
    token = resp.json().get('access')
    headers = {"Authorization": f"Bearer {token}"}
    
    print("Testing /api/hr/attendance/?month=6")
    r1 = requests.get(f"{BASE_URL}/api/hr/attendance/?month=6", headers=headers)
    print(r1.status_code, r1.text[:200])
    
    print("\nTesting /api/hr/attendance-exceptions/?status=PENDING")
    r2 = requests.get(f"{BASE_URL}/api/hr/attendance-exceptions/?status=PENDING", headers=headers)
    print(r2.status_code, r2.text[:200])
    
    print("\nTesting /api/hr/attendance/qr-scan-stats/")
    r3 = requests.get(f"{BASE_URL}/api/hr/attendance/qr-scan-stats/", headers=headers)
    print(r3.status_code, r3.text[:200])
else:
    print("Login failed!", resp.status_code, resp.text)
