Ejemplo n.º 1
0
 public virtual void When(IMergePatchOrder c)
 {
     Update(c, ar => ar.MergePatch(c));
 }
Ejemplo n.º 2
0
        public virtual void MergePatch(IMergePatchOrder c)
        {
            IOrderStateMergePatched e = Map(c);

            Apply(e);
        }
Ejemplo n.º 3
0
 void IOrderApplicationService.When(IMergePatchOrder c)
 {
     this.When((MergePatchOrderDto)c);
 }
Ejemplo n.º 4
0
        protected virtual IOrderStateMergePatched Map(IMergePatchOrder c)
        {
            var stateEventId          = new OrderEventId(c.OrderId, c.Version);
            IOrderStateMergePatched e = NewOrderStateMergePatched(stateEventId);

            e.OrderTypeId             = c.OrderTypeId;
            e.OrderName               = c.OrderName;
            e.ExternalId              = c.ExternalId;
            e.SalesChannelEnumId      = c.SalesChannelEnumId;
            e.OrderDate               = c.OrderDate;
            e.Priority                = c.Priority;
            e.EntryDate               = c.EntryDate;
            e.PickSheetPrintedDate    = c.PickSheetPrintedDate;
            e.StatusId                = c.StatusId;
            e.CurrencyUomId           = c.CurrencyUomId;
            e.SyncStatusId            = c.SyncStatusId;
            e.BillingAccountId        = c.BillingAccountId;
            e.OriginFacilityId        = c.OriginFacilityId;
            e.WebSiteId               = c.WebSiteId;
            e.ProductStoreId          = c.ProductStoreId;
            e.TerminalId              = c.TerminalId;
            e.TransactionId           = c.TransactionId;
            e.AutoOrderShoppingListId = c.AutoOrderShoppingListId;
            e.NeedsInventoryIssuance  = c.NeedsInventoryIssuance;
            e.IsRushOrder             = c.IsRushOrder;
            e.InternalCode            = c.InternalCode;
            e.RemainingSubTotal       = c.RemainingSubTotal;
            e.GrandTotal              = c.GrandTotal;
            e.InvoicePerShipment      = c.InvoicePerShipment;
            e.Active = c.Active;
            e.IsPropertyOrderTypeIdRemoved             = c.IsPropertyOrderTypeIdRemoved;
            e.IsPropertyOrderNameRemoved               = c.IsPropertyOrderNameRemoved;
            e.IsPropertyExternalIdRemoved              = c.IsPropertyExternalIdRemoved;
            e.IsPropertySalesChannelEnumIdRemoved      = c.IsPropertySalesChannelEnumIdRemoved;
            e.IsPropertyOrderDateRemoved               = c.IsPropertyOrderDateRemoved;
            e.IsPropertyPriorityRemoved                = c.IsPropertyPriorityRemoved;
            e.IsPropertyEntryDateRemoved               = c.IsPropertyEntryDateRemoved;
            e.IsPropertyPickSheetPrintedDateRemoved    = c.IsPropertyPickSheetPrintedDateRemoved;
            e.IsPropertyStatusIdRemoved                = c.IsPropertyStatusIdRemoved;
            e.IsPropertyCurrencyUomIdRemoved           = c.IsPropertyCurrencyUomIdRemoved;
            e.IsPropertySyncStatusIdRemoved            = c.IsPropertySyncStatusIdRemoved;
            e.IsPropertyBillingAccountIdRemoved        = c.IsPropertyBillingAccountIdRemoved;
            e.IsPropertyOriginFacilityIdRemoved        = c.IsPropertyOriginFacilityIdRemoved;
            e.IsPropertyWebSiteIdRemoved               = c.IsPropertyWebSiteIdRemoved;
            e.IsPropertyProductStoreIdRemoved          = c.IsPropertyProductStoreIdRemoved;
            e.IsPropertyTerminalIdRemoved              = c.IsPropertyTerminalIdRemoved;
            e.IsPropertyTransactionIdRemoved           = c.IsPropertyTransactionIdRemoved;
            e.IsPropertyAutoOrderShoppingListIdRemoved = c.IsPropertyAutoOrderShoppingListIdRemoved;
            e.IsPropertyNeedsInventoryIssuanceRemoved  = c.IsPropertyNeedsInventoryIssuanceRemoved;
            e.IsPropertyIsRushOrderRemoved             = c.IsPropertyIsRushOrderRemoved;
            e.IsPropertyInternalCodeRemoved            = c.IsPropertyInternalCodeRemoved;
            e.IsPropertyRemainingSubTotalRemoved       = c.IsPropertyRemainingSubTotalRemoved;
            e.IsPropertyGrandTotalRemoved              = c.IsPropertyGrandTotalRemoved;
            e.IsPropertyInvoicePerShipmentRemoved      = c.IsPropertyInvoicePerShipmentRemoved;
            e.IsPropertyActiveRemoved = c.IsPropertyActiveRemoved;

            e.CommandId = c.CommandId;


            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();

            var version = c.Version;

            foreach (IOrderRoleCommand innerCommand in c.OrderRoleCommands)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IOrderRoleEvent innerEvent = Map(innerCommand, c, version, _state);
                e.AddOrderRoleEvent(innerEvent);
            }

            foreach (IOrderItemCommand innerCommand in c.OrderItemCommands)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IOrderItemEvent innerEvent = Map(innerCommand, c, version, _state);
                e.AddOrderItemEvent(innerEvent);
            }

            foreach (IOrderShipGroupCommand innerCommand in c.OrderShipGroupCommands)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IOrderShipGroupEvent innerEvent = Map(innerCommand, c, version, _state);
                e.AddOrderShipGroupEvent(innerEvent);
            }


            return(e);
        }