using System; using System.Collections.Generic; using eprintServer.Entities; using eprintServer.Enums; namespace eprintServer.Responses; public class SellableProductResponse { public int Id { get; set; } public double Price { get; set; } public double StockQuantity { get; set; } // REMOVED: public SellableProductCategoryEnum Category { get; set; } public SellableProductStatusEnum Status { get; set; } public FileModel? Image { get; set; } public DateTime CreatedAt { get; set; } public DateTime UpdatedAt { get; set; } // NEW: Related Category ID public long CategoryId { get; set; } // NEW: Transient Category Name (Localized Name List) public List CategoryName { get; set; } = new List(); public List Names { get; set; } = new(); public List Descriptions { get; set; } = new(); public static SellableProductResponse FromEntity(SellableProduct product) => new() { Id = product.Id, Price = product.Price, StockQuantity = product.StockQuantity, // NOTE: Category enum removed from mapping Status = product.Status, Image = product.Image, CreatedAt = product.CreatedAt, UpdatedAt = product.UpdatedAt, // New fields CategoryId = product.CategoryId, CategoryName = product.CategoryName , Names = product.Names ?? new List(), Descriptions = product.Descriptions ?? new List(), }; } public class ProductImageUploadResponse { public FileModel? Image { get; set; } public ProductImageUploadResponse(FileModel image) { Image = image; } }