Fix/veteran callback staged capture#48
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ce5ef4a70a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (isPartialPhoneOnly(text)) return false; | ||
| if (hasVeteranCallbackTimeHint(text)) return true; | ||
| if (text.replace(/\D/g, "").length >= 7) return false; | ||
| if (isLikelyNameOnlyVeteranCallback(text)) return false; |
There was a problem hiding this comment.
Accept free-form callback windows
In the veteran callback time step, this check rejects nearly any alphabetic phrase that lacks one of the hard-coded time keywords, because validateNameInput accepts any non-empty sanitized string up to 50 characters. As a result, natural callback windows like “when someone is available” or “at your convenience” are treated as names, so isValidVeteranCallbackTime reprompts and can fall back with missing details instead of creating the callback, even though the final >= 3 word fallback appears intended to accept these responses.
Useful? React with 👍 / 👎.
🚀 VetCan Pull Request
Summary
Implemented in
5a39343.The veteran callback branch now uses staged capture instead of relying on one long utterance. If name and phone are already known from the new-patient path, the flow asks only for the best callback time and references the known phone ending. Missing name/phone paths are captured one field at a time. Short acknowledgements like “yes” no longer complete the callback-time step.
Validation:
npm run buildpassedgit diff --checkpassed with line-ending warnings onlyNo Press 2, Press 3, Press 4, reschedule, cancellation, payment, Acuity mutation, Renewal TELE pricing, or veteran eligibility behavior was widened.