Consolidate isValidGuid() functions in SID - #1760
Conversation
There was a problem hiding this comment.
Pull request overview
This PR removes the duplicate isValidGuid() String extension and standardizes callers on the existing core.tools.utils implementation, while also extending the confirm-flow response contract to optionally include CoSync subjectActions and mapping that payload through the client API response mappers.
Changes:
- Consolidates
isValidGuid()usage by deleting thecore.tools.extentionsimplementation and updating imports/call sites tocore.tools.utils. - Adds
subjectActions: String?toActionResponse.ConfirmActionResponseand threads this through CommCare/LibSimprints response mappers (with test coverage updates). - Updates
ClientApiViewModel.handleConfirmResponse()to optionally generate CoSync enrolment-record creation payload on confirm responses.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| infra/orchestrator-data/src/main/java/com/simprints/infra/orchestration/data/ActionResponse.kt | Extends ConfirmActionResponse to carry optional subjectActions payload. |
| infra/core/src/test/java/com/simprints/core/tools/utils/StringUtilsTest.kt | Adds broader unit coverage for the canonical isValidGuid() + randomUUID(). |
| infra/core/src/test/java/com/simprints/core/tools/extentions/StringExtTest.kt | Removes test tied to the deleted duplicate extension implementation. |
| infra/core/src/main/java/com/simprints/core/tools/extentions/String.ext.kt | Deletes the duplicate isValidGuid() extension implementation. |
| feature/select-subject/src/main/java/com/simprints/feature/selectsubject/screen/SelectSubjectViewModel.kt | Switches isValidGuid() import to the consolidated utils location. |
| feature/external-credential/src/main/java/com/simprints/feature/externalcredential/usecase/ResetExternalCredentialsInSessionUseCase.kt | Switches isValidGuid() import to the consolidated utils location. |
| feature/client-api/src/main/java/com/simprints/feature/clientapi/ClientApiViewModel.kt | Generates optional CoSync subjectActions for confirm responses. |
| feature/client-api/src/main/java/com/simprints/feature/clientapi/mappers/response/LibSimprintsResponseMapper.kt | Appends CoSync data for confirm (and enrol) response bundles. |
| feature/client-api/src/main/java/com/simprints/feature/clientapi/mappers/response/CommCareResponseMapper.kt | Appends CoSync data for confirm (and enrol) CommCare bundles. |
| feature/client-api/src/test/java/com/simprints/feature/clientapi/mappers/response/OdkResponseMapperTest.kt | Updates confirm response construction for new subjectActions param. |
| feature/client-api/src/test/java/com/simprints/feature/clientapi/mappers/response/LibSimprintsResponseMapperTest.kt | Adds/updates tests to verify CoSync mapping for confirm responses. |
| feature/client-api/src/test/java/com/simprints/feature/clientapi/mappers/response/CommCareResponseMapperTest.kt | Adds/updates tests to verify CoSync mapping for confirm responses. |
| feature/client-api/src/test/java/com/simprints/feature/clientapi/mappers/response/ActionToIntentMapperTest.kt | Updates confirm response construction for new subjectActions param. |
| feature/client-api/src/test/java/com/simprints/feature/clientapi/ClientApiViewModelTest.kt | Updates confirm request helper and adds tests for CoSync generation conditions. |
|
2ab2952 to
ee13130
Compare
|
Is it necessary to include the entire #1759 in this PR? |
Nope. It builds on it's branch so points to that temporarily. Meanwhile I force-pushed a change to the source branch. Anyway, I'll sort it out and leave only the relevant commit here. |



JIRA ticket
Will be released in: 2026.3.0
Notable changes
Testing guidance
Additional work checklist