feat: Add signature functionality to ContractSigner

- Add `signature_data` field to `ContractSigner` to store base64
  encoded signature image data.  Allows for storing visual
  signatures alongside electronic ones.
- Implement `sign` method for `ContractSigner` to handle signing
  with optional signature data and comments. Improves the
  flexibility and expressiveness of the signing process.
- Add Rhai functions for signature management, including signing
  with/without data and clearing signature data.  Extends the
  Rhai scripting capabilities for contract management.
- Add comprehensive unit tests to cover the new signature
  functionality. Ensures correctness and robustness of the
  implementation.
- Update examples to demonstrate the new signature functionality.
  Provides clear usage examples for developers.
This commit is contained in:
Mahmoud-Emad
2025-06-12 14:30:58 +03:00
parent b9abfa50a9
commit f0a0dd6d73
6 changed files with 322 additions and 1 deletions

View File

@@ -57,6 +57,7 @@ pub mut:
signed_at ourtime.OurTime // Optional in Rust, OurTime can be zero
comments string // Optional in Rust, string can be empty
last_reminder_mail_sent_at ourtime.OurTime // Unix timestamp of last reminder sent
signature_data string // Base64 encoded signature image data (Optional in Rust)
}
// SignerStatus defines the status of a contract signer