fix(erpnext): serialize filters/fields as JSON in REST client; add mandatory appointment fields
This commit is contained in:
@@ -84,12 +84,13 @@ class ERPNextClient:
|
|||||||
"limit_start": limit_start,
|
"limit_start": limit_start,
|
||||||
"order_by": order_by,
|
"order_by": order_by,
|
||||||
}
|
}
|
||||||
|
import json
|
||||||
if filters:
|
if filters:
|
||||||
params["filters"] = str(filters)
|
params["filters"] = json.dumps(filters)
|
||||||
if or_filters:
|
if or_filters:
|
||||||
params["or_filters"] = str(or_filters)
|
params["or_filters"] = json.dumps(or_filters)
|
||||||
if fields:
|
if fields:
|
||||||
params["fields"] = str(fields)
|
params["fields"] = json.dumps(fields)
|
||||||
|
|
||||||
response = await self.client.get(
|
response = await self.client.get(
|
||||||
f"/api/resource/{doctype}",
|
f"/api/resource/{doctype}",
|
||||||
|
|||||||
@@ -208,7 +208,9 @@ class ERPNextHealthcare:
|
|||||||
appointment_date: str,
|
appointment_date: str,
|
||||||
appointment_time: str,
|
appointment_time: str,
|
||||||
duration: int = 30,
|
duration: int = 30,
|
||||||
department: str = "Dermatología Estética",
|
department: str = "Dermatology",
|
||||||
|
appointment_type: str = "Consulta General",
|
||||||
|
appointment_for: str = "Practitioner",
|
||||||
notes: str = "",
|
notes: str = "",
|
||||||
service_unit: str | None = None,
|
service_unit: str | None = None,
|
||||||
) -> dict[str, Any]:
|
) -> dict[str, Any]:
|
||||||
@@ -265,6 +267,8 @@ class ERPNextHealthcare:
|
|||||||
"appointment_time": appointment_time,
|
"appointment_time": appointment_time,
|
||||||
"duration": duration,
|
"duration": duration,
|
||||||
"department": department,
|
"department": department,
|
||||||
|
"appointment_type": appointment_type,
|
||||||
|
"appointment_for": appointment_for,
|
||||||
"notes": notes,
|
"notes": notes,
|
||||||
"status": "Scheduled",
|
"status": "Scheduled",
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user