mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Refactor PDF signature handling and add signature state changer
Simplified PdfSignedMessageHandler by delegating signature state changes to a new SignatureStepStateChanger class. Added utility method to EntityWorkflowStepSignature for checking pending signatures and created new test cases for the SignatureStepStateChanger.
This commit is contained in:
@@ -141,6 +141,32 @@ class EntityWorkflowStepSignature implements TrackCreationInterface, TrackUpdate
|
||||
return EntityWorkflowSignatureStateEnum::SIGNED == $this->getState();
|
||||
}
|
||||
|
||||
public function isPending(): bool
|
||||
{
|
||||
return EntityWorkflowSignatureStateEnum::PENDING == $this->getState();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether all signatures associated with a given workflow step are not pending.
|
||||
*
|
||||
* Iterates over each signature in the provided workflow step, and returns false if any signature
|
||||
* is found to be pending. If all signatures are not pending, returns true.
|
||||
*
|
||||
* @param EntityWorkflowStep $step the workflow step whose signatures are to be checked
|
||||
*
|
||||
* @return bool true if all signatures are not pending, false otherwise
|
||||
*/
|
||||
public static function isAllSignatureNotPendingForStep(EntityWorkflowStep $step): bool
|
||||
{
|
||||
foreach ($step->getSignatures() as $signature) {
|
||||
if ($signature->isPending()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 'person'|'user'
|
||||
*/
|
||||
|
Reference in New Issue
Block a user