Ejemplo n.º 1
0
        protected virtual IShipmentPackageStateMergePatched Map(IMergePatchShipmentPackage c)
        {
            var stateEventId = new ShipmentPackageEventId(c.ShipmentPackageId, c.Version);
            IShipmentPackageStateMergePatched e = NewShipmentPackageStateMergePatched(stateEventId);

            e.ShipmentBoxTypeId = c.ShipmentBoxTypeId;
            e.DateCreated       = c.DateCreated;
            e.BoxLength         = c.BoxLength;
            e.BoxHeight         = c.BoxHeight;
            e.BoxWidth          = c.BoxWidth;
            e.DimensionUomId    = c.DimensionUomId;
            e.Weight            = c.Weight;
            e.WeightUomId       = c.WeightUomId;
            e.InsuredValue      = c.InsuredValue;
            e.Active            = c.Active;
            e.IsPropertyShipmentBoxTypeIdRemoved = c.IsPropertyShipmentBoxTypeIdRemoved;
            e.IsPropertyDateCreatedRemoved       = c.IsPropertyDateCreatedRemoved;
            e.IsPropertyBoxLengthRemoved         = c.IsPropertyBoxLengthRemoved;
            e.IsPropertyBoxHeightRemoved         = c.IsPropertyBoxHeightRemoved;
            e.IsPropertyBoxWidthRemoved          = c.IsPropertyBoxWidthRemoved;
            e.IsPropertyDimensionUomIdRemoved    = c.IsPropertyDimensionUomIdRemoved;
            e.IsPropertyWeightRemoved            = c.IsPropertyWeightRemoved;
            e.IsPropertyWeightUomIdRemoved       = c.IsPropertyWeightUomIdRemoved;
            e.IsPropertyInsuredValueRemoved      = c.IsPropertyInsuredValueRemoved;
            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 (IShipmentPackageContentCommand innerCommand in c.ShipmentPackageContentCommands)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IShipmentPackageContentEvent innerEvent = Map(innerCommand, c, version, _state);
                e.AddShipmentPackageContentEvent(innerEvent);
            }


            return(e);
        }
Ejemplo n.º 2
0
 void IShipmentPackageApplicationService.When(IMergePatchShipmentPackage c)
 {
     this.When((MergePatchShipmentPackageDto)c);
 }
Ejemplo n.º 3
0
 public virtual void When(IMergePatchShipmentPackage c)
 {
     Update(c, ar => ar.MergePatch(c));
 }
Ejemplo n.º 4
0
        public virtual void MergePatch(IMergePatchShipmentPackage c)
        {
            IShipmentPackageStateMergePatched e = Map(c);

            Apply(e);
        }