Files

22 lines
824 B
C#
Raw Permalink Normal View History

2026-06-01 22:08:43 +03:30
namespace AsadiTools.Models;
public class Product
{
public int Id { get; set; }
public string NameFa { get; set; } = string.Empty;
public string? NameEn { get; set; }
public string? Description { get; set; }
public decimal Price { get; set; }
public decimal? DiscountPrice { get; set; }
public string Category { get; set; } = string.Empty;
public string? Brand { get; set; }
public string? Sku { get; set; }
public int Stock { get; set; }
public bool IsActive { get; set; } = true;
public string? ImageUrl { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.Now;
public decimal FinalPrice => DiscountPrice.HasValue && DiscountPrice < Price ? DiscountPrice.Value : Price;
public bool HasDiscount => DiscountPrice.HasValue && DiscountPrice < Price;
}