Table of Contents

Class Product

Namespace
arolariu.Backend.Domain.Invoices.DDD.ValueObjects.Products
Assembly
arolariu.Backend.Domain.Invoices.dll

The invoice item record represents a single item from the invoice. This record is used to store the invoice item information in the database. The invoice item information is extracted from the invoice image using the OCR service.

[Owned]
public class Product
Inheritance
Product
Inherited Members

Properties

Category

The invoice item category. See ProductCategory for the available categories.

[JsonPropertyOrder(2)]
public ProductCategory Category { get; set; }

Property Value

ProductCategory

DetectedAllergens

The product's detected allergens.

[JsonPropertyOrder(7)]
public IEnumerable<Allergen> DetectedAllergens { get; set; }

Property Value

IEnumerable<Allergen>

GenericName

The invoice item generic name (from "MONSTER ENERGY DRINK 50ML" to "ENERGY DRINK"). The generic name thus represents a more general name for the item.

[JsonPropertyOrder(1)]
public string GenericName { get; set; }

Property Value

string

Metadata

Product metadata.

[JsonPropertyOrder(8)]
public ProductMetadata Metadata { get; set; }

Property Value

ProductMetadata

Price

The item's price; this field is marked as string since some items can have a price range (e.g. 1.99 - 2.99) or a price per unit (e.g. 1.99 / kg). The price is represents the price of a single item.

[JsonPropertyOrder(6)]
public decimal Price { get; set; }

Property Value

decimal

ProductCode

The item's product code (or SKU). The product code is a unique identifier for the item. This field is optional.

[JsonPropertyOrder(5)]
public string ProductCode { get; set; }

Property Value

string

Quantity

The item quantity.

[JsonPropertyOrder(3)]
public decimal Quantity { get; set; }

Property Value

decimal

QuantityUnit

The item quantity unit (e.g. kg, ml). The quantity unit is the unit of measurement for the item quantity. This field is optional.

[JsonPropertyOrder(4)]
public string QuantityUnit { get; set; }

Property Value

string

RawName

The invoice item raw name (as seen on the digital invoice). The raw name is the name of the item as seen on the invoice.

[JsonPropertyOrder(0)]
public string RawName { get; set; }

Property Value

string

TotalPrice

The total price of the item, (Total = quantity x price).

[JsonIgnore]
public decimal TotalPrice { get; }

Property Value

decimal