Move HR-related tools to their own folder, add print statement for BookPTO functionality, and add SILLY_MODE

This commit is contained in:
Laine
2025-03-14 10:20:11 -04:00
parent ece3ac1d3c
commit 5f8f81a15d
6 changed files with 30 additions and 10 deletions

26
tools/hr/current_pto.py Normal file
View File

@@ -0,0 +1,26 @@
from pathlib import Path
import json
def current_pto(args: dict) -> dict:
email = args.get("email")
file_path = Path(__file__).resolve().parent.parent / "data" / "employee_pto_data.json"
if not file_path.exists():
return {"error": "Data file not found."}
data = json.load(open(file_path))
employee_list = data["theCompany"]["employees"]
for employee in employee_list:
if employee["email"] == email:
num_hours = int(employee["currentPTOHrs"])
num_days = float(num_hours/8)
return {
"num_hours": num_hours,
"num_days": num_days,
}
return_msg = "Employee not found with email address " + email
return {"error": return_msg}