protected virtual IMovementConfirmationStateMergePatched Map(IMergePatchMovementConfirmation c) { var stateEventId = new MovementConfirmationEventId(c.DocumentNumber, c.Version); IMovementConfirmationStateMergePatched e = NewMovementConfirmationStateMergePatched(stateEventId); e.MovementDocumentNumber = c.MovementDocumentNumber; e.IsApproved = c.IsApproved; e.ApprovalAmount = c.ApprovalAmount; e.Processed = c.Processed; e.Processing = c.Processing; e.DocumentTypeId = c.DocumentTypeId; e.Description = c.Description; e.Active = c.Active; e.IsPropertyMovementDocumentNumberRemoved = c.IsPropertyMovementDocumentNumberRemoved; e.IsPropertyIsApprovedRemoved = c.IsPropertyIsApprovedRemoved; e.IsPropertyApprovalAmountRemoved = c.IsPropertyApprovalAmountRemoved; e.IsPropertyProcessedRemoved = c.IsPropertyProcessedRemoved; e.IsPropertyProcessingRemoved = c.IsPropertyProcessingRemoved; e.IsPropertyDocumentTypeIdRemoved = c.IsPropertyDocumentTypeIdRemoved; 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 (IMovementConfirmationLineCommand innerCommand in c.MovementConfirmationLineCommands) { ThrowOnInconsistentCommands(c, innerCommand); IMovementConfirmationLineEvent innerEvent = Map(innerCommand, c, version, _state); e.AddMovementConfirmationLineEvent(innerEvent); } return(e); }
public virtual void MergePatch(IMergePatchMovementConfirmation c) { IMovementConfirmationStateMergePatched e = Map(c); Apply(e); }
void IMovementConfirmationApplicationService.When(IMergePatchMovementConfirmation c) { this.When((MergePatchMovementConfirmationDto)c); }
public virtual void When(IMergePatchMovementConfirmation c) { Update(c, ar => ar.MergePatch(c)); }