littleshop/LittleShop/Models/Product.cs
SysAdmin e1b377a042 Initial commit of LittleShop project (excluding large archives)
- BTCPay Server integration
- TeleBot Telegram bot
- Review system
- Admin area
- Docker deployment configuration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-17 15:07:38 +01:00

41 lines
1.3 KiB
C#

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using LittleShop.Enums;
namespace LittleShop.Models;
public class Product
{
[Key]
public Guid Id { get; set; }
[Required]
[StringLength(200)]
public string Name { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
[Column(TypeName = "decimal(18,2)")]
public decimal Price { get; set; }
[Column(TypeName = "decimal(18,4)")]
public decimal Weight { get; set; }
public ProductWeightUnit WeightUnit { get; set; } = ProductWeightUnit.Kilogram;
public int StockQuantity { get; set; } = 0;
public Guid CategoryId { get; set; }
public bool IsActive { get; set; } = true;
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
// Navigation properties
public virtual Category Category { get; set; } = null!;
public virtual ICollection<ProductPhoto> Photos { get; set; } = new List<ProductPhoto>();
public virtual ICollection<OrderItem> OrderItems { get; set; } = new List<OrderItem>();
public virtual ICollection<Review> Reviews { get; set; } = new List<Review>();
}