mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-06 23:04:58 +00:00
Add signatureZoneIndex to PdfSignedMessage and related classes
Included signatureZoneIndex for PdfSignedMessage in class definitions, handlers, and serializers to support signature zones. Updated test cases to reflect this new property, ensuring robust validation for handling and serialization.
This commit is contained in:
@@ -18,6 +18,7 @@ final readonly class PdfSignedMessage
|
||||
{
|
||||
public function __construct(
|
||||
public readonly int $signatureId,
|
||||
public readonly string $content
|
||||
public readonly int $signatureZoneIndex,
|
||||
public readonly string $content,
|
||||
) {}
|
||||
}
|
||||
|
@@ -55,6 +55,7 @@ final readonly class PdfSignedMessageHandler implements MessageHandlerInterface
|
||||
$this->storedObjectManager->write($storedObject, $message->content);
|
||||
|
||||
$signature->setState(EntityWorkflowSignatureStateEnum::SIGNED)->setStateDate($this->clock->now());
|
||||
$signature->setZoneSignatureIndex($message->signatureZoneIndex);
|
||||
$this->entityManager->flush();
|
||||
$this->entityManager->clear();
|
||||
}
|
||||
|
@@ -40,7 +40,7 @@ final readonly class PdfSignedMessageSerializer implements SerializerInterface
|
||||
throw new MessageDecodingFailedException('Invalid character found in the base64 encoded content');
|
||||
}
|
||||
|
||||
$message = new PdfSignedMessage($decoded['signatureId'], $content);
|
||||
$message = new PdfSignedMessage($decoded['signatureId'], $decoded['signatureZoneIndex'], $content);
|
||||
|
||||
return new Envelope($message);
|
||||
}
|
||||
@@ -55,6 +55,7 @@ final readonly class PdfSignedMessageSerializer implements SerializerInterface
|
||||
|
||||
$data = [
|
||||
'signatureId' => $message->signatureId,
|
||||
'signatureZoneIndex' => $message->signatureZoneIndex,
|
||||
'content' => base64_encode($message->content),
|
||||
];
|
||||
|
||||
|
Reference in New Issue
Block a user