using gehGassi.Dto;
using gehGassiApp.Domain.Authentication;
using gehGassiApp.Domain.Common;
using gehGassiApp.Domain.Users;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace gehGassiApp.Core.Interfaces
{
///
/// Schnittstellenbeschreibung für einen Service der alle Funktionen rund um die Accountverwaltung bietet
///
public interface IAccountService
{
///
/// Prüfen ob ein Benutzername noch verfügbar ist und ob das Passwort den Regeln entspricht.
///
/// Benutzername
/// Passwort
/// CancellationToken
/// CommunicationResult
Task> RegisterCheckAvailableAsync(string userName, string password, CancellationToken token);
///
/// Prüfen ob ein Passwort den Regeln entspricht
///
/// Zu prüfendes Passwort
/// CancellationToken
/// CommunicationResult
Task> CheckPasswordAsync(string password, CancellationToken token);
///
/// Registrieren eines App-Users
///
/// Benutzername
/// Passwort
/// Land
/// CancellationToken
/// AppUser-Typ
/// Vorname
/// Nachname
/// Geburtsdatum
/// PLZ
/// Ort
/// Bundesland
/// Nationalität
/// Land Hauptwohnsitz
/// true wenn alles passt, false sonst
Task> RegisterAsync(string userName, string password, AppUserType appUserType, string firstName, string lastName, DateTimeOffset? birthDate, string zip, string city, string state, string country, string nationality, string mainResidence, CancellationToken token);
///
/// Registrieren eines App-Users - Extern
///
/// Benutzername
/// Passwort
/// Land
/// Login-Provider
/// CancellationToken
/// AppUser-Typ
/// Vorname
/// Nachname
/// Geburtsdatum
/// PLZ
/// Ort
/// Bundesland
/// Token des externen Providers
/// Nationalität
/// Land Hauptwohnsitz
/// CommunicationResult
Task> RegisterExternalAsync(string userName, string password, AppUserType appUserType, string firstName, string lastName, DateTimeOffset? birthDate, string zip, string city, string state, string country, string nationality, string mainResidence, string accessToken, string loginProvider, CancellationToken token);
///
/// Anmelden eines Benutzers
///
/// Benutzername
/// Passwort
/// CancellationToken
/// CommunicationResult
Task> LoginAsync(string userName, string password, CancellationToken token);
///
/// Anmelden eines Benutzers mittels externem Provider. Wer es ist wird über das Token bestimmt
///
/// Access-Token
/// CancellationToken
/// CommunicationResult
Task> LoginExternalAsync(string accessToken, CancellationToken token);
///
/// Anmelden eines Benutzers mittels Apple Provider
///
/// bjekt mit benötigten Login-Daten
/// CancellationToken
/// CommunicationResult
Task> LoginAppleAsync(LoginAppleDto dto, CancellationToken token);
///
/// Abmelden eines Benutzers.
/// Löscht alle Refreshtokens des Benutzers
///
/// Access-Token
/// CancellationToken
/// CommunicationResult
Task> LogoutAsync(string accessToken, CancellationToken token);
///
/// Zurücksetzen des Passworts eines Benutzers
///
/// Benutzername / Email
/// CancellationToken
/// CommunicationResult
Task> ResetPasswordAsync(string userName, CancellationToken token);
///
/// Senden der E-Mail Bestätigung für einen Benutzer
///
/// Benutzername / Email
/// CancellationToken
/// CommunicationResult
Task> ResendConfirmationAsync(string userName, CancellationToken token);
///
/// Anmelden eines Benutzers mittels Refreshtoken
///
/// Aktuelles Accesstoken
/// Refreshtoken
/// CancellationToken
/// CommunicationResult
Task> RefreshTokenAsync(string accessToken, string refreshToken, CancellationToken token);
///
/// Prüfen ob ein Benutzer ein Passwort hat
///
/// Aktuelles Accesstoken
/// CancellationToken
/// CommunicationResult
Task> HasPasswordAsync(string accessToken, CancellationToken token);
///
/// Hinzufügen eines Passswortes zu einem Benutzer, wenn dieser keines hat
///
/// Benutzername
/// Passwort das hinzugefügt werden soll
/// Aktuelles Accesstoken
/// CancellationToken
/// CommunicationResult
Task> AddPasswordAsync(string userName, string password, string accessToken, CancellationToken token);
///
/// Ändern des Passwortes eines Benutzers
///
/// Benutzername
/// Passwort das gesetzt werden soll
/// Bisheriges Passwort
/// Aktuelles Accesstoken
/// CancellationToken
/// CommunicationResult
Task> ChangePasswordAsync(string userName, string password, string oldPassword, string accessToken, CancellationToken token);
///
/// Löschen des Accounts eines Benutzers
///
/// Benutzername
/// Id des Benutzers
/// Aktuelles Accesstoken
/// CancellationToken
/// CommunicationResult
Task> DeleteAccountAsync(string userName, string userId, string accessToken, CancellationToken token);
}
}