This commit is contained in:
Tizian.Breuch
2025-07-22 17:09:38 +02:00
parent 5568574d9c
commit 0cbf088747
16 changed files with 429 additions and 57 deletions

View File

@@ -0,0 +1,56 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Webshop.Domain.Entities;
/// <summary>
/// Verwendet für Kundenadressen, Rechnungs- und Lieferadressen von Bestellungen oder Lieferanten.
/// </summary>
public class Address
{
[Key]
public Guid Id { get; set; }
[ForeignKey(nameof(Customer))]
public Guid? CustomerId { get; set; }
[MaxLength(50)]
public string? AddressType { get; set; } // z.B. "Billing", "Shipping"
[Required]
[MaxLength(255)]
public string Street { get; set; }
[MaxLength(255)]
public string? Street2 { get; set; }
[Required]
[MaxLength(100)]
public string City { get; set; }
[MaxLength(100)]
public string? State { get; set; }
[Required]
[MaxLength(20)]
public string PostalCode { get; set; }
[Required]
[MaxLength(100)]
public string Country { get; set; }
[MaxLength(255)]
public string? CompanyName { get; set; }
[Required]
[MaxLength(100)]
public string FirstName { get; set; }
[Required]
[MaxLength(100)]
public string LastName { get; set; }
// Navigation Property
public virtual Customer? Customer { get; set; }
}