try
This commit is contained in:
19
Webshop.Application/DTOs/Auth/ChangePasswordRequestDto.cs
Normal file
19
Webshop.Application/DTOs/Auth/ChangePasswordRequestDto.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
// src/Webshop.Application/DTOs/Auth/ChangePasswordRequestDto.cs
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Webshop.Application.DTOs.Auth
|
||||
{
|
||||
public class ChangePasswordRequestDto
|
||||
{
|
||||
[Required(ErrorMessage = "Altes Passwort ist erforderlich.")]
|
||||
public string OldPassword { get; set; } = string.Empty;
|
||||
|
||||
[Required(ErrorMessage = "Neues Passwort ist erforderlich.")]
|
||||
[MinLength(6, ErrorMessage = "Passwort muss mindestens 6 Zeichen lang sein.")]
|
||||
public string NewPassword { get; set; } = string.Empty;
|
||||
|
||||
[Required(ErrorMessage = "Passwortbestätigung ist erforderlich.")]
|
||||
[Compare("NewPassword", ErrorMessage = "Neues Passwort und Bestätigung stimmen nicht überein.")]
|
||||
public string ConfirmNewPassword { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,26 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
// src/Webshop.Application/DTOs/Customers/UpdateCustomerProfileDto.cs
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Webshop.Application.DTOs.Customers
|
||||
{
|
||||
public class UpdateCustomerProfileDto
|
||||
{
|
||||
[Required(ErrorMessage = "Vorname ist erforderlich.")]
|
||||
[MaxLength(100)]
|
||||
[StringLength(100)]
|
||||
public string FirstName { get; set; } = string.Empty;
|
||||
|
||||
[Required(ErrorMessage = "Nachname ist erforderlich.")]
|
||||
[MaxLength(100)]
|
||||
[StringLength(100)]
|
||||
public string LastName { get; set; } = string.Empty;
|
||||
|
||||
|
||||
[Phone(ErrorMessage = "Ungültiges Telefonnummernformat.")]
|
||||
public string? PhoneNumber { get; set; } // Telefonnummer des Benutzers
|
||||
|
||||
[EmailAddress(ErrorMessage = "Ungültiges E-Mail-Format.")]
|
||||
public string? Email { get; set; } // E-Mail des Benutzers
|
||||
|
||||
// Optional, aber gute Sicherheitspraxis: Aktuelles Passwort zur Bestätigung sensibler Änderungen
|
||||
[Required(ErrorMessage = "Aktuelles Passwort ist zur Bestätigung erforderlich.")]
|
||||
public string CurrentPassword { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// src/Webshop.Application/DTOs/Users/AdminResetPasswordRequestDto.cs
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Webshop.Application.DTOs.Users
|
||||
{
|
||||
public class AdminResetPasswordRequestDto
|
||||
{
|
||||
[Required(ErrorMessage = "Benutzer-ID ist erforderlich.")]
|
||||
public string UserId { get; set; } = string.Empty;
|
||||
|
||||
[Required(ErrorMessage = "Neues Passwort ist erforderlich.")]
|
||||
[MinLength(6, ErrorMessage = "Passwort muss mindestens 6 Zeichen lang sein.")]
|
||||
public string NewPassword { get; set; } = string.Empty;
|
||||
|
||||
[Required(ErrorMessage = "Passwortbestätigung ist erforderlich.")]
|
||||
[Compare("NewPassword", ErrorMessage = "Neues Passwort und Bestätigung stimmen nicht überein.")]
|
||||
public string ConfirmNewPassword { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,25 @@
|
||||
// src/Webshop.Application/DTOs/Users/UserDto.cs
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Webshop.Application.DTOs.Users
|
||||
{
|
||||
public class UserDto
|
||||
{
|
||||
public string Id { get; set; } = string.Empty;
|
||||
public string Email { get; set; } = string.Empty;
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
public List<string> Roles { get; set; } = new List<string>();
|
||||
public DateTimeOffset CreatedDate { get; set; }
|
||||
public bool EmailConfirmed { get; set; }
|
||||
public string Id { get; set; } = string.Empty; // Vom ApplicationUser.Id
|
||||
public string Email { get; set; } = string.Empty; // Vom ApplicationUser.Email
|
||||
public string UserName { get; set; } = string.Empty; // Vom ApplicationUser.UserName
|
||||
public List<string> Roles { get; set; } = new List<string>(); // Aus Identity-System
|
||||
public DateTimeOffset CreatedDate { get; set; } // Vom ApplicationUser.CreatedDate
|
||||
public bool EmailConfirmed { get; set; } // Vom ApplicationUser.EmailConfirmed
|
||||
|
||||
// Hinzugef<65>gte Felder
|
||||
public DateTimeOffset? LastActive { get; set; }
|
||||
public string FirstName { get; set; } = string.Empty;
|
||||
public string LastName { get; set; } = string.Empty;
|
||||
public DateTimeOffset? LastActive { get; set; } // Vom ApplicationUser.LastActive
|
||||
public string? PhoneNumber { get; set; } // Vom ApplicationUser.PhoneNumber
|
||||
|
||||
// << NEU: Customer-Felder, die NICHT in ApplicationUser sind >>
|
||||
public string FirstName { get; set; } = string.Empty; // Vom Customer.FirstName
|
||||
public string LastName { get; set; } = string.Empty; // Vom Customer.LastName
|
||||
public Guid? DefaultShippingAddressId { get; set; } // Vom Customer
|
||||
public Guid? DefaultBillingAddressId { get; set; } // Vom Customer
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user