arolariu.Backend.Domain.Invoices.DDD.ValueObjects
arolariu.Backend.Domain.Invoices
arolariu.Backend.Domain.Invoices.DDD.ValueObjects Namespace
Classes
Allergen Class
Represents an identified or inferred allergen associated with an invoice product line.
public sealed record Allergen : System.IEquatable<arolariu.Backend.Domain.Invoices.DDD.ValueObjects.Allergen>
Inheritance System.Object 🡒 Allergen
Implements System.IEquatable<Allergen>
Remarks
Captures canonical allergen taxonomy information used for dietary risk surfacing, recipe suitability filtering and future health profile personalization.
Mutation: Instances are mutable for progressive enrichment (name normalization, description augmentation, documentation link updates).
Thread-safety: Not thread-safe. Treat each instance as aggregate-scoped.
Properties
Allergen.Description Property
Human-readable descriptive context for the allergen.
public string Description { get; set; }
Property Value
Remarks
Intended for UI tooltips and accessibility narration. MAY be empty if not yet enriched.
Allergen.LearnMoreAddress Property
Reference URI for authoritative or supplemental allergen information.
public System.Uri LearnMoreAddress { get; set; }
Property Value
Remarks
Defaults to project documentation site. SHOULD be replaced with domain knowledge base / medical authority link when available.
Allergen.Name Property
Canonical allergen display name (e.g. "Peanuts", "Gluten").
public string Name { get; set; }
Property Value
Remarks
Empty string denotes unresolved extraction; SHOULD be populated by enrichment pipeline.
PaymentDetail Class
Represents a single payment method and amount used in a transaction.
public sealed record PaymentDetail : System.IEquatable<arolariu.Backend.Domain.Invoices.DDD.ValueObjects.PaymentDetail>
Inheritance System.Object 🡒 PaymentDetail
Implements System.IEquatable<PaymentDetail>
Remarks
Receipts may record multiple payment methods (e.g., partial cash + card).
Each PaymentDetail captures one method and its amount.
Source: Azure Document Intelligence v4.0 prebuilt-receipt model — Payments array field.
Properties
PaymentDetail.Amount Property
The amount paid via this method.
public decimal Amount { get; set; }
Property Value
PaymentDetail.Method Property
The payment method (e.g., "Cash", "Credit Card", "Debit Card", "Mobile Payment").
public string Method { get; set; }
Property Value
PaymentInformation Class
Value object capturing transactional payment attributes associated with an invoice.
public sealed record PaymentInformation : System.IEquatable<arolariu.Backend.Domain.Invoices.DDD.ValueObjects.PaymentInformation>
Inheritance System.Object 🡒 PaymentInformation
Implements System.IEquatable<PaymentInformation>
Remarks
Encapsulates temporal data (TransactionDate), tender metadata (PaymentType), monetary breakdown (TotalCostAmount, TotalTaxAmount)
and currency context (Currency).
Mutability: Mutable to allow progressive enrichment (post-OCR correction, currency normalization). Treated as an owned value object in persistence.
Time Zone:TransactionDate currently seeded with local system time via System.DateTimeOffset.Now; consider migrating to System.DateTimeOffset.UtcNow
to prevent cross-time zone skew.
Thread-safety: Not thread-safe; confine to aggregate mutation scope.
Properties
PaymentInformation.Currency Property
Original settlement currency.
public arolariu.Backend.Common.DDD.ValueObjects.Currency Currency { get; set; }
Property Value
arolariu.Backend.Common.DDD.ValueObjects.Currency
Remarks
Represents ISO-like metadata (name, code, symbol). Values SHOULD remain stable for historical financial accuracy.
PaymentInformation.PaymentType Property
Mode / instrument used to settle the transaction.
public arolariu.Backend.Domain.Invoices.DDD.ValueObjects.PaymentType PaymentType { get; set; }
Property Value
Remarks
Defaults to UNKNOWN when not inferable from OCR or receipt metadata.
PaymentInformation.SubtotalAmount Property
Pre-tax subtotal amount in Currency.
public decimal SubtotalAmount { get; set; }
Property Value
Remarks
Extracted from Document Intelligence Subtotal field. Zero when not available on receipt.
PaymentInformation.TipAmount Property
Tip / gratuity amount in Currency.
public decimal TipAmount { get; set; }
Property Value
Remarks
Extracted from Document Intelligence Tip field. Common on restaurant and service receipts.
PaymentInformation.TotalCostAmount Property
Gross total payable amount (inclusive of tax) expressed in Currency.
public decimal TotalCostAmount { get; set; }
Property Value
Remarks
Non-negative. Zero indicates incomplete enrichment or parsing failure.
PaymentInformation.TotalTaxAmount Property
Tax component of the total amount in Currency.
public decimal TotalTaxAmount { get; set; }
Property Value
Remarks
May be zero for tax-exempt purchases or when parsing failed to isolate tax line items.
PaymentInformation.TransactionDate Property
Point-in-time at which the purchase was executed (store local time).
public System.DateTimeOffset TransactionDate { get; set; }
Property Value
Remarks
May differ from ingestion time. Use for chronological analytics and interval bucketing.
Recipe Class
Recipe model.
public sealed record Recipe : System.IEquatable<arolariu.Backend.Domain.Invoices.DDD.ValueObjects.Recipe>
Inheritance System.Object 🡒 Recipe
Implements System.IEquatable<Recipe>
Constructors
Recipe() Constructor
Parameterless constructor.
public Recipe();
Recipe(string, string, int, RecipeComplexity, ICollection<string>, Uri) Constructor
Parameterized constructor.
public Recipe(string name, string description, int approximateTotalDuration, arolariu.Backend.Domain.Invoices.DDD.ValueObjects.RecipeComplexity complexity, System.Collections.Generic.ICollection<string> ingredients, System.Uri referenceForMoreDetails);
Parameters
name System.String
description System.String
approximateTotalDuration System.Int32
complexity RecipeComplexity
ingredients System.Collections.Generic.ICollection<System.String>
referenceForMoreDetails System.Uri
Properties
Recipe.ApproximateTotalDuration Property
The recipe estimated duration.
public int ApproximateTotalDuration { get; set; }
Property Value
Recipe.Complexity Property
The recipe complexity.
public arolariu.Backend.Domain.Invoices.DDD.ValueObjects.RecipeComplexity Complexity { get; set; }
Property Value
Recipe.Description Property
The recipe description.
public string Description { get; set; }
Property Value
Recipe.Ingredients Property
The recipe ingredients.
public System.Collections.Generic.ICollection<string> Ingredients { get; init; }
Property Value
System.Collections.Generic.ICollection<System.String>
Recipe.Name Property
The recipe name.
public string Name { get; set; }
Property Value
Recipe.ReferenceForMoreDetails Property
The recipe learn more address.
public System.Uri ReferenceForMoreDetails { get; set; }
Property Value
TaxDetail Class
Represents a single tax line item extracted from a receipt via Document Intelligence.
public sealed record TaxDetail : System.IEquatable<arolariu.Backend.Domain.Invoices.DDD.ValueObjects.TaxDetail>
Inheritance System.Object 🡒 TaxDetail
Implements System.IEquatable<TaxDetail>
Remarks
Receipts may contain multiple tax lines (e.g., VAT, sales tax, service tax).
Each TaxDetail captures the amount, rate, net amount, and description for one tax entry.
Source: Azure Document Intelligence v4.0 prebuilt-receipt model — TaxDetails array field.
Properties
TaxDetail.Amount Property
The tax amount for this line.
public decimal Amount { get; set; }
Property Value
TaxDetail.Description Property
Description of the tax type (e.g., "VAT", "Sales Tax", "Service Tax").
public string Description { get; set; }
Property Value
TaxDetail.NetAmount Property
The net amount before this tax was applied.
public decimal NetAmount { get; set; }
Property Value
TaxDetail.Rate Property
The tax rate as a percentage (e.g., 19 for 19% VAT).
public decimal Rate { get; set; }
Property Value
Enums
PaymentType Enum
Enumerates supported payment settlement methods.
public enum PaymentType
Fields
UNKNOWN 0
Sentinel; payment method not resolved from source.
CASH 100
Physical cash tender.
CARD 200
Payment card (credit / debit).
TRANSFER 300
Bank (wire / ACH / SEPA-like) transfer.
MOBILEPAYMENT 400
Mobile wallet / NFC application (e.g. device-based tokenized payment).
VOUCHER 500
Voucher / coupon / prepaid certificate redemption.
Other 9999
Fallback when no defined payment method applies.
Remarks
Extensibility: Reserve numeric spacing (increments of 100) for future methods; sentinel UNKNOWN indicates unresolved extraction.
Analytics: Drives spend channel distribution reporting and potential loyalty program inference.
RecipeComplexity Enum
The recipe complexity enumeration.
public enum RecipeComplexity
Fields
UNKNOWN 0
The recipe complexity is unknown.
EASY 1
The recipe is easy to prepare.
NORMAL 2
The recipe is normal to prepare.
HARD 3
The recipe is hard to prepare.