Fix signature count mismatch with signatures tab on documents

The badge on a document version showed signatures filtered by
activeContract: true, while the signatures tab fetched signatures with
no filter and listed people filtered by contractEnded: false and
state: ACTIVE. The two views disagreed both when a signer's contract had
ended and when a signer was deactivated while still under contract.

Add a state: ProfileState field to DocumentVersionSignatureFilter
alongside the existing activeContract filter, so the signature query
can mirror the same predicates as the people query. Pass
{ activeContract: true, state: ACTIVE } from the badge, the document
list item, and the signatures tab fragment. The same filter is now
evaluated on both the count and the list.

Threaded through the console and MCP resolvers, the MCP spec, and the
n8n getAllSignatures operation.

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2026-05-22 10:55:31 +02:00
parent 63e8c85f66
commit 83445c6e34
9 changed files with 56 additions and 12 deletions

View File

@@ -279,6 +279,7 @@ func (r *documentVersionResolver) Signatures(ctx context.Context, obj *types.Doc
var (
signatureStates []coredata.DocumentVersionSignatureState
activeContract *bool
profileState *coredata.ProfileState
)
if filter != nil {
@@ -289,9 +290,13 @@ func (r *documentVersionResolver) Signatures(ctx context.Context, obj *types.Doc
if filter.ActiveContract != nil {
activeContract = filter.ActiveContract
}
if filter.State != nil {
profileState = filter.State
}
}
signatureFilter := coredata.NewDocumentVersionSignatureFilter(signatureStates, activeContract)
signatureFilter := coredata.NewDocumentVersionSignatureFilter(signatureStates, activeContract, profileState)
cursor := types.NewCursor(first, after, last, before, pageOrderBy)

View File

@@ -247,6 +247,7 @@ input DocumentVersionSignatureOrder {
input DocumentVersionSignatureFilter {
states: [DocumentVersionSignatureState!]
activeContract: Boolean
state: ProfileState
}
input DocumentVersionApprovalQuorumOrder {