try
This commit is contained in:
@@ -1,25 +1,40 @@
|
||||
using System;
|
||||
|
||||
// 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; }
|
||||
[Required]
|
||||
public string AspNetUserId { get; set; }
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
public string FirstName { get; set; }
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
public string LastName { get; set; }
|
||||
public Guid Id { get; set; } = Guid.NewGuid(); // Default-Wert setzen
|
||||
|
||||
public virtual ApplicationUser User { get; set; }
|
||||
[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>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user