protected MovementStateDeleted NewMovementStateDeleted(long version, string commandId, string requesterId) { var stateEventId = new MovementEventId(_state.DocumentNumber, version); var e = NewMovementStateDeleted(stateEventId); e.CommandId = commandId; e.CreatedBy = (string)requesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); return(e); }
protected virtual IMovementStateDeleted Map(IDeleteMovement c) { var stateEventId = new MovementEventId(c.DocumentNumber, c.Version); IMovementStateDeleted e = NewMovementStateDeleted(stateEventId); e.CommandId = c.CommandId; e.CreatedBy = (string)c.RequesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); return(e); }
protected virtual IMovementStateCreated Map(ICreateMovement c) { var stateEventId = new MovementEventId(c.DocumentNumber, c.Version); IMovementStateCreated e = NewMovementStateCreated(stateEventId); NewMovementDocumentActionCommandAndExecute(c, _state, e); 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.CommandId = c.CommandId; e.CreatedBy = (string)c.RequesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); var version = c.Version; foreach (ICreateMovementLine innerCommand in c.MovementLines) { ThrowOnInconsistentCommands(c, innerCommand); IMovementLineStateCreated innerEvent = MapCreate(innerCommand, c, version, _state); e.AddMovementLineEvent(innerEvent); } return(e); }
public override bool Equals(object obj) { if (Object.ReferenceEquals(this, obj)) { return(true); } MovementEventId other = obj as MovementEventId; if (other == null) { return(false); } return(true && Object.Equals(this.DocumentNumber, other.DocumentNumber) && Object.Equals(this.Version, other.Version) ); }
protected MovementEventBase(MovementEventId stateEventId) { this.MovementEventId = stateEventId; }
public MovementStateDeleted(MovementEventId stateEventId) : base(stateEventId) { }
public MovementStateMergePatched(MovementEventId stateEventId) : base(stateEventId) { }
public MovementStateCreated(MovementEventId stateEventId) : base(stateEventId) { }
protected MovementStateEventBase(MovementEventId stateEventId) : base(stateEventId) { }
private MovementStateDeleted NewMovementStateDeleted(MovementEventId stateEventId) { return(new MovementStateDeleted(stateEventId)); }
private MovementStateMergePatched NewMovementStateMergePatched(MovementEventId stateEventId) { return(new MovementStateMergePatched(stateEventId)); }