Skip to content

feat(identity): reject identification documents with reason and replacement - #9434

Open
vitormattos wants to merge 35 commits into
mainfrom
feat/id-document-rejection-9370-20261110
Open

vitormattos wants to merge 35 commits into
mainfrom
feat/id-document-rejection-9370-20261110

Conversation

@vitormattos

@vitormattos vitormattos commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Problem

When an identification document is expired, unreadable, or otherwise unacceptable, reviewers need to request a replacement without deleting the evidence or cancelling the signature request. Deleting the document loses the explanation, forces manual follow-up, and makes the outcome indistinguishable from a normal removal.

What changes

  • Reject with a reason: reviewers can reject a submitted document independently of approval and deletion. An explanation is required.
  • Traceable decision: the document is marked Rejected and retains the reason, the reviewer, and the decision time. The approval queue shows this history; the signer sees the explanation without the reviewer's identifier.
  • Notify and replace: account and external signers are notified through the existing channels and can provide another document of the same type. The original signing request stays active; the rejected record remains auditable.
  • Keep approval safe: rejected documents cannot be approved or silently deleted, and only one active document of each type can be submitted, including within a single upload.

Interface screenshots

Approval queue: before and after

Before After
Queue before the change: no Reject action Queue with Reject action beside approval

Reviewer rejection flow

Action Screenshot
Choose Reject instead of approving or deleting Separate Reject action
Open the dialog and provide a reason Reason is requested in a rejection dialog
Review the explanation before confirming Filled rejection reason
See the rejected document retained in the queue Rejected document with its reason

The screenshots show the rendered LibreSign interface with synthetic document data. They demonstrate the interaction, not completion of an end-to-end signing flow.

Validation and review focus

Automated tests cover reviewer permissions, audit retention, rejection and replacement for account and external signers, recipient privacy, notifications, duplicate-document prevention, and the frontend's approval/rejection states. The reviewer history displays who rejected the document and when; the signer-facing view does not disclose that identity.

Please review the rejection/approval concurrency boundary, notification delivery and retry behavior, and the complete reject → notify → replace → sign journey in an integrated environment.

Closes #9370.

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Code Metrics Report

Note: Metrics describe the revision analyzed by the successful PHPUnit run. Newer commits with pending, canceled or failed checks may not yet be represented in this report.

main (1511388) #9434 (cf5860e) +/-
Coverage 77.5% 77.9% +0.4%
Test Execution Time 4m42s 2m58s -1m44s
Details
  |                     | main (1511388) | #9434 (cf5860e) |  +/-   |
  |---------------------|----------------|-----------------|--------|
+ | Coverage            |          77.5% |           77.9% |  +0.4% |
  |   Files             |            525 |             530 |     +5 |
  |   Lines             |          29422 |           29625 |   +203 |
+ |   Covered           |          22816 |           23101 |   +285 |
+ | Test Execution Time |          4m42s |           2m58s | -1m44s |

Code coverage of files in pull request scope (73.5% → 79.1%, patch 100.0%)

Files Coverage +/- Patch Coverage Status
apps/libresign/lib/Service/IdDocsPolicyService.php 0.0% -80.9% - affected
apps/libresign/lib/Service/IdDocsService.php 0.0% -86.3% - affected
lib/Controller/IdDocsController.php 80.2% +33.7% 100.0% modified
lib/Db/IdDocs.php 100.0% 0.0% 100.0% modified
lib/Db/IdDocsMapper.php 82.9% +14.2% 100.0% modified
lib/Notification/Notifier.php 8.9% +8.9% 100.0% modified
lib/ResponseDefinitions.php 0.0% 0.0% - modified
lib/Service/AccountService.php 100.0% 0.0% - modified
lib/Service/File/AccountSettingsProvider.php 100.0% 0.0% - modified
lib/Service/File/SettingsLoader.php 100.0% 0.0% - modified
lib/Service/IdDoc/IdDocRejectionEmailTemplateBuilder.php 100.0% +100.0% 100.0% added
lib/Service/IdDoc/IdDocRejectionNotifier.php 100.0% +100.0% 100.0% added
lib/Service/IdDoc/IdDocRejectionRecipientResolver.php 100.0% +100.0% 100.0% added
lib/Service/IdDoc/IdDocRejectionService.php 100.0% +100.0% 100.0% added
lib/Service/IdDoc/IdDocsPolicyService.php 87.6% +87.6% 100.0% renamed
lib/Service/IdDoc/IdDocsService.php 91.8% +91.8% 100.0% renamed
lib/Service/MailService.php 83.7% +0.8% 100.0% modified
lib/Service/Notification/IdDocRejectionPayload.php 100.0% +100.0% 100.0% added
lib/Service/Notification/MailChannel.php 96.5% +7.0% 100.0% modified
lib/Service/Notification/NotificationEnvelopeCodec.php 92.2% +0.7% 100.0% modified
lib/Service/SignFileService.php 80.0% +0.0% 100.0% modified
lib/Service/UuidResolverService.php 100.0% 0.0% - modified
lib/Service/Validation/IdentityDocumentValidator.php 78.9% +7.5% 100.0% modified

Reported by octocov

@vitormattos
vitormattos force-pushed the feat/id-document-rejection-9370-20261110 branch from 25cbbbb to 6736ec6 Compare November 10, 2026 18:08
@vitormattos vitormattos self-assigned this Nov 11, 2026
@vitormattos
vitormattos marked this pull request as ready for review November 11, 2026 22:37
@vitormattos
vitormattos requested a review from a team as a code owner November 11, 2026 22:37
@YvesCesar
YvesCesar self-requested a review November 12, 2026 13:09

@YvesCesar YvesCesar 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.

Thanks @vitormattos !

I made a few revisions. Could you take a look?

Comment thread lib/Db/IdDocsMapper.php Resolved
Comment thread lib/Controller/IdDocsController.php Resolved
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…ntract

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…ment

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…solation

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…ing ID cases

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…move

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos
vitormattos force-pushed the feat/id-document-rejection-9370-20261110 branch from 4982be3 to 27f99c7 Compare November 21, 2026 19:43
…ntract

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
… resolved

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…ndex

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@vitormattos

Copy link
Copy Markdown
Member Author

@YvesCesar can you review again?

@YvesCesar YvesCesar 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.

Thanks, @vitormattos !

Looks okay to me.

This branch has not been deployed

No deployments
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.

Allow approvers to reject an identification document with a reason (e.g. expired ID)

2 participants