public virtual void When(IPhysicalInventoryLineMvoStateCreated e) { ThrowOnWrongEvent(e); this.BookQuantity = (e.BookQuantity != null && e.BookQuantity.HasValue) ? e.BookQuantity.Value : default(decimal); this.CountedQuantity = (e.CountedQuantity != null && e.CountedQuantity.HasValue) ? e.CountedQuantity.Value : default(decimal); this.Processed = (e.Processed != null && e.Processed.HasValue) ? e.Processed.Value : default(bool); this.LineNumber = e.LineNumber; this.ReversalLineNumber = (e.ReversalLineNumber != null && e.ReversalLineNumber.HasValue) ? e.ReversalLineNumber.Value : default(long); this.Description = e.Description; this.Version = (e.Version != null && e.Version.HasValue) ? e.Version.Value : default(long); this.PhysicalInventoryDocumentStatusId = e.PhysicalInventoryDocumentStatusId; this.PhysicalInventoryWarehouseId = e.PhysicalInventoryWarehouseId; this.PhysicalInventoryLocatorIdPattern = e.PhysicalInventoryLocatorIdPattern; this.PhysicalInventoryProductIdPattern = e.PhysicalInventoryProductIdPattern; this.PhysicalInventoryPosted = (e.PhysicalInventoryPosted != null && e.PhysicalInventoryPosted.HasValue) ? e.PhysicalInventoryPosted.Value : default(bool); this.PhysicalInventoryProcessed = (e.PhysicalInventoryProcessed != null && e.PhysicalInventoryProcessed.HasValue) ? e.PhysicalInventoryProcessed.Value : default(bool); this.PhysicalInventoryProcessing = e.PhysicalInventoryProcessing; this.PhysicalInventoryDocumentTypeId = e.PhysicalInventoryDocumentTypeId; this.PhysicalInventoryMovementDate = e.PhysicalInventoryMovementDate; this.PhysicalInventoryDescription = e.PhysicalInventoryDescription; this.PhysicalInventoryIsApproved = (e.PhysicalInventoryIsApproved != null && e.PhysicalInventoryIsApproved.HasValue) ? e.PhysicalInventoryIsApproved.Value : default(bool); this.PhysicalInventoryApprovalAmount = (e.PhysicalInventoryApprovalAmount != null && e.PhysicalInventoryApprovalAmount.HasValue) ? e.PhysicalInventoryApprovalAmount.Value : default(decimal); this.PhysicalInventoryIsQuantityUpdated = (e.PhysicalInventoryIsQuantityUpdated != null && e.PhysicalInventoryIsQuantityUpdated.HasValue) ? e.PhysicalInventoryIsQuantityUpdated.Value : default(bool); this.PhysicalInventoryReversalDocumentNumber = e.PhysicalInventoryReversalDocumentNumber; this.PhysicalInventoryCreatedBy = e.PhysicalInventoryCreatedBy; this.PhysicalInventoryCreatedAt = (e.PhysicalInventoryCreatedAt != null && e.PhysicalInventoryCreatedAt.HasValue) ? e.PhysicalInventoryCreatedAt.Value : default(DateTime); this.PhysicalInventoryUpdatedBy = e.PhysicalInventoryUpdatedBy; this.PhysicalInventoryUpdatedAt = (e.PhysicalInventoryUpdatedAt != null && e.PhysicalInventoryUpdatedAt.HasValue) ? e.PhysicalInventoryUpdatedAt.Value : default(DateTime); this.PhysicalInventoryActive = (e.PhysicalInventoryActive != null && e.PhysicalInventoryActive.HasValue) ? e.PhysicalInventoryActive.Value : default(bool); this.Deleted = false; this.CreatedBy = e.CreatedBy; this.CreatedAt = e.CreatedAt; }
public virtual void Initialize(IPhysicalInventoryLineMvoStateCreated stateCreated) { var aggregateId = stateCreated.PhysicalInventoryLineMvoEventId.PhysicalInventoryLineId; var state = new PhysicalInventoryLineMvoState(); state.PhysicalInventoryLineId = aggregateId; var aggregate = (PhysicalInventoryLineMvoAggregate)GetPhysicalInventoryLineMvoAggregate(state); var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId); aggregate.Apply(stateCreated); Persist(eventStoreAggregateId, aggregate, state); }
protected virtual IPhysicalInventoryLineMvoStateCreated Map(ICreatePhysicalInventoryLineMvo c) { var stateEventId = new PhysicalInventoryLineMvoEventId(c.PhysicalInventoryLineId, c.PhysicalInventoryVersion); IPhysicalInventoryLineMvoStateCreated e = NewPhysicalInventoryLineMvoStateCreated(stateEventId); e.BookQuantity = c.BookQuantity; e.CountedQuantity = c.CountedQuantity; e.Processed = c.Processed; e.LineNumber = c.LineNumber; e.ReversalLineNumber = c.ReversalLineNumber; e.Description = c.Description; e.Version = c.Version; e.PhysicalInventoryDocumentStatusId = c.PhysicalInventoryDocumentStatusId; e.PhysicalInventoryWarehouseId = c.PhysicalInventoryWarehouseId; e.PhysicalInventoryLocatorIdPattern = c.PhysicalInventoryLocatorIdPattern; e.PhysicalInventoryProductIdPattern = c.PhysicalInventoryProductIdPattern; e.PhysicalInventoryPosted = c.PhysicalInventoryPosted; e.PhysicalInventoryProcessed = c.PhysicalInventoryProcessed; e.PhysicalInventoryProcessing = c.PhysicalInventoryProcessing; e.PhysicalInventoryDocumentTypeId = c.PhysicalInventoryDocumentTypeId; e.PhysicalInventoryMovementDate = c.PhysicalInventoryMovementDate; e.PhysicalInventoryDescription = c.PhysicalInventoryDescription; e.PhysicalInventoryIsApproved = c.PhysicalInventoryIsApproved; e.PhysicalInventoryApprovalAmount = c.PhysicalInventoryApprovalAmount; e.PhysicalInventoryIsQuantityUpdated = c.PhysicalInventoryIsQuantityUpdated; e.PhysicalInventoryReversalDocumentNumber = c.PhysicalInventoryReversalDocumentNumber; e.PhysicalInventoryCreatedBy = c.PhysicalInventoryCreatedBy; e.PhysicalInventoryCreatedAt = c.PhysicalInventoryCreatedAt; e.PhysicalInventoryUpdatedBy = c.PhysicalInventoryUpdatedBy; e.PhysicalInventoryUpdatedAt = c.PhysicalInventoryUpdatedAt; e.PhysicalInventoryActive = c.PhysicalInventoryActive; e.CommandId = c.CommandId; e.CreatedBy = (string)c.RequesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); var physicalInventoryVersion = c.PhysicalInventoryVersion; return(e); }
public virtual void Create(ICreatePhysicalInventoryLineMvo c) { IPhysicalInventoryLineMvoStateCreated e = Map(c); Apply(e); }
public virtual PhysicalInventoryLineMvoStateCreatedDto ToPhysicalInventoryLineMvoStateCreatedDto(IPhysicalInventoryLineMvoStateCreated e) { var dto = new PhysicalInventoryLineMvoStateCreatedDto(); dto.PhysicalInventoryLineMvoEventId = e.PhysicalInventoryLineMvoEventId; dto.CreatedAt = e.CreatedAt; dto.CreatedBy = e.CreatedBy; dto.CommandId = e.CommandId; dto.BookQuantity = e.BookQuantity; dto.CountedQuantity = e.CountedQuantity; dto.Processed = e.Processed; dto.LineNumber = e.LineNumber; dto.ReversalLineNumber = e.ReversalLineNumber; dto.Description = e.Description; dto.Version = e.Version; dto.PhysicalInventoryDocumentStatusId = e.PhysicalInventoryDocumentStatusId; dto.PhysicalInventoryWarehouseId = e.PhysicalInventoryWarehouseId; dto.PhysicalInventoryLocatorIdPattern = e.PhysicalInventoryLocatorIdPattern; dto.PhysicalInventoryProductIdPattern = e.PhysicalInventoryProductIdPattern; dto.PhysicalInventoryPosted = e.PhysicalInventoryPosted; dto.PhysicalInventoryProcessed = e.PhysicalInventoryProcessed; dto.PhysicalInventoryProcessing = e.PhysicalInventoryProcessing; dto.PhysicalInventoryDocumentTypeId = e.PhysicalInventoryDocumentTypeId; dto.PhysicalInventoryMovementDate = e.PhysicalInventoryMovementDate; dto.PhysicalInventoryDescription = e.PhysicalInventoryDescription; dto.PhysicalInventoryIsApproved = e.PhysicalInventoryIsApproved; dto.PhysicalInventoryApprovalAmount = e.PhysicalInventoryApprovalAmount; dto.PhysicalInventoryIsQuantityUpdated = e.PhysicalInventoryIsQuantityUpdated; dto.PhysicalInventoryReversalDocumentNumber = e.PhysicalInventoryReversalDocumentNumber; dto.PhysicalInventoryCreatedBy = e.PhysicalInventoryCreatedBy; dto.PhysicalInventoryCreatedAt = e.PhysicalInventoryCreatedAt; dto.PhysicalInventoryUpdatedBy = e.PhysicalInventoryUpdatedBy; dto.PhysicalInventoryUpdatedAt = e.PhysicalInventoryUpdatedAt; dto.PhysicalInventoryActive = e.PhysicalInventoryActive; return(dto); }
void IPhysicalInventoryLineMvoState.When(IPhysicalInventoryLineMvoStateCreated e) { throw new NotSupportedException(); }