Files
ShopSolution-backend/Webshop.Domain/Entities/Customer.cs
Tizian.Breuch c1ee56c81c try
2025-07-29 14:04:35 +02:00

40 lines
1.5 KiB
C#

// src/Webshop.Domain/Entities/Customer.cs
using System;
using System.ComponentModel.DataAnnotations;
using System.Collections.Generic;
using Webshop.Domain.Identity; // Für ApplicationUser
namespace Webshop.Domain.Entities
{
public class Customer
{
[Key]
public Guid Id { get; set; } = Guid.NewGuid(); // Default-Wert setzen
[Required]
public string AspNetUserId { get; set; } // Fremdschlüssel zu ApplicationUser.Id
[Required]
[MaxLength(100)]
public string FirstName { get; set; } = string.Empty;
[Required]
[MaxLength(100)]
public string LastName { get; set; } = string.Empty;
// << ENTFERNT: Email ist auf ApplicationUser >>
// << ENTFERNT: PhoneNumber ist auf ApplicationUser >>
// << ENTFERNT: CreatedDate ist auf ApplicationUser >>
public Guid? DefaultShippingAddressId { get; set; } // Fremdschlüssel zur Standardversandadresse
public Guid? DefaultBillingAddressId { get; set; } // Fremdschlüssel zur Standardrechnungsadresse
// Navigation Property zum ApplicationUser
public virtual ApplicationUser User { get; set; } = default!; // Muss auf ApplicationUser verweisen
// Navigation Properties zu Collections
public virtual ICollection<Address> Addresses { get; set; } = new List<Address>();
public virtual ICollection<Order> Orders { get; set; } = new List<Order>();
public virtual ICollection<Review> Reviews { get; set; } = new List<Review>();
}
}