-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/148/update-assignment' into feature/149/delete-…
…assignment # Conflicts: # src/main/java/com/ays/assignment/service/AssignmentService.java
- Loading branch information
Showing
6 changed files
with
50 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...java/com/ays/assignment/model/mapper/AssignmentUpdateRequestToAssignmentEntityMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.ays.assignment.model.mapper; | ||
|
||
import com.ays.assignment.model.dto.request.AssignmentUpdateRequest; | ||
import com.ays.assignment.model.entity.AssignmentEntity; | ||
import com.ays.common.model.mapper.BaseMapper; | ||
import org.mapstruct.AfterMapping; | ||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
import org.mapstruct.MappingTarget; | ||
import org.mapstruct.factory.Mappers; | ||
|
||
@Mapper | ||
public interface AssignmentUpdateRequestToAssignmentEntityMapper extends BaseMapper<AssignmentUpdateRequest, AssignmentEntity> { | ||
|
||
@Override | ||
@Mapping(target = "countryCode", source = "phoneNumber.countryCode") | ||
@Mapping(target = "lineNumber", source = "phoneNumber.lineNumber") | ||
AssignmentEntity map(AssignmentUpdateRequest source); | ||
|
||
@AfterMapping | ||
default void mapLocation(AssignmentUpdateRequest source, | ||
@MappingTarget AssignmentEntity.AssignmentEntityBuilder<?, ?> builder) { | ||
builder.point(source.getLongitude(), source.getLatitude()); | ||
} | ||
|
||
/** | ||
* Initializes the mapper. | ||
* | ||
* @return the initialized mapper object. | ||
*/ | ||
static AssignmentUpdateRequestToAssignmentEntityMapper initialize() { | ||
return Mappers.getMapper(AssignmentUpdateRequestToAssignmentEntityMapper.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters