diff --git a/src/messaging/flow/default-flows/appointment-booking.json b/src/messaging/flow/default-flows/appointment-booking.json index 8ebabe9..fb91dbf 100644 --- a/src/messaging/flow/default-flows/appointment-booking.json +++ b/src/messaging/flow/default-flows/appointment-booking.json @@ -145,9 +145,16 @@ "type": "condition", "conditions": [ { "id": "c3", "variableId": "dateChoice", "operator": "contains", "value": "tomorrow" }, - { "id": "c4", "variableId": "dateChoice", "operator": "contains", "value": "day_after" } + { "id": "c4", "variableId": "dateChoice", "operator": "contains", "value": "day_after" }, + { "id": "c7", "variableId": "dateChoice", "operator": "contains", "value": "other" } ] - }, + } + ] + }, + { + "id": "g4t", + "title": "Date - Tomorrow", + "blocks": [ { "id": "b14", "type": "set_variable", @@ -170,6 +177,33 @@ } ] }, + { + "id": "g4c", + "title": "Date - Custom", + "blocks": [ + { + "id": "b15a", + "type": "message", + "content": { + "format": "text", + "text": "Please type your preferred date (e.g., April 25 or 25/04/2026)." + } + }, + { + "id": "b15b", + "type": "input", + "inputType": "text", + "variableId": "customDateText" + }, + { + "id": "b15c", + "type": "ai", + "prompt": "The patient typed this date: \"{{customDateText}}\". Convert it to YYYY-MM-DD format. The current year is 2026. Reply with ONLY the date in YYYY-MM-DD format, nothing else.", + "outputVariableId": "selectedDate", + "sendToPatient": false + } + ] + }, { "id": "g5", "title": "Slot Selection", @@ -316,10 +350,12 @@ { "id": "e2", "from": { "blockId": "b4", "conditionId": "c2" }, "to": { "groupId": "g10" } }, { "id": "e3", "from": { "blockId": "b7" }, "to": { "groupId": "g3" } }, { "id": "e4", "from": { "blockId": "b10" }, "to": { "groupId": "g4" } }, - { "id": "e5", "from": { "blockId": "b13", "conditionId": "c3" }, "to": { "groupId": "g5" } }, + { "id": "e5", "from": { "blockId": "b13", "conditionId": "c3" }, "to": { "groupId": "g4t" } }, { "id": "e6", "from": { "blockId": "b13", "conditionId": "c4" }, "to": { "groupId": "g4a" } }, + { "id": "e6a", "from": { "blockId": "b13", "conditionId": "c7" }, "to": { "groupId": "g4c" } }, { "id": "e7", "from": { "blockId": "b14" }, "to": { "groupId": "g5" } }, { "id": "e8", "from": { "blockId": "b15" }, "to": { "groupId": "g5" } }, + { "id": "e8a", "from": { "blockId": "b15c" }, "to": { "groupId": "g5" } }, { "id": "e9", "from": { "blockId": "b17a" }, "to": { "groupId": "g6" } }, { "id": "e10", "from": { "blockId": "b19" }, "to": { "groupId": "g7" } }, { "id": "e11", "from": { "blockId": "b22", "conditionId": "c5" }, "to": { "groupId": "g8" } },