Repository navigation
CHI-4039: Extract post survey helpers (1/5) - #4855
Merged
Merged
Conversation
This was referenced Nov 11, 2026
gpaoloni
requested review from
stephenhand
and
a balanced review from Copilot
November 13, 2026 20:48
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the refactor extracting shared survey-answer and control-task helpers.
No open issues 🎉
What changed in this PR
This refactor prepares the account-scoped lambdas for partial post-survey saving in CHI-4039. It extracts reusable helpers while preserving the existing end-of-survey save behavior and one-hour control-task lifetime.
Changes:
- Extract survey-answer formatting and its data type into a shared module.
- Centralize survey control-task attributes and lifetime, and update existing callers.
- Add unit tests for answer formatting and control-task attributes.
| File | Description |
|---|---|
lambdas/account-scoped/tests/unit/postSurvey/postSurveyData.test.ts |
Tests answer mapping, missing answers, and unconfigured questions. |
lambdas/account-scoped/tests/unit/postSurvey/postSurveyControlTask.test.ts |
Tests contact linkage and language attributes. |
lambdas/account-scoped/src/postSurvey/postSurveyData.ts |
Houses the extracted answer-formatting helper and data type. |
lambdas/account-scoped/src/postSurvey/postSurveyControlTask.ts |
Defines shared task attributes and the one-hour lifetime. |
lambdas/account-scoped/src/hrm/savePostSurvey.ts |
Imports the extracted answer-formatting helper. |
lambdas/account-scoped/src/channelCapture/postSurveyListener.ts |
Uses the shared control-task builder and lifetime constant. |
Review effort: Balanced
stephenhand
approved these changes
Nov 16, 2026
gpaoloni
force-pushed
the
gian_CHI-4039
branch
2 times, most recently
from
November 18, 2026 19:41
f0cbe71 to
2abcaca
Compare
…ilder Move buildDataObject into a postSurvey module and share the post survey control task attributes, so the upcoming partial post survey saving can reuse them. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gpaoloni
force-pushed
the
gian_CHI-4039
branch
from
November 19, 2026 15:37
2abcaca to
291db3d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Stacked PRs for CHI-4039 (save partial post-survey answers). Review and merge in order:
First step towards saving partial post-survey answers (CHI-4039). Refactor only, no behaviour change.
buildDataObject/PostSurveyDatafromhrm/savePostSurvey.tsinto a newpostSurvey/postSurveyData.ts, so the new per-answer recording (next PR) can use it, and the old save endpoint can later be deleted without touching it.postSurvey/postSurveyControlTask.ts, so chat and voice post surveys create identical control tasks.Checklist
Other Related Issues
None
Verification steps
npm run test:unitinlambdas/.AFTER YOU MERGE
You are responsible for ensuring the above steps are completed. If you move a ticket into QA without advising what version to test, the QA team will assume the latest tag has the changes. If it does not, the following confusion is on you! :-P
🤖 Generated with Claude Code