Add an allow_secondary boolean field to rules. When a document matches multiple rules, the highest-priority match is the primary (moved + renamed). Rules with allow_secondary: true that also match become secondary — only symlinks are created for them.
Example Config
rules:
- id: bank-statements
priority: 100
match:
contains_all: ["Kontoauszug", "Bank"]
output:
directory: "Bank/Statements/$y"
filename: "$y_$m_bank_statement"
- id: tax-docs
priority: 50
allow_secondary: true # NEW
match:
contains: "Bank"
symlinks:
- target: "Taxes/$y/Documents"
Implementation
Schema change:
- File:
crates/paporg/src/config/schema.rs
- Add
allow_secondary: Option<bool> to Rule (line ~85), default false
Pipeline change:
- File:
crates/paporg/src/pipeline/runner.rs
- After primary categorization (step 4), collect secondary matches where
allow_secondary == true
- In
step_create_symlinks() (line ~341): also create symlinks from secondary matches
- Secondary rules only contribute their
symlinks config — they do NOT affect output (no move/rename)
Depends on: Issue #44 (return all matching rules)
Acceptance Criteria
Add an
allow_secondaryboolean field to rules. When a document matches multiple rules, the highest-priority match is the primary (moved + renamed). Rules withallow_secondary: truethat also match become secondary — only symlinks are created for them.Example Config
Implementation
Schema change:
crates/paporg/src/config/schema.rsallow_secondary: Option<bool>toRule(line ~85), defaultfalsePipeline change:
crates/paporg/src/pipeline/runner.rsallow_secondary == truestep_create_symlinks()(line ~341): also create symlinks from secondary matchessymlinksconfig — they do NOT affectoutput(no move/rename)Depends on: Issue #44 (return all matching rules)
Acceptance Criteria
allow_secondary: truerules create symlinks when matched as secondaryallow_secondary: false(default) rules are ignored when not primary