Class CompleteProcessor
Handles the processing of complete request items.
Inherited Members
Namespace: Mediachase.Commerce.InventoryService.BusinessLogic
Assembly: Mediachase.Commerce.dll
Version: 12.17.2Syntax
public class CompleteProcessor : RequestItemProcessor
Constructors
CompleteProcessor(InventoryRequest, InventoryRequestItem, OperationKeySerializer, RecordStateSet)
Creates a new instance of CancelProcessor.
Declaration
public CompleteProcessor(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 complete request item marks a Purchase, Preorder, or Backorder request as completed.
If the original request item was a Purchase or Preorder, then the requested quantities from the original request are removed; the items have been fulfilled and are no longer pending.
If the original request item was a Backorder, then the requested quantity from the original request is removed, decremented from PurchaseAvailableQuantity, and added to PurchaseRequestedQuantity. This converts a pending backorder request into a pending purchase request.
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
If the complete request item has a valid operation key and represents a Purchase or Preorder, the request will succeed.
If the complete request item has a valid oepration key and represents a Backorder, then Validate() will also verify that there is enough PurchaseAvailableQuantity to create a purchase replacing the original backorder.