Skip to content

feat(#10240): allow limit_count_to_goal in target configuration schema#800

Open
cliftonmcintosh wants to merge 2 commits intomedic:mainfrom
cliftonmcintosh:feat/10240-hide-target-counts-past-goal
Open

feat(#10240): allow limit_count_to_goal in target configuration schema#800
cliftonmcintosh wants to merge 2 commits intomedic:mainfrom
cliftonmcintosh:feat/10240-hide-target-counts-past-goal

Conversation

@cliftonmcintosh
Copy link
Copy Markdown

Add limit_count_to_goal as an optional boolean field to the Joi schema for declarative targets, matching the new field added in cht-core that caps the displayed count at the goal value.

Description

Adds limit_count_to_goal as an optional boolean field to the declarative target Joi validation schema, and includes it in the compiled target output.

This is a companion to medic/cht-core#10772, which introduces the limit_count_to_goal field to cht-core. The underlying issue is tracked in cht-core as medic/cht-core#10240.

Code review items

  • Readable: Concise, well named, follows the style guide, documented if necessary.
  • Documented: Configuration and user documentation on cht-docs
  • Tested: Unit and/or integration tests where appropriate
  • Backwards compatible: Works with existing data and configuration. Any breaking changes documented in the release notes.

AI Disclosure

Claude Code was used to locate the correct place in the schema, add the field, and run the test suite to verify nothing was broken.

License

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

cliftonmcintosh and others added 2 commits March 31, 2026 14:12
Add limit_count_to_goal as an optional boolean field to the Joi schema
for declarative targets, matching the new field added in cht-core that
caps the displayed count at the goal value.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cliftonmcintosh cliftonmcintosh changed the title fix(#10240): allow limit_count_to_goal in target configuration schema feat(#10240): allow limit_count_to_goal in target configuration schema Mar 31, 2026
@cliftonmcintosh
Copy link
Copy Markdown
Author

@dianabarsan

This is to go with medic/cht-core#10772

.optional()
.error(targetError('idType should be either "report" or "contact" or "function(contact, report)"')),
aggregate: joi.boolean().optional(),
limit_count_to_goal: joi.boolean().optional(),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this property name is quite verbose. I would rather keep it shorter like limit_count or max_count, but this is not very important.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants