Sign in , out ,register.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
namespace Wino.Mail.Api.Contracts.Admin;
|
||||
|
||||
public sealed record ModerateUserRequest(string ReasonCode, string? ReasonNote);
|
||||
public sealed record AdminUserResultDto(Guid UserId, string Email, string AccountStatus, DateTimeOffset CreatedUtc);
|
||||
public sealed record ModerationActionResultDto(string Action, string ReasonCode, string? ReasonNote, Guid? ActorUserId, DateTimeOffset CreatedUtc);
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Wino.Mail.Api.Contracts.Ai;
|
||||
|
||||
public sealed record SummarizeRequest(string Html);
|
||||
public sealed record TranslateRequest(string Html, string TargetLanguage);
|
||||
public sealed record RewriteRequest(string Html, string Instruction);
|
||||
public sealed record AiTextResultDto(string Text);
|
||||
public sealed record AiStatusResultDto(bool HasAiPack, string EntitlementStatus, DateTimeOffset? CurrentPeriodStartUtc, DateTimeOffset? CurrentPeriodEndUtc, int? MonthlyLimit, int? Used, int? Remaining);
|
||||
@@ -0,0 +1,11 @@
|
||||
namespace Wino.Mail.Api.Contracts.Auth;
|
||||
|
||||
public sealed record RegisterRequest(string Email, string Password);
|
||||
public sealed record LoginRequest(string Email, string Password);
|
||||
public sealed record CompleteExternalAuthRequest(string Code);
|
||||
public sealed record RefreshRequest(string RefreshToken);
|
||||
public sealed record LogoutRequest(string RefreshToken);
|
||||
public sealed record ForgotPasswordRequest(string Email);
|
||||
public sealed record ResetPasswordRequest(string Email, string ResetToken, string NewPassword);
|
||||
public sealed record AuthUserDto(Guid UserId, string Email, string AccountStatus, bool HasPassword, bool HasGoogleLogin, bool HasFacebookLogin);
|
||||
public sealed record AuthResultDto(AuthUserDto User, string AccessToken, DateTimeOffset AccessTokenExpiresAtUtc, string RefreshToken, DateTimeOffset RefreshTokenExpiresAtUtc);
|
||||
@@ -0,0 +1,4 @@
|
||||
namespace Wino.Mail.Api.Contracts.Billing;
|
||||
|
||||
public sealed record CheckoutSessionResultDto(string Url);
|
||||
public sealed record CustomerPortalResultDto(string Url);
|
||||
@@ -0,0 +1,25 @@
|
||||
namespace Wino.Mail.Api.Contracts.Common;
|
||||
|
||||
public sealed class ApiEnvelope<T>
|
||||
{
|
||||
public bool IsSuccess { get; init; }
|
||||
public string? ErrorCode { get; init; }
|
||||
public T? Result { get; init; }
|
||||
public QuotaInfoDto? Quota { get; init; }
|
||||
|
||||
public static ApiEnvelope<T> Success(T result, QuotaInfoDto? quota = null)
|
||||
=> new()
|
||||
{
|
||||
IsSuccess = true,
|
||||
Result = result,
|
||||
Quota = quota,
|
||||
};
|
||||
|
||||
public static ApiEnvelope<T> Failure(string errorCode, QuotaInfoDto? quota = null)
|
||||
=> new()
|
||||
{
|
||||
IsSuccess = false,
|
||||
ErrorCode = errorCode,
|
||||
Quota = quota,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
namespace Wino.Mail.Api.Contracts.Common;
|
||||
|
||||
public static class ApiErrorCodes
|
||||
{
|
||||
public const string InvalidCredentials = "INVALID_CREDENTIALS";
|
||||
public const string AccountLocked = "ACCOUNT_LOCKED";
|
||||
public const string AccountBanned = "ACCOUNT_BANNED";
|
||||
public const string AccountSuspended = "ACCOUNT_SUSPENDED";
|
||||
public const string RefreshTokenInvalid = "REFRESH_TOKEN_INVALID";
|
||||
public const string EmailAlreadyRegistered = "EMAIL_ALREADY_REGISTERED";
|
||||
public const string ExternalLoginEmailRequired = "EXTERNAL_LOGIN_EMAIL_REQUIRED";
|
||||
public const string ExternalLoginInvalid = "EXTERNAL_LOGIN_INVALID";
|
||||
public const string ExternalAuthStateInvalid = "EXTERNAL_AUTH_STATE_INVALID";
|
||||
public const string ExternalAuthCodeInvalid = "EXTERNAL_AUTH_CODE_INVALID";
|
||||
public const string AiPackRequired = "AI_PACK_REQUIRED";
|
||||
public const string AiQuotaExceeded = "AI_QUOTA_EXCEEDED";
|
||||
public const string AiHtmlEmpty = "AI_HTML_EMPTY";
|
||||
public const string AiHtmlTooLarge = "AI_HTML_TOO_LARGE";
|
||||
public const string AiUnsupportedLanguage = "AI_UNSUPPORTED_LANGUAGE";
|
||||
public const string AiSanitizationFailed = "AI_SANITIZATION_FAILED";
|
||||
public const string AiProviderUnavailable = "AI_PROVIDER_UNAVAILABLE";
|
||||
public const string AiRequestBlocked = "AI_REQUEST_BLOCKED";
|
||||
public const string AiInternalError = "AI_INTERNAL_ERROR";
|
||||
public const string PaddleWebhookInvalid = "PADDLE_WEBHOOK_INVALID";
|
||||
public const string Forbidden = "FORBIDDEN";
|
||||
public const string ValidationFailed = "VALIDATION_FAILED";
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace Wino.Mail.Api.Contracts.Common;
|
||||
|
||||
public sealed record QuotaInfoDto(
|
||||
bool HasAiPack,
|
||||
string EntitlementStatus,
|
||||
DateTimeOffset? CurrentPeriodStartUtc,
|
||||
DateTimeOffset? CurrentPeriodEndUtc,
|
||||
int? MonthlyLimit,
|
||||
int? Used,
|
||||
int? Remaining);
|
||||
@@ -0,0 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user