InitEshop+ddd+ca

This commit is contained in:
Matěj Kubíček
2026-07-16 18:33:05 +02:00
parent ffd8a087c8
commit 7e080eaef9
144 changed files with 972 additions and 1339 deletions
@@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
namespace Eshop.Web.ViewModels;
public class AuthLoginViewModel
{
[Required(ErrorMessage = "Email or username is required")]
[Display(Name = "Email or Username")]
public string EmailOrUsername { get; set; } = "";
[Display(Name = "Password")]
[DataType(DataType.Password)]
[Required] [MinLength(4)]
public string Password { get; set; }
[Display(Name = "Remember me?")]
public bool RememberMe { get; set; } = false;
public string? ReturnUrl { get; set; }
}
@@ -0,0 +1,21 @@
using System.ComponentModel.DataAnnotations;
namespace Eshop.Web.ViewModels;
public class AuthRegisterViewModel
{
[Required] [Display(Name = "Username")] [StringLength(50, MinimumLength = 3)]
public string UserName { get; set; }
[Required] [EmailAddress] [Display(Name = "Email")]
public string Email { get; set; }
[Required] [DataType(DataType.Password)] [Display(Name = "Password")]
public string Password { get; set; }
[Display(Name = "Confirm password")]
[Required] [DataType(DataType.Password)] [Compare("Password")]
public string ConfirmPassword { get; set; }
public string? ReturnUrl { get; set; }
}
@@ -0,0 +1,8 @@
namespace Eshop.Web.ViewModels;
public class ErrorViewModel
{
public string? RequestId { get; set; }
public bool ShowRequestId => !string.IsNullOrEmpty(RequestId);
}
@@ -0,0 +1,29 @@
using System.ComponentModel.DataAnnotations;
namespace Eshop.Web.ViewModels;
public class ProfileViewModel
{
[Required]
[Display(Name = "Username")]
[StringLength(50, MinimumLength = 3)]
public string UserName { get; set; } = string.Empty;
[Required]
[EmailAddress]
[Display(Name = "Email")]
public string Email { get; set; } = string.Empty;
[DataType(DataType.Password)]
[Display(Name = "Current Password")]
public string? CurrentPassword { get; set; }
[DataType(DataType.Password)]
[Display(Name = "New Password (leave blank to keep current)")]
public string? NewPassword { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm New Password")]
[Compare("NewPassword")]
public string? ConfirmPassword { get; set; }
}