Skip to content

Draft API Integration – Creation of New Stage Before Quality Classifier #2198

@Varaniya201

Description

@Varaniya201

Title:

Enhance the Draft API Implementation by Introducing a New "Create Draft" Stage Before the Quality Classifier Stage

Description:

As a developer, I want to introduce a new “Create Draft” stage in the registration processing pipeline, placed before the Quality Classifier stage, so that the Draft API is created and updated earlier in the workflow. This change replaces the current dependency on the Packet Manager for demographic and biometric data retrieval, improves modularity, and aligns with the updated ID Repository workflow.

The new stage will handle Draft API creation and updates for NEW and UPDATE packets, ensuring data consistency and improving performance during downstream stage processing.

Acceptance Criteria

1. Create Draft API – New Stage Integration

  • A new stage called “create_draft” must be introduced in the registration processor workflow.

  • The create_draft stage should be positioned before the Quality Classifier stage for both NEW and UPDATEpackets.

  • The stage will handle the creation and updating of the Draft for each packet, containing both demographic and biometric data (excluding evidence files).

  • UIN allocation is mandatory during Draft creation.

  • If a Draft already exists for a given RID, it should be deleted and re-created.

  • Drafts must be discarded if the packet processing fails or is rejected.

  • In case of a reprocess, the Draft must remain active until the packet processing completes.

  • Once the UIN is successfully generated, the Draft must be published and then discarded.

2. Replacement of Packet Manager Calls

  • Post create_draft stage, subsequent stages like Demo Dedup, Bio Dedup, ABIS Handler, Manual Adjudication, and Verification must use the Draft API instead of the Packet Manager for data retrieval.

  • The Draft API must provide granular retrieval options:

    • Retrieve demographics only

    • Retrieve biometrics only

    • Retrieve both, when no filter is applied (default behavior)

  • Evidence files are not part of the Draft data.

3. Quality Classifier Stage Alignment

  • The new create_draft stage should seamlessly pass validated data to the Quality Classifier stage.

  • The Quality Classifier will not be modified functionally but must consume data from the newly created Draft rather than the packet manager.

4. UIN Generator Stage Update

  • The UIN Generator stage will no longer create Drafts for NEW or UPDATE packets.

  • It will only handle Draft creation for Lost Packets after ABIS stages, as per existing logic.

  • On successful UIN generation, the corresponding Draft must be updated and published to the ID Repository, after which it is discarded.

5. Validation and Error Handling

  • Implement strong validation rules for Draft creation to ensure a unique draft per RID.

  • Proper error handling must be added for transition failures between stages.

  • Draft API operations must not alter existing business rules except for the new stage insertion and timing of Draft creation.

6. Backward Compatibility

  • Maintain backward compatibility for existing UIN Generator workflows.

  • Default retrieval behavior must remain unchanged when no type parameter is specified.

Use Cases

Use Case #1: New Registration

Basic Flow

  1. A resident submits a new registration packet.

  2. The packet passes all validation stages up to the Quality Classifier.

  3. Before entering Quality Classifier, the create_draft stage triggers Draft creation using the Draft API.

    • Draft is tagged as “New” and stores demographics and biometrics (no evidence data).

  4. Subsequent stages (Demo Dedup, Bio Dedup, etc.) retrieve required data via Draft API.

  5. Once UIN is generated, the Draft is updated and published to the ID Repository.

  6. After publishing, the Draft is discarded.

Alternate Flow #1:
If the packet fails or is rejected, the corresponding Draft must be deleted immediately.

Alternate Flow #2:
If the packet is marked for reprocessing, the Draft must remain active until completion.

Use Case #2: Update Registration

Basic Flow

  1. A resident with an existing UIN updates their demographic or biometric details.

  2. The packet passes validation up to the Quality Classifier.

  3. Before entering Quality Classifier, the create_draft stage creates/updates the Draft API tagged as “Update”.

  4. Downstream stages retrieve data from the Draft API instead of Packet Manager.

  5. After UIN regeneration, the updated UIN is stored in the Draft, which is then published and discarded.

Alternate Flow #1:
If the packet fails or is rejected, the corresponding Draft must be deleted.

Alternate Flow #2:
If the packet is marked for reprocessing, the Draft must remain until successful completion.

Technical Implementation Overview (from Impact Analysis v1.3)

High-Level Summary

The Draft API replaces Packet Manager calls from the Demo Dedup stage onward.
Changes include:

  • Addition of a new “create_draft” stage before the Quality Classifier.

  • Enhancements to Draft API for granular retrieval (demographics, biometrics, or both).

  • Updates to affected stages to consume data from the Draft API.

  • UIN Generator stage refactoring to remove Draft creation logic for NEW/UPDATE packets.

Component-Level Impacts

Component | Change Summary -- | -- Draft API | Add query parameter-based retrieval (type=demographics, type=biometrics). New Stage (create_draft) | Create/Update Drafts for NEW & UPDATE packets, before Quality Classifier. Demo Dedup / Bio Dedup / ABIS / Verification / Manual Adjudication | Replace Packet Manager reads with Draft API calls. UIN Generator | Remove Draft creation logic for NEW/UPDATE packets; retain only for lost packets. Packet Classifier | Add handling for anonymous tag file creation and object store storage. Work Manager | Update to use enriched getTags API to retrieve anonymous data instead of Packet Manager.

Definition of Done

  • New create_draft stage implemented and placed before Quality Classifier.

  • Draft API enhanced to support granular data retrieval.

  • All dependent stages refactored to use Draft API instead of Packet Manager.

  • UIN Generator logic updated as per new design.

  • Backward compatibility verified.

  • All unit, integration, and regression tests successfully executed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions