summaryrefslogtreecommitdiffstats
path: root/src/Services/Interfaces
diff options
context:
space:
mode:
authorivar <i@oiee.no>2025-10-19 23:41:23 +0200
committerivar <i@oiee.no>2025-10-19 23:41:23 +0200
commit3f4c0720e1e3421431e7baa20882a4a4512a7fab (patch)
tree734ca81d7d0841d8863e3f523ebba14c282dc681 /src/Services/Interfaces
downloadfagprove-master.tar.xz
fagprove-master.zip
InitialHEADmaster
Diffstat (limited to 'src/Services/Interfaces')
-rw-r--r--src/Services/Interfaces/IAppReservationService.cs29
-rw-r--r--src/Services/Interfaces/IUserService.cs28
2 files changed, 57 insertions, 0 deletions
diff --git a/src/Services/Interfaces/IAppReservationService.cs b/src/Services/Interfaces/IAppReservationService.cs
new file mode 100644
index 0000000..cf41480
--- /dev/null
+++ b/src/Services/Interfaces/IAppReservationService.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Threading.Tasks;
+using IOL.Fagprove.Data.Models;
+
+namespace IOL.Fagprove.Services.Interfaces
+{
+ public interface IAppReservationService
+ {
+ /// <summary>
+ /// Check current reservations to determine if provided reservation is possible to make.
+ /// </summary>
+ /// <param name="reservation">Reservation to check.</param>
+ /// <returns>Boolean indicating if the reservation is possible or not</returns>
+ bool ReservationIsPossible(Reservation reservation);
+ /// <summary>
+ /// Sends a status mail to the user that created provided reservation.
+ /// The contents of the message is determined by the provided reservation status.
+ /// </summary>
+ /// <param name="reservation">Reservation to send email on.</param>
+ /// <returns>Boolean indicating if the status mail was sent.</returns>
+ bool SendReservationStatusMail(Reservation reservation);
+ /// <summary>
+ /// Determines if the provided reservation is valid and can be saved to db.
+ /// </summary>
+ /// <param name="reservation">Reservation to check.</param>
+ /// <returns>Boolean indicating if the reservation is valid or not.</returns>
+ bool ReservationIsValid(Reservation reservation);
+ }
+} \ No newline at end of file
diff --git a/src/Services/Interfaces/IUserService.cs b/src/Services/Interfaces/IUserService.cs
new file mode 100644
index 0000000..f315c24
--- /dev/null
+++ b/src/Services/Interfaces/IUserService.cs
@@ -0,0 +1,28 @@
+using IOL.Fagprove.Data.Models;
+using IOL.Fagprove.Data.DTOs;
+
+namespace IOL.Fagprove.Services.Interfaces
+{
+ public interface IUserService
+ {
+ /// <summary>
+ /// Sends welcome mail to the provided user.
+ /// </summary>
+ /// <param name="user">User to send mail to.</param>
+ /// <returns>Boolean indicating if the mail was sent or not.</returns>
+ bool SetTemporaryPasswordAndSendWelcomeMail(User user);
+ /// <summary>
+ /// Creates and sets a new temporary password on a user.
+ /// </summary>
+ /// <param name="user">User to work on.</param>
+ /// <returns>Returns the password or default if the task was unsuccesful.</returns>
+ bool SetNewTemporaryPasswordAndNotifyUser(User user);
+ /// <summary>
+ /// Updates the provided users password with the provided password.
+ /// </summary>
+ /// <param name="user">User to update.</param>
+ /// <param name="password">Unhashed new password.</param>
+ /// <returns>Boolean indicating if the new password was set and saved to the database.</returns>
+ bool UpdatePassword(User user, string password);
+ }
+} \ No newline at end of file