Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Apply a fix to all sibling paths, not just one of them
When you correct a calculation or mapping in a list endpoint, update the matching single-item/detail path so the two cannot diverge.
Bad example
| 1 | // getAll() updated with new conversion; getOne() left with raw value |
Explanation (EN)
Updating only one representation leaves callers observing inconsistent facts.
Objašnjenje (HR)
Good example
| 1 | // share one expression/helper used by both getAll() and getOne() |
Explanation (EN)
Objašnjenje (HR)
Notes (EN)
When changing a mapping, calculation or validation shared by list and detail paths, compare their contracts and inspect every path that implements the same invariant.
Exceptions / Tradeoffs (EN)
Do not force paths with intentionally different representations or authorization requirements into one helper. Keep fixes within the authorized repositories.