Allow signature requests only on current published version

Requesting a signature only validated that the version was PUBLISHED, so a
signature could be requested on a superseded (older) published version. Reject
versions that are not the document's current published major/minor, and hide
the request button in the console for non-current versions.

Signed-off-by: Sacha Al Himdani <sacha@probo.com>
This commit is contained in:
Sacha Al Himdani
2026-06-22 18:30:26 +02:00
parent 9093be79f4
commit a8e8e3e0e7
4 changed files with 34 additions and 1 deletions

View File

@@ -1337,6 +1337,10 @@ func (r *mutationResolver) RequestSignature(ctx context.Context, input types.Req
return nil, gqlutils.Conflict(ctx, errNotPublished)
}
if errNotCurrent, ok := errors.AsType[*probo.ErrDocumentVersionNotCurrent](err); ok {
return nil, gqlutils.Conflict(ctx, errNotCurrent)
}
if errContractEnded, ok := errors.AsType[*probo.ErrProfileContractEnded](err); ok {
return nil, gqlutils.Conflict(ctx, errContractEnded)
}