Class PreorderProcessor
Handles the processing of preorder request items.
Inherited Members
Namespace: Mediachase.Commerce.InventoryService.BusinessLogic
Assembly: Mediachase.Commerce.dll
Version: 12.17.2Syntax
public class PreorderProcessor : RequestItemProcessor
Constructors
PreorderProcessor(InventoryRequest, InventoryRequestItem, OperationKeySerializer, RecordState)
Creates a new instance of PreorderProcessor for a a request item that is already being processed. This is used by the PurchaseOrPreorderProcessor when the item will be processed as a preorder.
Declaration
public PreorderProcessor(InventoryRequest request, InventoryRequestItem requestItem, OperationKeySerializer operationKeySerializer, RecordState recordState)
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. |
RecordState | recordState | The RecordState value for the request. |
PreorderProcessor(InventoryRequest, InventoryRequestItem, OperationKeySerializer, RecordStateSet)
Creates a new instance of PreorderProcessor.
Declaration
public PreorderProcessor(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 preorder request item will be marked as a failure if the request date is before PreorderAvailableUtc or on or after PurchaseAvailableUtc, if the catalog entry is not found, or if the warehouse cannot be determined.
Otherwise, the requested quantity will be decremented from both PurchaseAvailableQuantity and PreorderAvailableQuantity; and added to PreorderRequestedQuantity.
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 preorder request item will be successful if the conditions in Apply() are met, and the final PreorderAvailableQuantity is greater than or equal to zero.
Note that the PurchaseAvailableQuantity is permitted to become negative. This permits preorders for items that are not yet listed as in stock, while also allowing preorder reqeuests to decrement from available stock when the store has the items but is not yet permitted to sell them.