Skip to content

3. Core Technology Requirements

  1. Entity Relationships

    One-to-many / many-to-many relationship between entities. Operations:

    • Retrieving all child entities for a given parent.
    • Creating, updating and deleting child entities associated with a parent.
    • Implementing a cascading delete.
  2. Use of Date and Time Objects

    Handling date-related data.

    • Accept and validate date inputs.
    • Using a consistent format.
    • An endpoint that filters by date range / sorts results based on date fields.
  3. Incorporating DTOs (Data Transfer Objects)

    Use DTOs to control data exchanged between the client and server.

    • Separation of concerns by decoupling the internal data model from the API response format.
    • Clean and minimal responses that expose only the required data fields.
  4. Error Handling and Validation

    Implement structured and meaningful error handling.

    • Validating client input.
    • Appropriate HTTP status codes and error messages.
    • Clear, consistent error responses.

    Examples:

    • Example: @Positive on price ensures inventory values are realistic.
    • Example: @PastOrPresent on manufacture dates prevents future entries.
      Jakarta Validation is used at the DTO level.
  5. Pagination The API supports pagination for endpoints returning collections.

  6. Validation Error (400): Triggered by invalid inputs like negative prices.

  7. Resource Not Found (404): Triggered when a model name does not exist in the database.