import lombok.Value;
+import java.time.ZonedDateTime;
+import java.util.Optional;
+
@Value
public class PasswordResetProgress
{
public enum Status
{
- CONFIRMATION_DENIED,
+ NOT_AUTHORIZED,
+ CREATED,
CONFIMED,
ACCOMPLISHED
}
private final Status status;
private final String message;
+
+ private final Optional<ZonedDateTime> created;
+ private final Optional<ZonedDateTime> confirmed;
+ private final Optional<ZonedDateTime> accomplished;
}
public class PasswordResetService
{
- public PasswordResetRequest createRequest(String email)
+ /**
+ * Fetches the ID fo an existing reset-request or creates a new reset-request and returns its ID.
+ * @param email
+ * @return
+ */
+ public UUID createOrGetRequest(String email)
{
return null;
}
- public Optional<PasswordResetRequest> findRequest(String email)
+ public PasswordResetProgress getProgress(UUID requestId, String secret)
{
return null;
}
- public PasswordResetRequest getRequest(UUID requestId)
- {
- return null;
- }
-
- public PasswordResetProgress confirmRequest(PasswordResetRequest request, String code, String password)
- {
- return null;
- }
-
- public Optional<PasswordResetProgress> getProgress(UUID requestId)
+ public PasswordResetProgress confirmRequest(UUID requestID, String code, String password)
{
return null;
}