Added info about commiter to comision entity

This commit is contained in:
Filip Izydorczyk
2020-12-20 13:04:25 +01:00
parent c62674b9d8
commit dfae6d7c78
3 changed files with 53 additions and 8 deletions

View File

@ -82,7 +82,7 @@ public class CommisionController extends TokenBasedController {
Assert.isTrue(!notExistingGroup.isPresent(), "Group "
+ notExistingGroup.orElse(Long.MIN_VALUE).toString() + "doesn't exist");
final Commision com = new Commision(user);
final Commision com = new Commision(user, asker);
this.commisionService.save(com);
groups.stream().forEach((groupId) -> {

View File

@ -10,12 +10,29 @@ public class CommisionResponse {
@ApiModelProperty(value = "ID created by database")
private Long id;
@ApiModelProperty(value = "ID of user that commision belongs to")
private UserResponse owner;
@ApiModelProperty(value = "ID of user that created commision")
private UserResponse commiter;
@ApiModelProperty(value = "Timestamp where the user commit the commision")
private String commisionDate;
public CommisionResponse(Commision commision) {
this.id = commision.getId();
this.commisionDate = commision.getCommisionDate().toString();
this.owner = commision.getCommisionOwner() != null ? new UserResponse(commision.getCommisionOwner()) : null;
this.commiter = commision.getCommisionCommiter() != null ? new UserResponse(commision.getCommisionCommiter())
: null;
}
public UserResponse getCommiter() {
return commiter;
}
public UserResponse getOwner() {
return owner;
}
public String getCommisionDate() {