Skip to content

Consolidate isValidGuid() functions in SID - #1760

Open
BurningAXE wants to merge 2 commits into
feature/cosync+mfidfrom
MS-1519-consolidate-isValidGuid
Open

Consolidate isValidGuid() functions in SID#1760
BurningAXE wants to merge 2 commits into
feature/cosync+mfidfrom
MS-1519-consolidate-isValidGuid

Conversation

@BurningAXE

@BurningAXE BurningAXE commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

JIRA ticket
Will be released in: 2026.3.0

Notable changes

  • Drops the String-based validator and keeps the REGEX one to be consistent with BFSID

Testing guidance

  • Everything should work as before (famous last words!)

Additional work checklist

  • Effect on other features and security has been considered
  • Design document marked as "In development" (if applicable)
  • External (Gitbook) and internal (Confluence) Documentation is up to date (or ticket created)
  • Test cases in Testiny are up to date (or ticket created)
  • Other teams notified about the changes (if applicable)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 the core.tools.extentions implementation and updating imports/call sites to core.tools.utils.
  • Adds subjectActions: String? to ActionResponse.ConfirmActionResponse and 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.

@BurningAXE
BurningAXE changed the base branch from main to feature/cosync+mfid July 28, 2026 16:20
@BurningAXE
BurningAXE marked this pull request as ready for review July 28, 2026 16:22
@BurningAXE
BurningAXE requested review from a team, TristramN, alex-vt, alexandr-simprints, luhmirin-s, meladRaouf and ybourgery and removed request for a team July 28, 2026 16:23
@sonarqubecloud

Copy link
Copy Markdown

@BurningAXE
BurningAXE force-pushed the feature/cosync+mfid branch from 2ab2952 to ee13130 Compare July 28, 2026 16:41
@alexandr-simprints

Copy link
Copy Markdown
Contributor

Is it necessary to include the entire #1759 in this PR?

@BurningAXE

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants