157 Commits

Author SHA1 Message Date
97c24d146b ... 2025-08-27 18:52:11 +02:00
6bff52e8b7 ... 2025-08-27 14:44:39 +02:00
7a999b7b6e Merge branch 'main' of git.ourworld.tf:herocode/db 2025-08-21 17:26:42 +02:00
095a4d0c69 ... 2025-08-21 17:26:40 +02:00
Timur Gordon
cedea2f305 move rhai wrappers of models from rhailib 2025-08-21 14:05:01 +02:00
Timur Gordon
58ed59cd12 Merge branch 'main' of https://git.ourworld.tf/herocode/db 2025-08-08 09:46:38 +02:00
Timur Gordon
6727c7498d add heroledger models 2025-08-08 09:46:30 +02:00
fc7e327f07 ... 2025-08-08 09:42:47 +02:00
993fa2adcd ... 2025-08-08 08:53:49 +02:00
33d7eafeac Merge branch 'main' of git.ourworld.tf:herocode/db 2025-08-06 13:44:23 +02:00
05259db53d ... 2025-08-06 13:44:21 +02:00
Maxime Van Hees
0cffda37a7 fixed dependencies issues 2025-08-05 13:00:09 +02:00
Timur Gordon
1a62fcacdd add heroledger models 2025-08-05 12:53:24 +02:00
7d9a6906c6 ... 2025-08-05 11:00:20 +02:00
Timur Gordon
70c32672de Merge branch 'main' of https://git.ourworld.tf/herocode/db 2025-08-04 11:28:03 +02:00
Timur Gordon
d122304236 Merge branch 'development_rhai' 2025-08-04 11:26:50 +02:00
aa7e79d26c Update git remote URL from git.threefold.info to git.ourworld.tf 2025-08-04 10:44:17 +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
87a5ae67c7 Add indexed_fields method on Model
For postgres indexes we want to know the indexed field names upfront
without an actual instance of Model

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2025-07-31 13:21:12 +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
0ad4cc2fb4 ... 2025-07-21 13:44:22 +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
b6ec58d413 Merge pull request 'feat: Improve database handling of model indices' (#6) from development_fix_loading_records into main
Reviewed-on: #6
2025-06-25 16:45:06 +00: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
6d3a6d063b Merge branch 'main' of git.threefold.info:herocode/db 2025-06-15 16:21:14 +02:00
ad141b7872 Update git remote URL from git.ourworld.tf to git.threefold.info 2025-06-15 16:21:14 +02: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