diff --git a/servicem8_inspector.py b/servicem8_inspector.py index e9e4aa5..0dc5214 100644 --- a/servicem8_inspector.py +++ b/servicem8_inspector.py @@ -11,7 +11,7 @@ from fastapi.responses import HTMLResponse DB_PATH = os.getenv("WEBHOOK_DB_PATH", "./servicem8_webhooks.db") STATE_DB_PATH = os.getenv("WEBHOOK_STATE_DB_PATH", "./servicem8_quote_materials_state.db") -APP_HOST = os.getenv("WEBHOOK_INSPECTOR_HOST", "127.0.0.1") +APP_HOST = os.getenv("WEBHOOK_INSPECTOR_HOST", "0.0.0.0") APP_PORT = int(os.getenv("WEBHOOK_INSPECTOR_PORT", "18355")) PAGE_SIZE = 50 diff --git a/servicem8_quote_template_parser.py b/servicem8_quote_template_parser.py index 928016e..9c3826e 100644 --- a/servicem8_quote_template_parser.py +++ b/servicem8_quote_template_parser.py @@ -145,6 +145,7 @@ def build_job_material_line( def parse_quote_template_field_rows(field_rows: List[Dict[str, Any]]) -> Dict[str, Any]: ordered = sorted(field_rows, key=sort_key) description = "" + author_name = "" include_items: List[Dict[str, Any]] = [] exclude_items: List[Dict[str, Any]] = [] extra_include_items: List[Dict[str, Any]] = [] @@ -161,6 +162,10 @@ def parse_quote_template_field_rows(field_rows: List[Dict[str, Any]]) -> Dict[st description = response continue + if question == "Name": + author_name = response + continue + if question.startswith("Item ") and response: include_items.append( { @@ -253,6 +258,7 @@ def parse_quote_template_field_rows(field_rows: List[Dict[str, Any]]) -> Dict[st return { "description": description, + "author_name": author_name, "include_items": include_items, "extra_include_items": extra_include_items, "exclude_items": exclude_items, diff --git a/servicem8_webhook_receiver.py b/servicem8_webhook_receiver.py index 09677b4..35d5bf7 100755 --- a/servicem8_webhook_receiver.py +++ b/servicem8_webhook_receiver.py @@ -170,6 +170,7 @@ def queue_quote_template_jobmaterials(payload, received_at: str): "form_uuid": form_uuid, "form_response_uuid": parsed.get("form_response_uuid", ""), "job_uuid": parsed.get("job_uuid", ""), + "author_name": parsed.get("author_name", ""), "description": parsed.get("description", ""), "desired_job_materials": parsed.get("desired_job_materials", []), }