feat: Improve database handling of model indices #6

Merged
timur merged 8 commits from development_fix_loading_records into main 2025-06-25 16:45:07 +00:00

8 Commits

Author SHA1 Message Date
Mahmoud-Emad
af83035d89 feat: Add new Rhai example demonstrating payment flow
- Add a new Rhai example showcasing complete payment flow
  for company registration. This includes company creation,
  payment record creation, successful payment processing,
  status updates, and handling failed and refunded payments.
- Add new example demonstrating payment integration in Rhai
  scripting.  This example showcases the usage of various
  payment status methods and verifies data from the database
  after processing payments.
- Add new examples to Cargo.toml to facilitate building and
  running the examples.  This makes it easier to integrate
  and test payment functionality using Rhai scripting.
2025-06-25 18:39:47 +03:00
Mahmoud-Emad
f0a0dd6d73 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.
2025-06-12 14:30:58 +03:00
Mahmoud-Emad
b9abfa50a9 feat: Remove unused AttendanceStatus enum
- Remove the `AttendanceStatus` enum from the `calendar` module.
2025-06-10 16:01:43 +03:00
Mahmoud-Emad
970299b1a4 feat: Add reminder functionality to ContractSigner model
- Added `last_reminder_mail_sent_at` field to track reminder
  timestamps.
- Implemented `can_send_reminder` to check if a reminder can be
  sent based on a 30-minute cooldown.
- Added `reminder_cooldown_remaining` to get remaining cooldown
  time.
- Added `mark_reminder_sent` to update reminder timestamp.
- Added example demonstrating reminder functionality in
  `legal_contract_example.rs`.
- Added tests for reminder functionality in
  `test_reminder_functionality.rs`.
- Updated Rhai scripts to include reminder-related functions and
  tests.
- Improved formatting and clarity in example code.
2025-06-10 15:41:49 +03:00
Mahmoud-Emad
20c075ec51 feat: Add JSON serialization/deserialization to Event struct
- Added `to_json` method to serialize Event to JSON string.
- Added `from_json` method to deserialize Event from JSON string.
- This allows for easier data exchange and persistence.
2025-06-03 15:32:28 +03:00
Mahmoud-Emad
8e2354df43 feat: Enhance calendar example with Event and Calendar features
- Add EventStatus enum to represent event states (Draft, Published, Cancelled).
- Extend Event model with color, category, reminder, timezone, created_by, all_day and is_recurring fields.
- Add color and description fields to Calendar model.
- Enhance calendar example to demonstrate new features, including event status changes, and detailed calendar information.
- Improve example output for clarity and comprehensiveness.
- Add owner_id and is_public fields to Calendar model for enhanced management.
2025-05-28 13:09:05,630 - INFO - Commit message copied to clipboard.
2025-05-28 14:01:25 +03:00
Mahmoud-Emad
331915c6cb feat: Enhance calendar example with user and attendee management
- Add user creation and management to the calendar example.
- Integrate user IDs into attendees for improved data integrity.
- Improve event manipulation by adding and removing attendees by ID.
- Enhance calendar example to demonstrate event and calendar retrieval.
- Enhance the calendar example with database storage for events.
- Modify the calendar example to manage events by ID instead of title.
2025-05-28 12:52:32 +03:00
Mahmoud-Emad
d8e3d48caa feat: Improve database handling of model indices
- Ensure all model types always have a primary key index entry.
- Simplify `get_all()` implementation by relying on primary key index.
- Remove redundant code in `get_all()` for finding all object IDs.
- Improve error handling and clarity in database operations.
2025-05-27 21:15:08 +03:00