From 25004c898ef64fe939594ef19d987dfe3444cbe6 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 14 Mar 2021 14:58:13 +0100 Subject: [PATCH] WIP --- .../internal/PasswordResetProgress.java | 10 ++++++++- .../domain/internal/PasswordResetService.java | 21 +++++++------------ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/pwreset/src/main/java/de/juplo/demos/pwreset/domain/internal/PasswordResetProgress.java b/pwreset/src/main/java/de/juplo/demos/pwreset/domain/internal/PasswordResetProgress.java index 757f692..4b42c72 100644 --- a/pwreset/src/main/java/de/juplo/demos/pwreset/domain/internal/PasswordResetProgress.java +++ b/pwreset/src/main/java/de/juplo/demos/pwreset/domain/internal/PasswordResetProgress.java @@ -2,17 +2,25 @@ package de.juplo.demos.pwreset.domain.internal; 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 created; + private final Optional confirmed; + private final Optional accomplished; } diff --git a/pwreset/src/main/java/de/juplo/demos/pwreset/domain/internal/PasswordResetService.java b/pwreset/src/main/java/de/juplo/demos/pwreset/domain/internal/PasswordResetService.java index 5d4b346..26a448c 100644 --- a/pwreset/src/main/java/de/juplo/demos/pwreset/domain/internal/PasswordResetService.java +++ b/pwreset/src/main/java/de/juplo/demos/pwreset/domain/internal/PasswordResetService.java @@ -6,27 +6,22 @@ import java.util.UUID; 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 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 getProgress(UUID requestId) + public PasswordResetProgress confirmRequest(UUID requestID, String code, String password) { return null; } -- 2.20.1