public interface GoalMapper
Mapper interface for converting back and forth from a DTO to a Goal entity.
Since:
18.4.24
Version:
1.0
Author:
Yasin M and Harry X.
  • Field Details

    • INSTANCE

      static final GoalMapper INSTANCE
      Implementation instance of the mapper
  • Method Details

    • toDTO

      GoalResponseDTO toDTO(Goal goal)
      Maps Goal entity to DTO
      Parameters:
      goal - Goal entity
      Returns:
      Mapped DTO
    • toEntity

      Goal toEntity(GoalCreateDTO goalDTO, User user)
      Maps DTO to Goal entity
      Parameters:
      goalDTO - Goal DTO
      user - User who owns the goal
      Returns:
      Mapped entity
    • updateEntity

      Goal updateEntity(Goal goal, GoalUpdateDTO goalDTO)
      Updates Goal entity based on DTO
      Parameters:
      goal - Goal entity that is updated
      goalDTO - Goal DTO with new changes
      Returns:
      Updated goal entity