Exemple #1
0
        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);
        }
Exemple #2
0
 public static CreatePhysicalInventoryLineMvo ToCreatePhysicalInventoryLineMvo(this PhysicalInventoryLineMvoState state)
 {
     return(state.ToCreatePhysicalInventoryLineMvo <CreatePhysicalInventoryLineMvo>());
 }
Exemple #3
0
 public static MergePatchPhysicalInventoryLineMvo ToMergePatchPhysicalInventoryLineMvo(this PhysicalInventoryLineMvoState state)
 {
     return(state.ToMergePatchPhysicalInventoryLineMvo <MergePatchPhysicalInventoryLineMvo>());
 }
Exemple #4
0
 public static DeletePhysicalInventoryLineMvo ToDeletePhysicalInventoryLineMvo(this PhysicalInventoryLineMvoState state)
 {
     return(state.ToDeletePhysicalInventoryLineMvo <DeletePhysicalInventoryLineMvo>());
 }
Exemple #5
0
 public static IPhysicalInventoryLineMvoCommand ToCreateOrMergePatchPhysicalInventoryLineMvo(this PhysicalInventoryLineMvoState state)
 {
     return(state.ToCreateOrMergePatchPhysicalInventoryLineMvo <CreatePhysicalInventoryLineMvo, MergePatchPhysicalInventoryLineMvo>());
 }
Exemple #6
0
        public virtual IPhysicalInventoryLineMvoState ToPhysicalInventoryLineMvoState()
        {
            var state = new PhysicalInventoryLineMvoState(true);

            state.PhysicalInventoryLineId = this.PhysicalInventoryLineId;
            if (this.BookQuantity != null && this.BookQuantity.HasValue)
            {
                state.BookQuantity = this.BookQuantity.Value;
            }
            if (this.CountedQuantity != null && this.CountedQuantity.HasValue)
            {
                state.CountedQuantity = this.CountedQuantity.Value;
            }
            if (this.Processed != null && this.Processed.HasValue)
            {
                state.Processed = this.Processed.Value;
            }
            state.LineNumber = this.LineNumber;
            if (this.ReversalLineNumber != null && this.ReversalLineNumber.HasValue)
            {
                state.ReversalLineNumber = this.ReversalLineNumber.Value;
            }
            state.Description = this.Description;
            if (this.Version != null && this.Version.HasValue)
            {
                state.Version = this.Version.Value;
            }
            state.PhysicalInventoryDocumentStatusId = this.PhysicalInventoryDocumentStatusId;
            state.PhysicalInventoryWarehouseId      = this.PhysicalInventoryWarehouseId;
            state.PhysicalInventoryLocatorIdPattern = this.PhysicalInventoryLocatorIdPattern;
            state.PhysicalInventoryProductIdPattern = this.PhysicalInventoryProductIdPattern;
            if (this.PhysicalInventoryPosted != null && this.PhysicalInventoryPosted.HasValue)
            {
                state.PhysicalInventoryPosted = this.PhysicalInventoryPosted.Value;
            }
            if (this.PhysicalInventoryProcessed != null && this.PhysicalInventoryProcessed.HasValue)
            {
                state.PhysicalInventoryProcessed = this.PhysicalInventoryProcessed.Value;
            }
            state.PhysicalInventoryProcessing     = this.PhysicalInventoryProcessing;
            state.PhysicalInventoryDocumentTypeId = this.PhysicalInventoryDocumentTypeId;
            state.PhysicalInventoryMovementDate   = this.PhysicalInventoryMovementDate;
            state.PhysicalInventoryDescription    = this.PhysicalInventoryDescription;
            if (this.PhysicalInventoryIsApproved != null && this.PhysicalInventoryIsApproved.HasValue)
            {
                state.PhysicalInventoryIsApproved = this.PhysicalInventoryIsApproved.Value;
            }
            if (this.PhysicalInventoryApprovalAmount != null && this.PhysicalInventoryApprovalAmount.HasValue)
            {
                state.PhysicalInventoryApprovalAmount = this.PhysicalInventoryApprovalAmount.Value;
            }
            if (this.PhysicalInventoryIsQuantityUpdated != null && this.PhysicalInventoryIsQuantityUpdated.HasValue)
            {
                state.PhysicalInventoryIsQuantityUpdated = this.PhysicalInventoryIsQuantityUpdated.Value;
            }
            state.PhysicalInventoryReversalDocumentNumber = this.PhysicalInventoryReversalDocumentNumber;
            state.PhysicalInventoryCreatedBy = this.PhysicalInventoryCreatedBy;
            if (this.PhysicalInventoryCreatedAt != null && this.PhysicalInventoryCreatedAt.HasValue)
            {
                state.PhysicalInventoryCreatedAt = this.PhysicalInventoryCreatedAt.Value;
            }
            state.PhysicalInventoryUpdatedBy = this.PhysicalInventoryUpdatedBy;
            if (this.PhysicalInventoryUpdatedAt != null && this.PhysicalInventoryUpdatedAt.HasValue)
            {
                state.PhysicalInventoryUpdatedAt = this.PhysicalInventoryUpdatedAt.Value;
            }
            if (this.PhysicalInventoryActive != null && this.PhysicalInventoryActive.HasValue)
            {
                state.PhysicalInventoryActive = this.PhysicalInventoryActive.Value;
            }
            if (this.PhysicalInventoryVersion != null && this.PhysicalInventoryVersion.HasValue)
            {
                state.PhysicalInventoryVersion = this.PhysicalInventoryVersion.Value;
            }
            state.CreatedBy = this.CreatedBy;
            if (this.CreatedAt != null && this.CreatedAt.HasValue)
            {
                state.CreatedAt = this.CreatedAt.Value;
            }
            state.UpdatedBy = this.UpdatedBy;
            if (this.UpdatedAt != null && this.UpdatedAt.HasValue)
            {
                state.UpdatedAt = this.UpdatedAt.Value;
            }

            return(state);
        }