Class PurchaseOrPreorderProcessor
Handles the processing of purchase or preorder request items.
Inherited Members
Namespace: Mediachase.Commerce.InventoryService.BusinessLogic
Assembly: Mediachase.Commerce.dll
Version: 12.17.2Syntax
public class PurchaseOrPreorderProcessor : RequestItemProcessor
Constructors
PurchaseOrPreorderProcessor(InventoryRequest, InventoryRequestItem, OperationKeySerializer, RecordStateSet)
Creates a new instance of PurchaseOrPreorderProcessor.
Declaration
public PurchaseOrPreorderProcessor(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 purchase or preorder request item will be marked as a failure if the request date is before both PreorderAvailableUtc and PurchaseAvailableUtc, if the catalog entry is not found, or if the warehouse cannot be determined.
Otherwise, the request date will be evaluated against PreorderAvailableUtc and PurchaseAvailableUtc, and the request will be delegated to a PurchaseProcessor or PreorderProcessor as appropriate.
GetResponseItems(Boolean)
Creates the reponse item. Successful requests of type PurchaseOrPreorder will also set ResponseTypeInfo to indicate if the result is a preorder or a purchase.
Declaration
public override InventoryResponseItem[] GetResponseItems(bool isOverallSuccess)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isOverallSuccess | True if all items in the request succeeded, otherwise false. |
Returns
Type | Description |
---|---|
InventoryResponseItem[] | A single InventoryResponseItem representing the result of this request item. |
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
If the conditions in Apply() are not met, returns false; otherwise, the call is delegated to an instance of PurchaseProcessor or PreorderProcessor as determined by Apply().