Commit Graph

67 Commits

Author SHA1 Message Date
Maxime Van Hees
453e86edd2 fixed dependencies issues on main branch which is called 'development' 2025-08-05 13:11:53 +02:00
Timur Gordon
d122304236 Merge branch 'development_rhai' 2025-08-04 11:26:50 +02:00
Timur Gordon
0cf66642a2 add postgres example instructions 2025-08-02 11:19:57 +02:00
Timur Gordon
0f3ea0fe2f repo clean up 2025-08-02 11:19:25 +02:00
Lee Smet
1074e1ba19
...
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2025-07-31 14:55:30 +02:00
Lee Smet
91b029befa
Remove leftover debug statements
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2025-07-31 14:15:02 +02:00
Lee Smet
02a6a1c8d8
Add indexes for models in postgres
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2025-07-31 14:12:45 +02:00
Lee Smet
74a1215554
Proper jsonb field encoding
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2025-07-31 12:15:52 +02:00
Lee Smet
0a8c5d1c1f
Expand Index struct to also get the original field name
This is needed in postgres, since we store data as jsonb so struct
fields can't get renamed

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2025-07-31 12:12:06 +02:00
Lee Smet
de8ca02048
Improve postgres example code style
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2025-07-31 11:21:33 +02:00
Lee Smet
55af1e97d2
Use proper JSON result type when getting row values
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2025-07-31 11:17:53 +02:00
Lee Smet
8544e3ba3f
Don't manually encode jsonb values
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2025-07-31 10:59:14 +02:00
Lee Smet
3d66a82967
Use BIGSERIAL for postgres keys
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2025-07-31 10:58:38 +02:00
Lee Smet
0a8e2040ef
Add postgres code
- Set is currently working
- Other methods to test

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2025-07-30 16:31:40 +02:00
Timur Gordon
f2a3aeb418 implement models for payment and id verification 2025-07-08 22:50:35 +02:00
timurgordon
1f9ec01934 merge branches and cleanup db 2025-06-27 12:11:04 +03:00
timurgordon
5563d7e27e Merge branch 'development_rhai' 2025-06-25 20:46:15 +03:00
timurgordon
287eca1238 Merge branch 'development_add_incremental_mode_to_heromodels' 2025-06-25 20:23:20 +03:00
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
Timur Gordon
149c177def remove rhai dsls 2025-06-25 03:27:22 +02:00
timurgordon
f2dfde5e8f Merge branch 'development_rhai' of https://git.ourworld.tf/herocode/db into development_rhai 2025-06-25 03:55:24 +03:00
timurgordon
41406f2d1e add theme data to circle and fix slideshow 2025-06-25 03:54:49 +03:00
Timur Gordon
cd2557c1c3 move dsl's to rhailib wip 2025-06-24 19:23:27 +02:00
Timur Gordon
e2640b9421 update to follow rhailib 2025-06-21 09:23:22 +02:00
timurgordon
e91a44ce37 fmt, fixes and additions 2025-06-19 13:18:10 +03:00
timurgordon
6b3cbfc4b2 db new models 2025-06-18 01:56:24 +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
timurgordon
00c4e6a1eb improve and add models 2025-06-12 05:22:17 +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
timurgordon
abbed9a1a1 final db models wip 2025-06-03 21:50:08 +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
Mahmoud-Emad
972d0982b0 feat: Enhance governance proposal model with activity tracking
- Add `Activity` model to track proposal creation and voting.
- Include `ActivityType` enum for different activity types.
- Improve `Proposal` model to record voting with comments.
- Refactor `models/governance` module for better organization.
2025-05-27 20:47:34 +03:00
timurgordon
2a2d69dafb fix 2025-05-27 11:34:44 +03:00
Mahmoud-Emad
483c5ccf68 feat: Add governance activity tracking example and model
- Added a comprehensive example demonstrating governance activity tracking.
- Created `GovernanceActivity` model to record governance events.
- Improved error handling in `OurDB::get_all` to gracefully handle deserialization failures.
2025-05-25 14:14:01 +03:00
timurgordon
0da512484f fix merge issues and rhai examples wip 2025-05-22 23:57:33 +03:00
timurgordon
93950bcab4 Merge branch 'development_add_incremental_mode_to_heromodels' 2025-05-22 18:24:11 +03:00
timurgordon
478f497316 improve model rhai scripts legibility 2025-05-22 17:55:08 +03:00
timurgordon
99f5d16f31 cleanup and remove ignored tmp db dirs 2025-05-22 17:53:44 +03:00
Mahmoud-Emad
304b1523a1 feat: add marketplace example with listing and bid management 2025-05-22 11:14:20 +03:00
timurgordon
56ec505874 implement more models and rhai examples 2025-05-22 03:57:03 +03:00
Mahmoud-Emad
a71a966989 feat: Add an example about how to create a vote with comment 2025-05-21 14:50:55 +03:00
Mahmoud-Emad
bebb35e686 feat: Added optional vote comment to the proposal vote fields 2025-05-21 12:41:16 +03:00
Mahmoud-Emad
bd3c0c1932 fix: Support passing the proposal status 2025-05-21 11:26:13 +03:00
Mahmoud-Emad
8997d92e41 feat: Add created_at, updated_at fields in the db proposal model 2025-05-21 09:57:25 +03:00
Mahmoud-Emad
5327d1f00c fix: Add creator_name field to the proposal model 2025-05-21 09:37:45 +03:00
Mahmoud-Emad
4c0c7be574 feat: Add get_all method to list all db objects based on the object model 2025-05-21 09:13:58 +03:00