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,55 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Webshop.Domain.Entities;
/// <summary>
/// Verwaltung von Rabatten auf Produkte oder Kategorien.
/// </summary>
public class Discount
{
[Key]
public Guid Id { get; set; }
[Required]
[MaxLength(255)]
public string Name { get; set; }
[Required]
[MaxLength(50)]
public string DiscountType { get; set; } // "Percentage", "FixedAmount"
// Precision wird via Fluent API konfiguriert
[Required]
public decimal DiscountValue { get; set; }
[Required]
public DateTimeOffset StartDate { get; set; }
public DateTimeOffset? EndDate { get; set; }
[Required]
public bool IsActive { get; set; }
[Required]
public bool RequiresCouponCode { get; set; }
// Unique-Constraint wird via Fluent API konfiguriert
[MaxLength(50)]
public string? CouponCode { get; set; }
public decimal? MinimumOrderAmount { get; set; }
public int? MaximumUsageCount { get; set; }
[Required]
public int CurrentUsageCount { get; set; }
[MaxLength(1000)]
public string? Description { get; set; }
// Navigation Properties
public virtual ICollection<ProductDiscount> ProductDiscounts { get; set; } = new List<ProductDiscount>();
public virtual ICollection<CategoryDiscount> CategoryDiscounts { get; set; } = new List<CategoryDiscount>();
}