Skip to content

Chore: regenerate generated types v2 - #988

Open
Chisomchima wants to merge 17 commits into
masterfrom
chore/regenerate-generated-types-v2
Open

Chisomchima wants to merge 17 commits into
masterfrom
chore/regenerate-generated-types-v2

Conversation

@Chisomchima

@Chisomchima Chisomchima commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

Regenerates src/types/generated/models.ts from play.im.dhis2.org/dev with ?expandedRefs=true

@netlify

netlify Bot commented Jul 8, 2026

Copy link
Copy Markdown

Deploy Preview for dhis2-maintenance-app-beta ready!

Name Link
🔨 Latest commit 0b1d985
🔍 Latest deploy log https://app.netlify.com/projects/dhis2-maintenance-app-beta/deploys/6a99043248b086000891569e
😎 Deploy Preview https://deploy-preview-988.maintenance-app-beta.netlify.dhis2.org
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Reverts 81e8c55, unrelated to the type regeneration work on this branch.
@Chisomchima
Chisomchima requested a review from tomzemp July 8, 2026 10:44
@sonarqubecloud

Copy link
Copy Markdown

@tomzemp tomzemp left a comment

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.

Looks great @Chisomchima! Thanks for going through all these updates! I have a couple small questions I've left in comments.

Additionally, my more major question / observation is that a lot of these changes seem to update the type definitions to point to newly created types. That makes sense, but the existing references we had already point to those updated types.

e.g.
we replace Attribute.valueType with ValueType (which I assume is new). But looking at the type definition for Attribute, Attribute.valueType already points to the ValueType type.

I'm not sure it's worth it to point directly to the types if our existing definition will already point to them indirectly 🤔. I feel like Attribute.valueType is more readable, so I'd be happy to keep that (and similar) unless there's some limitation. Thoughts?

Comment thread src/components/sectionList/SectionListWrapper.tsx Outdated
Comment thread src/lib/form/useOnSubmit.ts
Comment thread src/pages/dataSets/form/dataInputPeriods/DataInputPeriodsSelector.tsx Outdated
Comment thread src/pages/dataSets/form/dataSetFormSchema.ts Outdated
Comment thread src/pages/programDisaggregations/form/CategoriesSelector.tsx Outdated
Comment thread src/pages/validationNotificationTemplates/Clone.tsx Outdated
Comment thread src/types/fixedModels.ts Outdated
The generated required flag comes from dhis2-open-api-ts' setPropertiesRequired
transformer, not the OpenAPI spec (confirmed with Jan Bernitt). The API accepts a
period entry with only a period reference, so revert the form to allow that.
- CurrentUser.avatar and DataInputPeriod dates: optional per spec (setPropertiesRequired
  artifact); removes the avatar test hacks
- keySmsSetting: restore real SmsConfiguration shape (Configuration was the wrong type)
- SharingSettings.external optional (not in spec); removes the SharingSettings casts
- revert unrelated Prettify drift in utility.ts
- useOnSubmitEditWithGroups: constrain to ModelWithAttributeValues, drop double-cast
- trim over-verbose comments
Reverted 9 files to master and reduced 1 spec file to the enum rename only.
Verified each is unnecessary: tsc --noEmit and the full suite pass with these at
master. The generated types resolve fine without the extra hand-types/casts:
- DataSetSectionForm, CategoriesSelector, EditTrackerProgram,
  EnrollmentDataFormContents: PickWithFieldFilters resolves these
- NextScheduleDateField, relationshipTypes/TrackedEntityAttributesField: casts
  not needed
- validationNotificationTemplates Clone/New: rename churn
- programIndicators/Form.spec, dataSetNotificationTemplates/Form.spec: keep only
  the forced enum rename
Fresh regen from play.im.dhis2.org/dev?expandedRefs=true. Diff vs the previous
regen is spec drift since 2026-07: favorite/favorites removed from identifiable
objects, ErrorCode gained members, new EventDataValue/UserSessionInfo types,
Event/TrackedEntity label fields. The two documented hand-corrections
(DataInputPeriod dates, CurrentUser.avatar -> optional) are re-applied.
0 tsc errors, full suite green.
@Chisomchima
Chisomchima requested a review from tomzemp August 31, 2026 17:49
@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

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