Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Grand calculated summary as a value source #216

Merged
merged 13 commits into from
Oct 10, 2023

Conversation

katie-gardner
Copy link
Contributor

@katie-gardner katie-gardner commented Sep 26, 2023

What is the context of this PR?

This PR adds support for using Grand Calculated Summaries as value sources. Similar to calculated summaries this is done with a value source of the form

{
   source: "grand_calculated_summary",
   identifier: "grand-calculated-summary-block-id"
}

grand_calculated_summary has been added as a valid value source, and validation has been added to ensure that any such value source is a valid grand calculated summary id. It corrects an existing issue in which a calculated summary value source would be marked as valid if there are no calculated summaries in the schema.

Some minor refactoring was done alongside supporting the GCS value source as multiple places were using the same approach to get answer ids relevant to a value sources.

Due to the need for checking this is valid within a repeating section this PR sits on top of the PR for grand-calculated-summary-repeating-sections It will only be merged in after the other PR.

The corresponding runner PR makes use of this

Note

Made the PR for merge into main so that the test suite would run and pass and have now pointed it at GCS-repeating-sections for ease of review, will point it back to main before merge

How to review

Check that the updated schemas cover grand calculated summary value sources in repeats/outside repeats/ piping/ logic and that the updates to the schema json are correct. Ensure only valid grand calculated summary ids can be used in value sources.

Checklist

  • eq-translations updated to support any new schema keys which need translation

@katie-gardner katie-gardner added do-not-merge Enhancement New feature or request labels Sep 26, 2023
@katie-gardner katie-gardner changed the base branch from main to grand-calculated-summary-repeating-sections September 26, 2023 10:14
@katie-gardner
Copy link
Contributor Author

Base automatically changed from grand-calculated-summary-repeating-sections to main October 4, 2023 16:05
app/validators/questionnaire_schema.py Outdated Show resolved Hide resolved
app/validators/questionnaire_schema.py Outdated Show resolved Hide resolved
schemas/value_sources.json Outdated Show resolved Hide resolved
@katie-gardner katie-gardner merged commit 5ad5a21 into main Oct 10, 2023
3 checks passed
@katie-gardner katie-gardner deleted the grand-calculated-summary-value-source branch October 10, 2023 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants