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).
backend ruleP2universalStack: TypeScript
dtonamingmappingclarity
Avoid exposing a column under a name that conflicts with another field
Don't alias a database column to a DTO property name that collides with the real meaning of another column; it confuses consumers and blocks exposing the original column later.
PR: vinify-backend · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codesql
| 1 | // exposes `value` column as `averageListPrice` while a real `value` also exists |
| 2 | SELECT value AS averageListPrice, value FROM ... |
Explanation (EN)
Objašnjenje (HR)
Good example
New codesql
| 1 | // give the derived field its own unambiguous source/name |
| 2 | SELECT AVG(list_price) AS averageListPrice FROM ... |
Explanation (EN)
Objašnjenje (HR)