Esempio n. 1
0
        protected PhysicalInventoryStateMergePatched NewPhysicalInventoryStateMergePatched(long version, string commandId, string requesterId)
        {
            var stateEventId = new PhysicalInventoryEventId(_state.DocumentNumber, version);
            var e            = NewPhysicalInventoryStateMergePatched(stateEventId);

            e.CommandId = commandId;

            e.CreatedBy = (string)requesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();

            return(e);
        }
Esempio n. 2
0
        protected virtual IPhysicalInventoryStateMergePatched Map(IMergePatchPhysicalInventory c)
        {
            var stateEventId = new PhysicalInventoryEventId(c.DocumentNumber, c.Version);
            IPhysicalInventoryStateMergePatched e = NewPhysicalInventoryStateMergePatched(stateEventId);

            e.WarehouseId                             = c.WarehouseId;
            e.LocatorIdPattern                        = c.LocatorIdPattern;
            e.ProductIdPattern                        = c.ProductIdPattern;
            e.Posted                                  = c.Posted;
            e.Processed                               = c.Processed;
            e.Processing                              = c.Processing;
            e.DocumentTypeId                          = c.DocumentTypeId;
            e.MovementDate                            = c.MovementDate;
            e.Description                             = c.Description;
            e.IsApproved                              = c.IsApproved;
            e.ApprovalAmount                          = c.ApprovalAmount;
            e.IsQuantityUpdated                       = c.IsQuantityUpdated;
            e.ReversalDocumentNumber                  = c.ReversalDocumentNumber;
            e.Active                                  = c.Active;
            e.IsPropertyWarehouseIdRemoved            = c.IsPropertyWarehouseIdRemoved;
            e.IsPropertyLocatorIdPatternRemoved       = c.IsPropertyLocatorIdPatternRemoved;
            e.IsPropertyProductIdPatternRemoved       = c.IsPropertyProductIdPatternRemoved;
            e.IsPropertyPostedRemoved                 = c.IsPropertyPostedRemoved;
            e.IsPropertyProcessedRemoved              = c.IsPropertyProcessedRemoved;
            e.IsPropertyProcessingRemoved             = c.IsPropertyProcessingRemoved;
            e.IsPropertyDocumentTypeIdRemoved         = c.IsPropertyDocumentTypeIdRemoved;
            e.IsPropertyMovementDateRemoved           = c.IsPropertyMovementDateRemoved;
            e.IsPropertyDescriptionRemoved            = c.IsPropertyDescriptionRemoved;
            e.IsPropertyIsApprovedRemoved             = c.IsPropertyIsApprovedRemoved;
            e.IsPropertyApprovalAmountRemoved         = c.IsPropertyApprovalAmountRemoved;
            e.IsPropertyIsQuantityUpdatedRemoved      = c.IsPropertyIsQuantityUpdatedRemoved;
            e.IsPropertyReversalDocumentNumberRemoved = c.IsPropertyReversalDocumentNumberRemoved;
            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 (IPhysicalInventoryLineCommand innerCommand in c.PhysicalInventoryLineCommands)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IPhysicalInventoryLineEvent innerEvent = Map(innerCommand, c, version, _state);
                e.AddPhysicalInventoryLineEvent(innerEvent);
            }


            return(e);
        }
Esempio n. 3
0
        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            PhysicalInventoryEventId other = obj as PhysicalInventoryEventId;

            if (other == null)
            {
                return(false);
            }

            return(true &&
                   Object.Equals(this.DocumentNumber, other.DocumentNumber) &&
                   Object.Equals(this.Version, other.Version)
                   );
        }
Esempio n. 4
0
 protected PhysicalInventoryStateEventDtoBase(PhysicalInventoryEventId stateEventId)
 {
     this.PhysicalInventoryEventId = stateEventId;
 }
Esempio n. 5
0
 private PhysicalInventoryStateMergePatched NewPhysicalInventoryStateMergePatched(PhysicalInventoryEventId stateEventId)
 {
     return(new PhysicalInventoryStateMergePatched(stateEventId));
 }
Esempio n. 6
0
////////////////////////

        private PhysicalInventoryStateCreated NewPhysicalInventoryStateCreated(PhysicalInventoryEventId stateEventId)
        {
            return(new PhysicalInventoryStateCreated(stateEventId));
        }
Esempio n. 7
0
 public PhysicalInventoryStateMergePatched(PhysicalInventoryEventId stateEventId) : base(stateEventId)
 {
 }
Esempio n. 8
0
 public PhysicalInventoryStateCreated(PhysicalInventoryEventId stateEventId) : base(stateEventId)
 {
 }
Esempio n. 9
0
 protected PhysicalInventoryStateEventBase(PhysicalInventoryEventId stateEventId) : base(stateEventId)
 {
 }