diff --git a/CHANGELOG.md b/CHANGELOG.md index d71559be..0a890124 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Added + +- `previousElapsedDurationSeconds` to `NewDraftSubmission` + ## [23.6.0] - 2025-12-04 ### Dependencies diff --git a/src/services/api/drafts.ts b/src/services/api/drafts.ts index bcb441a0..86edd8d4 100644 --- a/src/services/api/drafts.ts +++ b/src/services/api/drafts.ts @@ -41,6 +41,8 @@ async function uploadDraftData( title: draftSubmission.title, lastElementUpdated: draftSubmission.lastElementUpdated, sectionState: draftSubmission.sectionState, + previousElapsedDurationSeconds: + draftSubmission.previousElapsedDurationSeconds, onProgress, abortSignal, }) diff --git a/src/services/draft-data-store.ts b/src/services/draft-data-store.ts index 6ade9e5f..e8a92bda 100644 --- a/src/services/draft-data-store.ts +++ b/src/services/draft-data-store.ts @@ -166,5 +166,7 @@ export async function getDraftSubmission( createdAt: latestFormSubmissionDraftVersion.createdAt, formSubmissionDraftId: formSubmissionDraft.id, sectionState: s3SubmissionData.sectionState, + previousElapsedDurationSeconds: + s3SubmissionData.previousElapsedDurationSeconds, }) } diff --git a/src/types/submissions.ts b/src/types/submissions.ts index 7c497613..724f0c89 100644 --- a/src/types/submissions.ts +++ b/src/types/submissions.ts @@ -25,6 +25,11 @@ export type NewDraftSubmission = BaseNewFormSubmission & { lastElementUpdated?: FormElement /** The state of sections before the draft was saved */ sectionState?: SubmissionTypes.NewS3SubmissionData['sectionState'] + /** + * The elapsed duration in seconds the user took to complete the submission + * before the draft was saved + */ + previousElapsedDurationSeconds?: SubmissionTypes.NewS3SubmissionData['previousElapsedDurationSeconds'] } export type NewFormSubmission = BaseNewFormSubmission & {