feat(splits): save split as rule from split modal

- Checkbox in split modal: 'Also save as rule for <merchant>'
- Creates a rule with apply_split action storing the participant shares
- Rules engine now handles apply_split: deletes existing splits and re-applies
- Bulk split mode hides the checkbox (rule wouldn't make sense for ad-hoc bulk)
This commit is contained in:
2026-03-11 12:40:03 +11:00
parent a8743ba7df
commit af4c64bba7
4 changed files with 58 additions and 6 deletions
+1 -1
View File
@@ -360,7 +360,7 @@ export interface RuleRow {
id: number;
name: string;
conditions: { field: string; operator: string; value: string }[];
actions: { set_category?: string; add_tag_ids?: number[]; set_merchant?: string };
actions: { set_category?: string; add_tag_ids?: number[]; set_merchant?: string; apply_split?: { participant_id: number; share_percent: number }[] };
enabled: boolean;
priority: number;
created_at: string;