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

            Apply(e);
        }
Ejemplo n.º 3
0
 void IMovementApplicationService.When(IMergePatchMovement c)
 {
     this.When((MergePatchMovementDto)c);
 }
Ejemplo n.º 4
0
        protected virtual IMovementStateMergePatched Map(IMergePatchMovement c)
        {
            var stateEventId             = new MovementEventId(c.DocumentNumber, c.Version);
            IMovementStateMergePatched e = NewMovementStateMergePatched(stateEventId);

            e.MovementDate                            = c.MovementDate;
            e.Posted                                  = c.Posted;
            e.Processed                               = c.Processed;
            e.Processing                              = c.Processing;
            e.DateReceived                            = c.DateReceived;
            e.DocumentTypeId                          = c.DocumentTypeId;
            e.IsInTransit                             = c.IsInTransit;
            e.IsApproved                              = c.IsApproved;
            e.ApprovalAmount                          = c.ApprovalAmount;
            e.ShipperId                               = c.ShipperId;
            e.SalesRepresentativeId                   = c.SalesRepresentativeId;
            e.BusinessPartnerId                       = c.BusinessPartnerId;
            e.ChargeAmount                            = c.ChargeAmount;
            e.CreateFrom                              = c.CreateFrom;
            e.FreightAmount                           = c.FreightAmount;
            e.ReversalDocumentNumber                  = c.ReversalDocumentNumber;
            e.WarehouseIdFrom                         = c.WarehouseIdFrom;
            e.WarehouseIdTo                           = c.WarehouseIdTo;
            e.Description                             = c.Description;
            e.Active                                  = c.Active;
            e.IsPropertyMovementDateRemoved           = c.IsPropertyMovementDateRemoved;
            e.IsPropertyPostedRemoved                 = c.IsPropertyPostedRemoved;
            e.IsPropertyProcessedRemoved              = c.IsPropertyProcessedRemoved;
            e.IsPropertyProcessingRemoved             = c.IsPropertyProcessingRemoved;
            e.IsPropertyDateReceivedRemoved           = c.IsPropertyDateReceivedRemoved;
            e.IsPropertyDocumentTypeIdRemoved         = c.IsPropertyDocumentTypeIdRemoved;
            e.IsPropertyIsInTransitRemoved            = c.IsPropertyIsInTransitRemoved;
            e.IsPropertyIsApprovedRemoved             = c.IsPropertyIsApprovedRemoved;
            e.IsPropertyApprovalAmountRemoved         = c.IsPropertyApprovalAmountRemoved;
            e.IsPropertyShipperIdRemoved              = c.IsPropertyShipperIdRemoved;
            e.IsPropertySalesRepresentativeIdRemoved  = c.IsPropertySalesRepresentativeIdRemoved;
            e.IsPropertyBusinessPartnerIdRemoved      = c.IsPropertyBusinessPartnerIdRemoved;
            e.IsPropertyChargeAmountRemoved           = c.IsPropertyChargeAmountRemoved;
            e.IsPropertyCreateFromRemoved             = c.IsPropertyCreateFromRemoved;
            e.IsPropertyFreightAmountRemoved          = c.IsPropertyFreightAmountRemoved;
            e.IsPropertyReversalDocumentNumberRemoved = c.IsPropertyReversalDocumentNumberRemoved;
            e.IsPropertyWarehouseIdFromRemoved        = c.IsPropertyWarehouseIdFromRemoved;
            e.IsPropertyWarehouseIdToRemoved          = c.IsPropertyWarehouseIdToRemoved;
            e.IsPropertyDescriptionRemoved            = c.IsPropertyDescriptionRemoved;
            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 (IMovementLineCommand innerCommand in c.MovementLineCommands)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IMovementLineEvent innerEvent = Map(innerCommand, c, version, _state);
                e.AddMovementLineEvent(innerEvent);
            }


            return(e);
        }