Class PriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>
Represents the data required for an order price calculation request.
public abstract record PriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto> : IPriceCalculationRequest where TPriceCalculationRequestItem : IPriceCalculationRequestItem<ProductIdentifier>, new() where TAddressDto : AddressDto
Type Parameters
TPriceCalculationRequestItemCalculation request item type.
TAddressDtoAddress for the calculation type.
- Inheritance
-
objectPriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>
- Implements
- Derived
- Extension Methods
Remarks
Inherit from this type if you need to change the TPriceCalculationRequestItem or TAddressDto generic types used in the calculation request.
If you are using the default item type (ProductIdentifier) and address type (AddressDto), inherit from PriceCalculationRequest instead.
Constructors
PriceCalculationRequestBase()
protected PriceCalculationRequestBase()
PriceCalculationRequestBase(PriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>)
protected PriceCalculationRequestBase(PriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto> original)
Parameters
originalPriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>
Properties
BillingAddress
public TAddressDto BillingAddress { get; init; }
Property Value
- TAddressDto
CalculationDate
Date and time when promotions and taxes are to be valid.
public DateTime CalculationDate { get; init; }
Property Value
- DateTime
Remarks
For most price calculations, the value is equal to the current time. When calculating prices for existing orders, the values is equal to the date and time when the order was created.
CustomerId
Identifier for the customer placing the order. May be used for customer-specific pricing, promotions, or loyalty tracking.
public int CustomerId { get; init; }
Property Value
- int
Remarks
null if the customer is not known or not provided.
EqualityContract
protected virtual Type EqualityContract { get; }
Property Value
- Type
Items
Items of calculation request.
public ICollection<TPriceCalculationRequestItem> Items { get; init; }
Property Value
- ICollection<TPriceCalculationRequestItem>
LanguageName
Language name.
public string LanguageName { get; init; }
Property Value
- string
Remarks
Used to fetch localized ProductData from the underlying product store. The language name is used for product data localization during product data retrieval via IProductDataRetriever<TProductIdentifier, TProductData>.
Mode
Mode of price calculation that should be used.
public PriceCalculationMode Mode { get; init; }
Property Value
Remarks
Describes which calculation steps should be used for price calculation. Allows to process just steps calculating prices for product catalog, shopping cart or checkut prices. Other modes can be defined which requires extending IPriceCalculationStepsProvider<TPriceCalculationRequest, TPriceCalculationResult>.Get(TPriceCalculationRequest) method.
PaymentMethodId
Identifier for the selected payment method. Can affect transaction fees or eligibility for certain promotions.
public int PaymentMethodId { get; init; }
Property Value
- int
Remarks
null if the payment method is not known or not provided.
ShippingAddress
public TAddressDto ShippingAddress { get; init; }
Property Value
- TAddressDto
ShippingMethodId
Identifier for the chosen shipping method. Used to calculate delivery costs and estimated delivery times.
public int ShippingMethodId { get; init; }
Property Value
- int
Remarks
null if the shipping method is not known or not provided.
Methods
Equals(PriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>?)
public virtual bool Equals(PriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>? other)
Parameters
otherPriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>
Returns
- bool
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
- bool
GetHashCode()
public override int GetHashCode()
Returns
- int
PrintMembers(StringBuilder)
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
- bool
ToString()
public override string ToString()
Returns
- string
Operators
operator ==(PriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>?, PriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>?)
public static bool operator ==(PriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>? left, PriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>? right)
Parameters
leftPriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>rightPriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>
Returns
- bool
operator !=(PriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>?, PriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>?)
public static bool operator !=(PriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>? left, PriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>? right)
Parameters
leftPriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>rightPriceCalculationRequestBase<TPriceCalculationRequestItem, TAddressDto>
Returns
- bool