1. Create and Manage Rules
Rules define how the ledger operates under specific conditions, preventing unauthorized or undesired actions. These rules help enforce organizational policies and workflows.
The ledger system supports the following types of rules:
Rule Categories
Intrinsic (Built-in) Rules: Hardcoded into the ledger, cannot be modified but can be enabled or disabled.
Predefined (Configurable) Rules: Provided by the system, but users can configure parameters.
Custom (User-Defined) Rules: Created entirely by users, allowing for tailored enforcement.
Rules are managed through the Luca CLI commands or APIs.
2. Rulebooks and Rules
Rulebooks: A collection of rules grouped together for specific use cases.
Example: common_rulebook for balance checks and currency validation.
Rules: Individual policies within a rulebook.
Example: Min Wallet Balance Limit prevents wallets from going negative.
3. Rule Statuses
Rules have three possible statuses:
Enabled (Active): The rule is currently enforced.
Disabling (Transitional State): The rule is in the process of being disabled.
Disabled (Inactive): The rule exists but is not applied.
Rules are tied to specific triggers in the ledger workflow, such as:
Fund transfers and payments
4. Steps to Implement Rules
1. Identify Needs
Use built-in or predefined rules when possible.
Create custom rules for unique cases.
Manage rules efficiently using the Luca CLI or APIs.
3. Test and Validate
Ensure rules function correctly before deployment.
Use logs and test transactions to verify enforcement.
5. Implementing Rules Using CLI Commands
1. Create a Rulebook
2. Define a Rule
3. Enable a Rule
4. Verify Rule Activation
6. Disable a Rule
7. Modify a Rule
8. Delete a Rule
6. Troubleshooting
Rule Not Being Enforced
Ensure the rule is ENABLED.
Verify script logic and parameters.
Errors During Testing
Ensure rule conditions match the ledger environment.
Verify any required datasheets or parameters.
7. Ledger Rules Glossary
This glossary provides a detailed list of all rules, their purposes, and categories.
Intrinsic (Built-in) Rules
Ensures source and target wallet currencies match.
Prevents outgoing payments if the balance would be negative.
Blocks payments if the balance is below zero.
Global Consolidated Balance
Ensures multi-currency compliance.
Predefined (Configurable) Rules
Wallet Currency Restriction
Ensures wallet currency is in the allowed list.
Max Account Balance Limit
Restricts the max balance an account can hold.
Ensures transactions meet a minimum threshold.
Blocks transactions to/from closed wallets.
Reject on Suspended Wallet
Blocks payments involving suspended wallets.
Blocks transactions from pending wallets.
Reject on Terminated Wallet
Stops payments involving terminated wallets.
Transaction-Specific Rules
Restricts setting value dates too far in the future.
Prevents transactions with excessively old value dates.
Ensures transactions do not exceed a defined upper threshold.
Enforces a minimum transaction amount.
8. Best Practices for Ledger Rules
Plan Ahead: Understand rule impacts before enabling them.
Use Logs: Track rule enforcement and troubleshooting.
Test Thoroughly: Always validate new rules in a testing environment.
Stay Updated: Monitor product updates for rule enhancements.