protected virtual IMovementConfirmationStateCreated Map(ICreateMovementConfirmation c) { var stateEventId = new MovementConfirmationEventId(c.DocumentNumber, c.Version); IMovementConfirmationStateCreated e = NewMovementConfirmationStateCreated(stateEventId); NewMovementConfirmationDocumentActionCommandAndExecute(c, _state, e); 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.CommandId = c.CommandId; e.CreatedBy = (string)c.RequesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); var version = c.Version; foreach (ICreateMovementConfirmationLine innerCommand in c.MovementConfirmationLines) { ThrowOnInconsistentCommands(c, innerCommand); IMovementConfirmationLineStateCreated innerEvent = MapCreate(innerCommand, c, version, _state); e.AddMovementConfirmationLineEvent(innerEvent); } return(e); }
protected MovementConfirmationStateDeleted NewMovementConfirmationStateDeleted(long version, string commandId, string requesterId) { var stateEventId = new MovementConfirmationEventId(_state.DocumentNumber, version); var e = NewMovementConfirmationStateDeleted(stateEventId); e.CommandId = commandId; e.CreatedBy = (string)requesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); return(e); }
protected virtual IMovementConfirmationStateDeleted Map(IDeleteMovementConfirmation c) { var stateEventId = new MovementConfirmationEventId(c.DocumentNumber, c.Version); IMovementConfirmationStateDeleted e = NewMovementConfirmationStateDeleted(stateEventId); e.CommandId = c.CommandId; e.CreatedBy = (string)c.RequesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); return(e); }
public override bool Equals(object obj) { if (Object.ReferenceEquals(this, obj)) { return(true); } MovementConfirmationEventId other = obj as MovementConfirmationEventId; if (other == null) { return(false); } return(true && Object.Equals(this.DocumentNumber, other.DocumentNumber) && Object.Equals(this.Version, other.Version) ); }
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); }
protected MovementConfirmationEventBase(MovementConfirmationEventId stateEventId) { this.MovementConfirmationEventId = stateEventId; }
public MovementConfirmationStateDeleted(MovementConfirmationEventId stateEventId) : base(stateEventId) { }
public MovementConfirmationStateMergePatched(MovementConfirmationEventId stateEventId) : base(stateEventId) { }
protected MovementConfirmationStateEventBase(MovementConfirmationEventId stateEventId) : base(stateEventId) { }
private MovementConfirmationStateDeleted NewMovementConfirmationStateDeleted(MovementConfirmationEventId stateEventId) { return(new MovementConfirmationStateDeleted(stateEventId)); }
private MovementConfirmationStateMergePatched NewMovementConfirmationStateMergePatched(MovementConfirmationEventId stateEventId) { return(new MovementConfirmationStateMergePatched(stateEventId)); }