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,46 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Webshop.Domain.Entities;
/// <summary>
/// Für Produkte mit unterschiedlichen Attributen (z.B. Größe, Farbe) und eigenem Lagerbestand.
/// </summary>
public class ProductVariant
{
[Key]
public Guid Id { get; set; }
[Required]
[ForeignKey(nameof(Product))]
public Guid ProductId { get; set; }
[Required]
[MaxLength(100)]
public string Name { get; set; } // z.B. "Farbe", "Größe"
[Required]
[MaxLength(100)]
public string Value { get; set; } // z.B. "Rot", "XL"
// Unique-Constraint wird typischerweise via Fluent API konfiguriert
[MaxLength(50)]
public string? SKU { get; set; }
// Precision wird via Fluent API konfiguriert
[Required]
public decimal PriceAdjustment { get; set; }
[Required]
public int StockQuantity { get; set; }
[MaxLength(2000)]
public string? ImageUrl { get; set; }
[Required]
public bool IsActive { get; set; }
// Navigation Property
public virtual Product Product { get; set; }
}