Skip to content

Remove explicit ActionProcedure type#12548

Draft
cibelius wants to merge 5 commits intodevelopfrom
remove-actionprocedure-type
Draft

Remove explicit ActionProcedure type#12548
cibelius wants to merge 5 commits intodevelopfrom
remove-actionprocedure-type

Conversation

@cibelius
Copy link
Copy Markdown
Contributor

@cibelius cibelius commented May 7, 2026

Description

This improves types:

Screenshot 2026-05-07 at 9 26 32

Checklist

  • I have linked the correct Github issue under "Development"
  • I have tested the changes locally, and written appropriate tests
  • I have tested beyond the happy path (e.g. edge cases, failure paths)
  • I have updated the changelog with this change (if applicable)
  • I have updated the GitHub issue status accordingly

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Oops! Looks like you forgot to update the changelog. When updating CHANGELOG.md, please consider the following:

  • Changelog is read by country implementors who might not always be familiar with all technical details of OpenCRVS. Keep language high-level, user friendly and avoid technical references to internals.
  • Answer "What's new?", "Why was the change made?" and "Why should I care?" for each change.
  • If it's a breaking change, include a migration guide answering "What do I need to do to upgrade?".

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

ℹ️ Coverage metrics explained:
Statements — Executed code statements (basic logic lines)
Branches — Tested decision paths (if/else, switch, ternaries)
Functions — Functions invoked during tests
Lines — Source lines executed

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

📊 commons test coverage

Statements: 75.48%
Branches:   39.88%
Functions:  56.85%
Lines:      75.05%
Updated at: Thu, 07 May 2026 07:12:19 GMT

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

📊 events test coverage

Statements: 86.96%
Branches:   84.94%
Functions:  92.08%
Lines:      86.96%
Updated at: Thu, 07 May 2026 07:21:34 GMT

@Zangetsu101
Copy link
Copy Markdown
Contributor

Zangetsu101 commented May 7, 2026

Most likely the inferred type is the same as the one we were using but with an extra cost in inference

@cibelius cibelius changed the title remove explicit actionprocedure type Remove explicit ActionProcedure type May 7, 2026
@cibelius
Copy link
Copy Markdown
Contributor Author

cibelius commented May 7, 2026

This brings a small type improvement:

Previously this wasnt giving a type error:
Screenshot 2026-05-07 at 9 46 14

After this change we see that registrationNumber is not allowed when type: 'DECLARE':

Screenshot 2026-05-07 at 9 47 19

@Zangetsu101
Copy link
Copy Markdown
Contributor

Zangetsu101 commented May 7, 2026

and if I don't provide "type" (which we don't usually and I'm doing a "register" action but providing "DECLARE" as type? that's a red flag right there which typescript should have stopped ideally 😅 ) rather call declare action with registration number?

@cibelius
Copy link
Copy Markdown
Contributor Author

cibelius commented May 7, 2026

and if I don't provide "type" (which we don't usually and I'm doing a "register" action but providing "DECLARE" as type? that's a red flag right there which typescript should have stopped ideally 😅 ) rather call declare action with registration number?

Yep it doesnt fix that issue unfortunately, I agree that this isnt great

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