aboutsummaryrefslogtreecommitdiffstats
path: root/code/api/src/Data
diff options
context:
space:
mode:
Diffstat (limited to 'code/api/src/Data')
-rw-r--r--code/api/src/Data/Database/Internal/PasswordResetRequest.cs (renamed from code/api/src/Data/Database/Internal/ForgotPasswordRequest.cs)6
-rw-r--r--code/api/src/Data/Database/MainAppDatabase.cs4
-rw-r--r--code/api/src/Data/Enums/FulfillPasswordResetRequestResult.cs8
-rw-r--r--code/api/src/Data/Exceptions/ForgotPasswordRequestNotFoundException.cs21
-rw-r--r--code/api/src/Data/Exceptions/UserNotFoundException.cs19
5 files changed, 13 insertions, 45 deletions
diff --git a/code/api/src/Data/Database/Internal/ForgotPasswordRequest.cs b/code/api/src/Data/Database/Internal/PasswordResetRequest.cs
index 1510a35..ee73fd2 100644
--- a/code/api/src/Data/Database/Internal/ForgotPasswordRequest.cs
+++ b/code/api/src/Data/Database/Internal/PasswordResetRequest.cs
@@ -1,10 +1,10 @@
namespace IOL.GreatOffice.Api.Data.Database;
-public class ForgotPasswordRequest
+public class PasswordResetRequest
{
- public ForgotPasswordRequest() { }
+ public PasswordResetRequest() { }
- public ForgotPasswordRequest(User user) {
+ public PasswordResetRequest(User user) {
CreatedAt = AppDateTime.UtcNow;
Id = Guid.NewGuid();
User = user;
diff --git a/code/api/src/Data/Database/MainAppDatabase.cs b/code/api/src/Data/Database/MainAppDatabase.cs
index 41d62a7..fe3ed58 100644
--- a/code/api/src/Data/Database/MainAppDatabase.cs
+++ b/code/api/src/Data/Database/MainAppDatabase.cs
@@ -6,7 +6,7 @@ public class MainAppDatabase : DbContext, IDataProtectionKeyContext
{
public MainAppDatabase(DbContextOptions<MainAppDatabase> options) : base(options) { }
public DbSet<User> Users { get; set; }
- public DbSet<ForgotPasswordRequest> ForgotPasswordRequests { get; set; }
+ public DbSet<PasswordResetRequest> PasswordResetRequests { get; set; }
public DbSet<ApiAccessToken> AccessTokens { get; set; }
public DbSet<Tenant> Tenants { get; set; }
public DbSet<DataProtectionKey> DataProtectionKeys { get; set; }
@@ -27,7 +27,7 @@ public class MainAppDatabase : DbContext, IDataProtectionKeyContext
e.HasMany(n => n.Tenants);
e.ToTable("users");
});
- modelBuilder.Entity<ForgotPasswordRequest>(e => {
+ modelBuilder.Entity<PasswordResetRequest>(e => {
e.HasOne(c => c.User);
e.ToTable("forgot_password_requests");
});
diff --git a/code/api/src/Data/Enums/FulfillPasswordResetRequestResult.cs b/code/api/src/Data/Enums/FulfillPasswordResetRequestResult.cs
new file mode 100644
index 0000000..2a84c48
--- /dev/null
+++ b/code/api/src/Data/Enums/FulfillPasswordResetRequestResult.cs
@@ -0,0 +1,8 @@
+namespace IOL.GreatOffice.Api.Data.Enums;
+
+public enum FulfillPasswordResetRequestResult
+{
+ REQUEST_NOT_FOUND,
+ USER_NOT_FOUND,
+ FULFILLED
+} \ No newline at end of file
diff --git a/code/api/src/Data/Exceptions/ForgotPasswordRequestNotFoundException.cs b/code/api/src/Data/Exceptions/ForgotPasswordRequestNotFoundException.cs
deleted file mode 100644
index 02474b4..0000000
--- a/code/api/src/Data/Exceptions/ForgotPasswordRequestNotFoundException.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-namespace IOL.GreatOffice.Api.Data.Exceptions;
-
-[Serializable]
-public class ForgotPasswordRequestNotFoundException : Exception
-{
- //
- // For guidelines regarding the creation of new exception types, see
- // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp
- // and
- // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp
- //
-
- public ForgotPasswordRequestNotFoundException() { }
- public ForgotPasswordRequestNotFoundException(string message) : base(message) { }
- public ForgotPasswordRequestNotFoundException(string message, Exception inner) : base(message, inner) { }
-
- protected ForgotPasswordRequestNotFoundException(
- SerializationInfo info,
- StreamingContext context
- ) : base(info, context) { }
-}
diff --git a/code/api/src/Data/Exceptions/UserNotFoundException.cs b/code/api/src/Data/Exceptions/UserNotFoundException.cs
deleted file mode 100644
index 06b57a9..0000000
--- a/code/api/src/Data/Exceptions/UserNotFoundException.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-namespace IOL.GreatOffice.Api.Data.Exceptions;
-
-[Serializable]
-public class UserNotFoundException : Exception
-{
- // For guidelines regarding the creation of new exception types, see
- // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp
- // and
- // http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncscol/html/csharp07192001.asp
-
- public UserNotFoundException() { }
- public UserNotFoundException(string message) : base(message) { }
- public UserNotFoundException(string message, Exception inner) : base(message, inner) { }
-
- protected UserNotFoundException(
- SerializationInfo info,
- StreamingContext context
- ) : base(info, context) { }
-}