Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP1universalStack: any
data-modeleventscorrectness
Enrich partial event payloads with fields downstream handlers require
If a real-time/event payload lacks a field that a click handler or filter needs (e.g. a slug/url-name), enrich it before rendering so existing interactions don't break.
PR: hegnar-forum-web · org-mining-3rd-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | category: { id: event.category.id, name: event.category.name } // missing urlname |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | const full = findCategoryById(event.category.id) ?? event.category; // includes urlname for filtering |
Explanation (EN)
Objašnjenje (HR)