I have products saved in my database that my system fetches with the following structure:
public class OriginalProduct {
public string Id { get; set; }
public string Name { get;set; }
}
I need to enrich the product with additional fields like a price, stock level, images, description etc. These are all fetched from different third party sources.
Would it make sense to create a "complete" product, e.g.
public class Product {
public string Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public Price Price { get; set; }
public Stock StockLevel { get; set; }
public IEnumerable<Image> Images { get; set; }
}
and use a chain of decorators using the decorator pattern to populate the fields, using the original product as input?