Skip to content

Commit

Permalink
Added a getUser method to UserRegInteractor so that other use cases c…
Browse files Browse the repository at this point in the history
…an access it in main.
  • Loading branch information
CC-3636 committed Nov 21, 2022
1 parent c56e9a2 commit cac7be0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main/java/user_register_usecase/UserRegInteractor.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class UserRegInteractor implements UserRegInputBoundary {

// private UserFactory userFactory;

private User user;

/**
* @param gateway the gateway that interacts with the User database
* @param userRegPresenter the presenter that shows the success or failure of this attempt to register
Expand Down Expand Up @@ -56,6 +58,8 @@ public UserRegResponse create(UserRegRequest request) throws IOException {
return userPresenter.prepareFailView("Password must be at least 9 characters long");
}

this.user = user;

LocalDateTime now = LocalDateTime.now();

UserRegSaveRequest userModel;
Expand All @@ -74,4 +78,8 @@ public UserRegResponse create(UserRegRequest request) throws IOException {
UserRegResponse accResponseModel = new UserRegResponse(user.getName(), now.toString());
return userPresenter.prepareSuccessView(accResponseModel);
}

public User getUser() {
return this.user;
}
}

0 comments on commit cac7be0

Please sign in to comment.