The domain layer, also called the business layer, owns business rules and domain behavior rather than transport-specific concerns. It exposes typed business concepts such as Habit, ID, Name, and WeeklyFrequency, making APIs clearer and reducing accidental argument mix-ups. section 10.3.1
A domain operation can:
- Return domain errors without knowing that an API uses gRPC; the API layer translates invalid input into INVALID_ARGUMENT. section 10.3.1
Creating a habit
Create validates and completes a Habit, saves it to data storage, and returns the completed entity. Tests cover fully populated, partially populated, and whitespace-only names.


