Exclude approved-without-signature documents from employee approvals

Filter out approval decisions where state is APPROVED but
electronic_signature_id is NULL, removing historical approved
entries that lack an electronic signature from the employee
approvals page.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2026-04-03 16:01:57 +02:00
parent 2b377a22e7
commit 8de7add203
2 changed files with 2 additions and 0 deletions

View File

@@ -173,6 +173,7 @@ func (f *DocumentFilter) SQLFragment() string {
INNER JOIN iam_membership_profiles p ON dvad.approver_id = p.id
WHERE dv.document_id = documents.id
AND p.identity_id = @employee_identity_id::text
AND NOT (dvad.state = 'APPROVED' AND dvad.electronic_signature_id IS NULL)
)
)
)

View File

@@ -95,6 +95,7 @@ func (f *DocumentVersionFilter) SQLFragment() string {
INNER JOIN iam_membership_profiles p ON dvad.approver_id = p.id
WHERE dvaq.version_id = document_versions.id
AND p.identity_id = @employee_identity_id::text
AND NOT (dvad.state = 'APPROVED' AND dvad.electronic_signature_id IS NULL)
)
)
)