Skip to content

feat(#10548): add shared document type constants - #11499

Open
kumaranurag00748-byte wants to merge 4 commits into
medic:masterfrom
kumaranurag00748-byte:feat/10548-doc-type-constants
Open

kumaranurag00748-byte wants to merge 4 commits into
medic:masterfrom
kumaranurag00748-byte:feat/10548-doc-type-constants

Conversation

@kumaranurag00748-byte

@kumaranurag00748-byte kumaranurag00748-byte commented Oct 15, 2026 •

Copy link
Copy Markdown

Description

Adds shared DOC_TYPES constants for the following document types:

  • DOC_TYPES.TASK
  • DOC_TYPES.TARGET
  • DOC_TYPES.USER_SETTINGS

Replaces persisted document-type literals for task, target, and user-settings across API, webapp, rules-engine, datasource, and user-management code. This keeps document type values unchanged while removing duplicated magic strings.

Closes #10548

Code review checklist

  • UI/UX backwards compatible: Test it works for the new design (enabled by default). And test it works in the old design, enable can_view_old_navigation permission to see the old design. Test it has appropriate design for RTL languages.
  • Readable: Concise, well named, follows the style guide
  • Documented: Configuration and user documentation on cht-docs
  • Tested: Unit and/or e2e where appropriate
  • Internationalised: All user facing text
  • Backwards compatible: Existing persisted values remain unchanged; this change only replaces duplicated literals with shared constants.
  • AI disclosure: AI assistance was used to locate relevant usages, implement the constant replacements, and validate the changes.

Validation

  • Rules-engine tests: 224 passing
  • User-management tests: 178 passing
  • ESLint passed for all changed source files
  • Runtime verification confirmed:
    • DOC_TYPES.TASK === 'task'
    • DOC_TYPES.TARGET === 'target'
    • DOC_TYPES.USER_SETTINGS === 'user-settings'
  • git diff --check passed

Full CouchDB-backed integration tests were not run because Docker/CouchDB was unavailable in the local environment.

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

Replace persisted task, target, and user-settings document type literals with shared DOC_TYPES constants across application services.
Comment thread .github/workflows/build.yml Outdated
- name: Setup QEMU
if: ${{ env.INTERNAL_CONTRIBUTOR }}
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
uses: docker/setup-qemu-action@ce360397ddf832beb865e1373c09c0e9f86d70d # v4.0.0
Comment thread .github/workflows/build.yml Outdated
if: ${{ env.INTERNAL_CONTRIBUTOR }}
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@fa648b43de3d4d023bcb3f89ed6940096949c419 # v2.1.5
uses: aws-actions/amazon-ecr-login@fa648b43de3d4d023bcb3f89ed6949c419 # v2.1.5
Restore the authoritative full commit SHAs for the QEMU and Public ECR login actions.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add constants for 'task', 'target', and 'user-settings' document types

3 participants