Add nda signature middleware

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-02-20 19:17:11 +04:00
parent bb8d477495
commit 9da8cc2e3d
12 changed files with 191 additions and 41 deletions

View File

@@ -17,6 +17,7 @@ package esign
import (
"bytes"
"context"
"errors"
"fmt"
"strings"
"time"
@@ -338,6 +339,10 @@ func (s *Service) GetSignatureByID(ctx context.Context, id gid.GID) (*coredata.E
ctx,
func(conn pg.Conn) error {
if err := signature.LoadByID(ctx, conn, scope, id); err != nil {
if errors.Is(err, coredata.ErrResourceNotFound) {
return ErrElectronicSignatureNotFound
}
return fmt.Errorf("cannot load electronic signature: %w", err)
}