Skip to content

Conversation

@pankaj-pant
Copy link
Contributor

@pankaj-pant pankaj-pant commented Dec 11, 2025

Description

Addresses issues with usage of alpha print button in offline mode (printing certificate before declaration has been registered by registrar)

  • OCRVS-11027: allow parsing tmp-id when print button is used in offline declaration
  • OCRVS-10933: pass declaration data and metadata to certificates while printing offline before registration has occurred

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

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?".

*/
export const DECLARATION_ACTION_UPDATE = 'UPDATE' as const
type DECLARATION_ACTION_UPDATE = typeof DECLARATION_ACTION_UPDATE
const PRINT_DECLARATION_ACTION = 'DECLARE' as const
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In getCurrentEventState:
Declarations are aggregated for all actions except:

// Action types that are not taken into the aggregate values
const EXCLUDED_ACTIONS = [
  ActionType.REQUEST_CORRECTION,
  ActionType.PRINT_CERTIFICATE,
  ActionType.REJECT_CORRECTION
]

And metadata for the following actions:

const updateActions = ActionTypes.extract([
  ActionType.CREATE,
  ActionType.NOTIFY,
  ActionType.DECLARE,
  ActionType.VALIDATE,
  ActionType.REGISTER,
  ActionType.REJECT,
  ActionType.ARCHIVE,
  ActionType.PRINT_CERTIFICATE,
  ActionType.REQUEST_CORRECTION
])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using existing ActionDocument such as DECLARE also allows to resolve the optimistic action sent by the alpha print button, and helps with parsing location names in the certificates

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No changes required in certs.
Can access metadata like this: $lookup $metadata 'updatedAtLocation.province'
and declarations like: $lookup $declaration 'mother.occupation'

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.

AlphaPrintButton cannot parse tmp-id when offline AlphaPrintButton metadata gets filtered out in offline print mode

2 participants