An interface layer translates API-specific requests into domain objects, invokes domain operations, and translates results back into API-specific responses. In a gRPC service, it also converts domain errors into transport status errors. section 10.3.2
Creating a habit through gRPC
CreateHabit applies an API-level default, constructs a domain Habit, calls habit.Create, maps the result into an API response, and returns InvalidArgument or Internal status codes for failures.
