Filter inactive people from signature request recipients
The signature request recipient lists (both the multi-select dialog and the document signatures page) included people who were inactive via SCIM deactivation. The existing filter only excluded people with ended contracts but not those with an INACTIVE state. This adds state: ACTIVE to the ProfileFilter in both frontend queries and introduces a server-side ErrProfileInactive validation in the RequestSignature and BulkRequestSignatures service methods to reject inactive profiles even if called directly via API. Co-authored-by: Émile Ré <nemile.re@gmail.com> Signed-off-by: Émile Ré <emile@getprobo.com> Signed-off-by: Émile Ré <emile@probo.com>
This commit is contained in:
@@ -1296,6 +1296,10 @@ func (r *mutationResolver) RequestSignature(ctx context.Context, input types.Req
|
||||
return nil, gqlutils.Conflict(ctx, errContractEnded)
|
||||
}
|
||||
|
||||
if errInactive, ok := errors.AsType[*probo.ErrProfileInactive](err); ok {
|
||||
return nil, gqlutils.Conflict(ctx, errInactive)
|
||||
}
|
||||
|
||||
r.logger.ErrorCtx(ctx, "cannot request signature", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
}
|
||||
@@ -1341,6 +1345,10 @@ func (r *mutationResolver) BulkRequestSignatures(ctx context.Context, input type
|
||||
return nil, gqlutils.Conflict(ctx, errContractEnded)
|
||||
}
|
||||
|
||||
if errInactive, ok := errors.AsType[*probo.ErrProfileInactive](err); ok {
|
||||
return nil, gqlutils.Conflict(ctx, errInactive)
|
||||
}
|
||||
|
||||
r.logger.ErrorCtx(ctx, "cannot bulk request signatures", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user