Initial commit: Lagerbestand Blazor Projekt

This commit is contained in:
spaethf committed 2026-09-21 21:28:23 +02:00
commit cba9414e92
105 files changed
+36431

No files matched your search

+71
View File
@@ -0,0 +1,71 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace Lagerbestand.Models;
/// <summary>
/// Type of catalog item
/// </summary>
public enum CatalogItemType
{
/// <summary>
/// Tire category
/// </summary>
Reifen = 0,
/// <summary>
/// Rim/wheel category
/// </summary>
Felgen = 1
}
public class CatalogItem
{
[Key]
public Guid Id { get; set; } = Guid.NewGuid();
[Required]
[MaxLength(200)]
public string Name { get; set; } = string.Empty;
[MaxLength(500)]
public string? PictureFileName { get; set; }
/// <summary>
/// Size info - tire size for Reifen (e.g., "225/45 R17"), rim size for Felgen (e.g., "17 Zoll")
/// </summary>
[MaxLength(50)]
public string TireSize { get; set; } = string.Empty;
public TireSeason Season { get; set; } = TireSeason.Sommer;
/// <summary>
/// Category type (Reifen or Felgen)
/// </summary>
public CatalogItemType Type { get; set; } = CatalogItemType.Reifen;
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime? UpdatedAt { get; set; }
/// <summary>
/// Display label for the size field based on type
/// </summary>
[NotMapped]
public string SizeLabel => Type == CatalogItemType.Felgen ? "Felgengröße" : "Reifengröße";
/// <summary>
/// Display details string
/// </summary>
[NotMapped]
public string DisplayDetails => Type == CatalogItemType.Felgen
? TireSize
: $"{TireSize} | {Season}";
}
public enum TireSeason
{
Sommer = 0,
Winter = 1,
Allrad = 2
}