Problem Statement
Where should you place input validation in a layered LLD?
Explanation
Validate payload structure and simple constraints at the boundary to fail fast. Enforce business invariants inside domain services to keep them centralized.
This split avoids duplication and keeps core rules intact even when called from jobs or other services.
Code Solution
SolutionRead Only
if(!payload.email) return 400; orderService.place(validatedCommand);
Practice Sets
This question appears in the following practice sets:
