Projektdateien hinzufügen.

This commit is contained in:
Webtree-design
2025-07-21 20:17:52 +02:00
parent b5367c704f
commit 16d38a8f39
44 changed files with 4613 additions and 0 deletions

View File

@@ -0,0 +1,90 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Webshop.Domain.Entities;
/// <summary>
/// Die Details jeder Kundenbestellung, inklusive Gastbestellungen.
/// </summary>
public class Order
{
[Key]
public Guid Id { get; set; }
// Unique-Constraint wird via Fluent API konfiguriert
[Required]
[MaxLength(50)]
public string OrderNumber { get; set; }
[ForeignKey(nameof(Customer))]
public Guid? CustomerId { get; set; }
[MaxLength(256)]
[EmailAddress]
public string? GuestEmail { get; set; }
[MaxLength(20)]
[Phone]
public string? GuestPhoneNumber { get; set; }
[Required]
public DateTimeOffset OrderDate { get; set; }
[Required]
[MaxLength(50)]
public string OrderStatus { get; set; }
// Precision wird via Fluent API konfiguriert
[Required]
public decimal OrderTotal { get; set; }
[Required]
public decimal ShippingCost { get; set; }
[Required]
public decimal TaxAmount { get; set; }
[Required]
public decimal DiscountAmount { get; set; }
[Required]
[MaxLength(50)]
public string PaymentStatus { get; set; }
[Required]
[MaxLength(100)]
public string PaymentMethod { get; set; }
[ForeignKey(nameof(PaymentMethodInfo))]
public Guid? PaymentMethodId { get; set; }
[ForeignKey(nameof(ShippingMethodInfo))]
public Guid? ShippingMethodId { get; set; }
[MaxLength(255)]
public string? TransactionId { get; set; }
[Required]
[ForeignKey(nameof(BillingAddress))]
public Guid BillingAddressId { get; set; }
[Required]
[ForeignKey(nameof(ShippingAddress))]
public Guid ShippingAddressId { get; set; }
[MaxLength(1000)]
public string? CustomerNotes { get; set; }
[MaxLength(1000)]
public string? AdminNotes { get; set; }
// Navigation Properties
public virtual Customer? Customer { get; set; }
public virtual Address BillingAddress { get; set; }
public virtual Address ShippingAddress { get; set; }
public virtual PaymentMethod? PaymentMethodInfo { get; set; }
public virtual ShippingMethod? ShippingMethodInfo { get; set; }
public virtual ICollection<OrderItem> OrderItems { get; set; } = new List<OrderItem>();
}