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
Member

Changes

  • 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.
### Changes - 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. ### Related Issues - https://git.ourworld.tf/herocode/db/issues/7
MahmoudEmad added 1 commit 2025-05-27 18:15:59 +00:00
- 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.
MahmoudEmad added 1 commit 2025-05-28 09:52:41 +00:00
- 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.
MahmoudEmad added 1 commit 2025-05-28 11:01:34 +00:00
- 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.
MahmoudEmad added 1 commit 2025-06-03 12:32:37 +00:00
- 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.
MahmoudEmad added 1 commit 2025-06-10 12:41:57 +00:00
- 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.
MahmoudEmad added 1 commit 2025-06-10 13:02:00 +00:00
- Remove the `AttendanceStatus` enum from the `calendar` module.
MahmoudEmad added 1 commit 2025-06-12 11:31:06 +00:00
- 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.
MahmoudEmad added 1 commit 2025-06-25 15:40:05 +00:00
- 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.
timur merged commit b6ec58d413 into main 2025-06-25 16:45:07 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: herocode/db#6
No description provided.