November Happy Hour will be moved to Thursday December 5th.

Class BackorderProcessor

Handles the processing of backorder request items.

Inheritance
System.Object
BackorderProcessor
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.Commerce.InventoryService.BusinessLogic
Assembly: Mediachase.Commerce.dll
Version: 12.17.2
Syntax
public class BackorderProcessor : RequestItemProcessor

Constructors

BackorderProcessor(InventoryRequest, InventoryRequestItem, OperationKeySerializer, RecordStateSet)

Creates a new instance of BackorderProcessor.

Declaration
public BackorderProcessor(InventoryRequest request, InventoryRequestItem requestItem, OperationKeySerializer operationKeySerializer, RecordStateSet recordStateSet)
Parameters
Type Name Description
InventoryRequest request

The request containing the item to process.

InventoryRequestItem requestItem

The request item to process.

OperationKeySerializer operationKeySerializer

The OperationKeySerializer for encoding and decoding operation keys.

RecordStateSet recordStateSet

The collection of RecordState values for the request.

Methods

Apply()

Applies the request item to the appropriate RecordState.

Declaration
public override void Apply()
Overrides
Remarks

The backorder request item will be marked as a failure if the request date is before either PurchaseAvailableUtc or BackorderAvailableUtc, of if IsTracked is false (untracked items cannot be out of stock, so they cannot be backordered).

Successful backorders will apply quantity changes from GetPostValidateChanges().

GetPostValidateChanges()

Returns the changes applied by the request item.

Declaration
public override IEnumerable<InventoryChange> GetPostValidateChanges()
Returns
Type Description
System.Collections.Generic.IEnumerable<InventoryChange>
Overrides
Remarks

Successful backorder requests move quantity from BackorderAvailableQuantity to BackorderRequestedQuantity.

Backorder requests apply changes after validation because the BackorderAvailableQuantity value is permitted to go into the negative. If one backorder quantity is available, and a request contains two items backordering five each, the request should succeed -- backorder available is a soft limit since it is not a paid promise to purchase; it is more of a suggestion that the item is in demand. The changes are applied after validation so that the Validate() can verify that the original available quantity is greater than zero, and not that the final available quantity is greater than zero.

GetResponseItems(Boolean)

Returns the final InventoryResponseItem instances for the item (typically, only one unless the operation is a split). CreateDefaultResponseItem(InventoryRequestItem, Boolean, RecordState, String, InventoryResponseType, InventoryResponseTypeInfo) can be used to generate response items in most cases.

Declaration
public override InventoryResponseItem[] GetResponseItems(bool isOverallSuccess)
Parameters
Type Name Description
System.Boolean isOverallSuccess

True if all items wer successful, false if any item returned false from Validate().

Returns
Type Description
InventoryResponseItem[]
Overrides

Validate()

Validates that the request item is successful.

Declaration
public override bool Validate()
Returns
Type Description
System.Boolean

True if the request item is successful; otherwise, false.

Overrides
Remarks

The backorder request item will be successful if the conditions in Apply() are met, and BackorderAvailableQuantity is greater than zero at the beginning of the request.