Convention: Session 124: What naming convention should be used for user ...
Documentation for Sessions
📏 Convention: Session 124: What naming convention should be used for user ...
Date: 2026-02-19
Time: 21:37:10 UTC
Session: gspace1-125.130
Agent: documentation
Confidence: 95%
Status: ✅ Documented
📋 Decision Context
Question:
Session 124: What naming convention should be used for user types across the codebase?
Task: Not specified
🎯 Decision Made
Chosen:
Use snake_case with semantic prefixes: space_* for people working IN a space (space_builder, space_admin, space_user), platform_user for end customers. Never use hyphens in type values (space-builder is WRONG, space_builder is correct). developer and admin have no prefix (they're global L0 types). UserHierarchyType in user-hierarchy.schema.ts is the source of truth. Frontend RegistrationUserType mirrors it minus developer/admin (internal only).
Options Considered:
- No alternatives documented
💭 Reasoning
Consistent snake_case matches MongoDB field conventions and existing codebase patterns. Semantic prefixes make intent clear: space_* = space-scoped roles, platform_user = platform-scoped customer. Previous naming (platform_admin for a space CEO) was confusing because 'platform' should mean the GoGrab platform, not an individual space.
📁 Files Involved
libs/libs-api/backend-core/src/lib/schemas/user-hierarchy.schema.tslibs/libs-ui/auth-ui/src/lib/models/auth.types.ts
🔗 Related
- Decision ID:
dev_1771537030770_vibvgrk - Session: 125
- Workspace: gspace1
Auto-generated by MCP Smart Consolidation