Exemplo n.º 1
0
        public virtual void When(IProductStateMergePatched e)
        {
            ThrowOnWrongEvent(e);

            if (e.ProductTypeId == null)
            {
                if (e.IsPropertyProductTypeIdRemoved)
                {
                    this.ProductTypeId = default(string);
                }
            }
            else
            {
                this.ProductTypeId = e.ProductTypeId;
            }

            if (e.PrimaryProductCategoryId == null)
            {
                if (e.IsPropertyPrimaryProductCategoryIdRemoved)
                {
                    this.PrimaryProductCategoryId = default(string);
                }
            }
            else
            {
                this.PrimaryProductCategoryId = e.PrimaryProductCategoryId;
            }

            if (e.ManufacturerPartyId == null)
            {
                if (e.IsPropertyManufacturerPartyIdRemoved)
                {
                    this.ManufacturerPartyId = default(string);
                }
            }
            else
            {
                this.ManufacturerPartyId = e.ManufacturerPartyId;
            }

            if (e.FacilityId == null)
            {
                if (e.IsPropertyFacilityIdRemoved)
                {
                    this.FacilityId = default(string);
                }
            }
            else
            {
                this.FacilityId = e.FacilityId;
            }

            if (e.IntroductionDate == null)
            {
                if (e.IsPropertyIntroductionDateRemoved)
                {
                    this.IntroductionDate = default(DateTime?);
                }
            }
            else
            {
                this.IntroductionDate = e.IntroductionDate;
            }

            if (e.ReleaseDate == null)
            {
                if (e.IsPropertyReleaseDateRemoved)
                {
                    this.ReleaseDate = default(DateTime?);
                }
            }
            else
            {
                this.ReleaseDate = e.ReleaseDate;
            }

            if (e.SupportDiscontinuationDate == null)
            {
                if (e.IsPropertySupportDiscontinuationDateRemoved)
                {
                    this.SupportDiscontinuationDate = default(DateTime?);
                }
            }
            else
            {
                this.SupportDiscontinuationDate = e.SupportDiscontinuationDate;
            }

            if (e.SalesDiscontinuationDate == null)
            {
                if (e.IsPropertySalesDiscontinuationDateRemoved)
                {
                    this.SalesDiscontinuationDate = default(DateTime?);
                }
            }
            else
            {
                this.SalesDiscontinuationDate = e.SalesDiscontinuationDate;
            }

            if (e.SalesDiscWhenNotAvail == null)
            {
                if (e.IsPropertySalesDiscWhenNotAvailRemoved)
                {
                    this.SalesDiscWhenNotAvail = default(string);
                }
            }
            else
            {
                this.SalesDiscWhenNotAvail = e.SalesDiscWhenNotAvail;
            }

            if (e.InternalName == null)
            {
                if (e.IsPropertyInternalNameRemoved)
                {
                    this.InternalName = default(string);
                }
            }
            else
            {
                this.InternalName = e.InternalName;
            }

            if (e.BrandName == null)
            {
                if (e.IsPropertyBrandNameRemoved)
                {
                    this.BrandName = default(string);
                }
            }
            else
            {
                this.BrandName = e.BrandName;
            }

            if (e.Comments == null)
            {
                if (e.IsPropertyCommentsRemoved)
                {
                    this.Comments = default(string);
                }
            }
            else
            {
                this.Comments = e.Comments;
            }

            if (e.ProductName == null)
            {
                if (e.IsPropertyProductNameRemoved)
                {
                    this.ProductName = default(string);
                }
            }
            else
            {
                this.ProductName = e.ProductName;
            }

            if (e.Description == null)
            {
                if (e.IsPropertyDescriptionRemoved)
                {
                    this.Description = default(string);
                }
            }
            else
            {
                this.Description = e.Description;
            }

            if (e.PriceDetailText == null)
            {
                if (e.IsPropertyPriceDetailTextRemoved)
                {
                    this.PriceDetailText = default(string);
                }
            }
            else
            {
                this.PriceDetailText = e.PriceDetailText;
            }

            if (e.SmallImageUrl == null)
            {
                if (e.IsPropertySmallImageUrlRemoved)
                {
                    this.SmallImageUrl = default(string);
                }
            }
            else
            {
                this.SmallImageUrl = e.SmallImageUrl;
            }

            if (e.MediumImageUrl == null)
            {
                if (e.IsPropertyMediumImageUrlRemoved)
                {
                    this.MediumImageUrl = default(string);
                }
            }
            else
            {
                this.MediumImageUrl = e.MediumImageUrl;
            }

            if (e.LargeImageUrl == null)
            {
                if (e.IsPropertyLargeImageUrlRemoved)
                {
                    this.LargeImageUrl = default(string);
                }
            }
            else
            {
                this.LargeImageUrl = e.LargeImageUrl;
            }

            if (e.DetailImageUrl == null)
            {
                if (e.IsPropertyDetailImageUrlRemoved)
                {
                    this.DetailImageUrl = default(string);
                }
            }
            else
            {
                this.DetailImageUrl = e.DetailImageUrl;
            }

            if (e.OriginalImageUrl == null)
            {
                if (e.IsPropertyOriginalImageUrlRemoved)
                {
                    this.OriginalImageUrl = default(string);
                }
            }
            else
            {
                this.OriginalImageUrl = e.OriginalImageUrl;
            }

            if (e.DetailScreen == null)
            {
                if (e.IsPropertyDetailScreenRemoved)
                {
                    this.DetailScreen = default(string);
                }
            }
            else
            {
                this.DetailScreen = e.DetailScreen;
            }

            if (e.InventoryMessage == null)
            {
                if (e.IsPropertyInventoryMessageRemoved)
                {
                    this.InventoryMessage = default(string);
                }
            }
            else
            {
                this.InventoryMessage = e.InventoryMessage;
            }

            if (e.InventoryItemTypeId == null)
            {
                if (e.IsPropertyInventoryItemTypeIdRemoved)
                {
                    this.InventoryItemTypeId = default(string);
                }
            }
            else
            {
                this.InventoryItemTypeId = e.InventoryItemTypeId;
            }

            if (e.RequireInventory == null)
            {
                if (e.IsPropertyRequireInventoryRemoved)
                {
                    this.RequireInventory = default(string);
                }
            }
            else
            {
                this.RequireInventory = e.RequireInventory;
            }

            if (e.QuantityUomId == null)
            {
                if (e.IsPropertyQuantityUomIdRemoved)
                {
                    this.QuantityUomId = default(string);
                }
            }
            else
            {
                this.QuantityUomId = e.QuantityUomId;
            }

            if (e.QuantityIncluded == null)
            {
                if (e.IsPropertyQuantityIncludedRemoved)
                {
                    this.QuantityIncluded = default(decimal?);
                }
            }
            else
            {
                this.QuantityIncluded = e.QuantityIncluded;
            }

            if (e.PiecesIncluded == null)
            {
                if (e.IsPropertyPiecesIncludedRemoved)
                {
                    this.PiecesIncluded = default(long?);
                }
            }
            else
            {
                this.PiecesIncluded = e.PiecesIncluded;
            }

            if (e.RequireAmount == null)
            {
                if (e.IsPropertyRequireAmountRemoved)
                {
                    this.RequireAmount = default(string);
                }
            }
            else
            {
                this.RequireAmount = e.RequireAmount;
            }

            if (e.FixedAmount == null)
            {
                if (e.IsPropertyFixedAmountRemoved)
                {
                    this.FixedAmount = default(decimal?);
                }
            }
            else
            {
                this.FixedAmount = e.FixedAmount;
            }

            if (e.AmountUomTypeId == null)
            {
                if (e.IsPropertyAmountUomTypeIdRemoved)
                {
                    this.AmountUomTypeId = default(string);
                }
            }
            else
            {
                this.AmountUomTypeId = e.AmountUomTypeId;
            }

            if (e.WeightUomId == null)
            {
                if (e.IsPropertyWeightUomIdRemoved)
                {
                    this.WeightUomId = default(string);
                }
            }
            else
            {
                this.WeightUomId = e.WeightUomId;
            }

            if (e.ShippingWeight == null)
            {
                if (e.IsPropertyShippingWeightRemoved)
                {
                    this.ShippingWeight = default(decimal?);
                }
            }
            else
            {
                this.ShippingWeight = e.ShippingWeight;
            }

            if (e.ProductWeight == null)
            {
                if (e.IsPropertyProductWeightRemoved)
                {
                    this.ProductWeight = default(decimal?);
                }
            }
            else
            {
                this.ProductWeight = e.ProductWeight;
            }

            if (e.HeightUomId == null)
            {
                if (e.IsPropertyHeightUomIdRemoved)
                {
                    this.HeightUomId = default(string);
                }
            }
            else
            {
                this.HeightUomId = e.HeightUomId;
            }

            if (e.ProductHeight == null)
            {
                if (e.IsPropertyProductHeightRemoved)
                {
                    this.ProductHeight = default(decimal?);
                }
            }
            else
            {
                this.ProductHeight = e.ProductHeight;
            }

            if (e.ShippingHeight == null)
            {
                if (e.IsPropertyShippingHeightRemoved)
                {
                    this.ShippingHeight = default(decimal?);
                }
            }
            else
            {
                this.ShippingHeight = e.ShippingHeight;
            }

            if (e.WidthUomId == null)
            {
                if (e.IsPropertyWidthUomIdRemoved)
                {
                    this.WidthUomId = default(string);
                }
            }
            else
            {
                this.WidthUomId = e.WidthUomId;
            }

            if (e.ProductWidth == null)
            {
                if (e.IsPropertyProductWidthRemoved)
                {
                    this.ProductWidth = default(decimal?);
                }
            }
            else
            {
                this.ProductWidth = e.ProductWidth;
            }

            if (e.ShippingWidth == null)
            {
                if (e.IsPropertyShippingWidthRemoved)
                {
                    this.ShippingWidth = default(decimal?);
                }
            }
            else
            {
                this.ShippingWidth = e.ShippingWidth;
            }

            if (e.DepthUomId == null)
            {
                if (e.IsPropertyDepthUomIdRemoved)
                {
                    this.DepthUomId = default(string);
                }
            }
            else
            {
                this.DepthUomId = e.DepthUomId;
            }

            if (e.ProductDepth == null)
            {
                if (e.IsPropertyProductDepthRemoved)
                {
                    this.ProductDepth = default(decimal?);
                }
            }
            else
            {
                this.ProductDepth = e.ProductDepth;
            }

            if (e.ShippingDepth == null)
            {
                if (e.IsPropertyShippingDepthRemoved)
                {
                    this.ShippingDepth = default(decimal?);
                }
            }
            else
            {
                this.ShippingDepth = e.ShippingDepth;
            }

            if (e.DiameterUomId == null)
            {
                if (e.IsPropertyDiameterUomIdRemoved)
                {
                    this.DiameterUomId = default(string);
                }
            }
            else
            {
                this.DiameterUomId = e.DiameterUomId;
            }

            if (e.ProductDiameter == null)
            {
                if (e.IsPropertyProductDiameterRemoved)
                {
                    this.ProductDiameter = default(decimal?);
                }
            }
            else
            {
                this.ProductDiameter = e.ProductDiameter;
            }

            if (e.ProductRating == null)
            {
                if (e.IsPropertyProductRatingRemoved)
                {
                    this.ProductRating = default(decimal?);
                }
            }
            else
            {
                this.ProductRating = e.ProductRating;
            }

            if (e.RatingTypeEnum == null)
            {
                if (e.IsPropertyRatingTypeEnumRemoved)
                {
                    this.RatingTypeEnum = default(string);
                }
            }
            else
            {
                this.RatingTypeEnum = e.RatingTypeEnum;
            }

            if (e.Returnable == null)
            {
                if (e.IsPropertyReturnableRemoved)
                {
                    this.Returnable = default(string);
                }
            }
            else
            {
                this.Returnable = e.Returnable;
            }

            if (e.Taxable == null)
            {
                if (e.IsPropertyTaxableRemoved)
                {
                    this.Taxable = default(string);
                }
            }
            else
            {
                this.Taxable = e.Taxable;
            }

            if (e.ChargeShipping == null)
            {
                if (e.IsPropertyChargeShippingRemoved)
                {
                    this.ChargeShipping = default(string);
                }
            }
            else
            {
                this.ChargeShipping = e.ChargeShipping;
            }

            if (e.AutoCreateKeywords == null)
            {
                if (e.IsPropertyAutoCreateKeywordsRemoved)
                {
                    this.AutoCreateKeywords = default(string);
                }
            }
            else
            {
                this.AutoCreateKeywords = e.AutoCreateKeywords;
            }

            if (e.IncludeInPromotions == null)
            {
                if (e.IsPropertyIncludeInPromotionsRemoved)
                {
                    this.IncludeInPromotions = default(string);
                }
            }
            else
            {
                this.IncludeInPromotions = e.IncludeInPromotions;
            }

            if (e.IsVirtual == null)
            {
                if (e.IsPropertyIsVirtualRemoved)
                {
                    this.IsVirtual = default(string);
                }
            }
            else
            {
                this.IsVirtual = e.IsVirtual;
            }

            if (e.IsVariant == null)
            {
                if (e.IsPropertyIsVariantRemoved)
                {
                    this.IsVariant = default(string);
                }
            }
            else
            {
                this.IsVariant = e.IsVariant;
            }

            if (e.VirtualVariantMethodEnum == null)
            {
                if (e.IsPropertyVirtualVariantMethodEnumRemoved)
                {
                    this.VirtualVariantMethodEnum = default(string);
                }
            }
            else
            {
                this.VirtualVariantMethodEnum = e.VirtualVariantMethodEnum;
            }

            if (e.InShippingBox == null)
            {
                if (e.IsPropertyInShippingBoxRemoved)
                {
                    this.InShippingBox = default(string);
                }
            }
            else
            {
                this.InShippingBox = e.InShippingBox;
            }

            if (e.DefaultShipmentBoxTypeId == null)
            {
                if (e.IsPropertyDefaultShipmentBoxTypeIdRemoved)
                {
                    this.DefaultShipmentBoxTypeId = default(string);
                }
            }
            else
            {
                this.DefaultShipmentBoxTypeId = e.DefaultShipmentBoxTypeId;
            }

            if (e.IsSerialNumbered == null)
            {
                if (e.IsPropertyIsSerialNumberedRemoved)
                {
                    this.IsSerialNumbered = default(bool);
                }
            }
            else
            {
                this.IsSerialNumbered = (e.IsSerialNumbered != null && e.IsSerialNumbered.HasValue) ? e.IsSerialNumbered.Value : default(bool);
            }

            if (e.IsManagedByLot == null)
            {
                if (e.IsPropertyIsManagedByLotRemoved)
                {
                    this.IsManagedByLot = default(bool);
                }
            }
            else
            {
                this.IsManagedByLot = (e.IsManagedByLot != null && e.IsManagedByLot.HasValue) ? e.IsManagedByLot.Value : default(bool);
            }

            if (e.AttributeSetId == null)
            {
                if (e.IsPropertyAttributeSetIdRemoved)
                {
                    this.AttributeSetId = default(string);
                }
            }
            else
            {
                this.AttributeSetId = e.AttributeSetId;
            }

            if (e.AttributeSetInstanceId == null)
            {
                if (e.IsPropertyAttributeSetInstanceIdRemoved)
                {
                    this.AttributeSetInstanceId = default(string);
                }
            }
            else
            {
                this.AttributeSetInstanceId = e.AttributeSetInstanceId;
            }

            if (e.Grade == null)
            {
                if (e.IsPropertyGradeRemoved)
                {
                    this.Grade = default(string);
                }
            }
            else
            {
                this.Grade = e.Grade;
            }

            if (e.Gsm == null)
            {
                if (e.IsPropertyGsmRemoved)
                {
                    this.Gsm = default(decimal?);
                }
            }
            else
            {
                this.Gsm = e.Gsm;
            }

            if (e.CoreDiameter == null)
            {
                if (e.IsPropertyCoreDiameterRemoved)
                {
                    this.CoreDiameter = default(decimal?);
                }
            }
            else
            {
                this.CoreDiameter = e.CoreDiameter;
            }

            if (e.OutsideDiameter == null)
            {
                if (e.IsPropertyOutsideDiameterRemoved)
                {
                    this.OutsideDiameter = default(decimal?);
                }
            }
            else
            {
                this.OutsideDiameter = e.OutsideDiameter;
            }

            if (e.MoisturePct == null)
            {
                if (e.IsPropertyMoisturePctRemoved)
                {
                    this.MoisturePct = default(decimal?);
                }
            }
            else
            {
                this.MoisturePct = e.MoisturePct;
            }

            if (e.RollCnt == null)
            {
                if (e.IsPropertyRollCntRemoved)
                {
                    this.RollCnt = default(string);
                }
            }
            else
            {
                this.RollCnt = e.RollCnt;
            }

            if (e.Active == null)
            {
                if (e.IsPropertyActiveRemoved)
                {
                    this.Active = default(bool);
                }
            }
            else
            {
                this.Active = (e.Active != null && e.Active.HasValue) ? e.Active.Value : default(bool);
            }


            this.UpdatedBy = e.CreatedBy;
            this.UpdatedAt = e.CreatedAt;


            foreach (IGoodIdentificationEvent innerEvent in e.GoodIdentificationEvents)
            {
                IGoodIdentificationState innerState = this.GoodIdentifications.Get(innerEvent.GlobalId.GoodIdentificationTypeId);

                innerState.Mutate(innerEvent);
                var removed = innerEvent as IGoodIdentificationStateRemoved;
                if (removed != null)
                {
                    this.GoodIdentifications.Remove(innerState);
                }
            }
        }
Exemplo n.º 2
0
        public virtual void MergePatch(IMergePatchProduct c)
        {
            IProductStateMergePatched e = Map(c);

            Apply(e);
        }
Exemplo n.º 3
0
        public virtual ProductStateMergePatchedDto ToProductStateMergePatchedDto(IProductStateMergePatched e)
        {
            var dto = new ProductStateMergePatchedDto();

            dto.ProductEventId             = e.ProductEventId;
            dto.CreatedAt                  = e.CreatedAt;
            dto.CreatedBy                  = e.CreatedBy;
            dto.CommandId                  = e.CommandId;
            dto.ProductTypeId              = e.ProductTypeId;
            dto.PrimaryProductCategoryId   = e.PrimaryProductCategoryId;
            dto.ManufacturerPartyId        = e.ManufacturerPartyId;
            dto.FacilityId                 = e.FacilityId;
            dto.IntroductionDate           = e.IntroductionDate;
            dto.ReleaseDate                = e.ReleaseDate;
            dto.SupportDiscontinuationDate = e.SupportDiscontinuationDate;
            dto.SalesDiscontinuationDate   = e.SalesDiscontinuationDate;
            dto.SalesDiscWhenNotAvail      = e.SalesDiscWhenNotAvail;
            dto.InternalName               = e.InternalName;
            dto.BrandName                  = e.BrandName;
            dto.Comments                 = e.Comments;
            dto.ProductName              = e.ProductName;
            dto.Description              = e.Description;
            dto.PriceDetailText          = e.PriceDetailText;
            dto.SmallImageUrl            = e.SmallImageUrl;
            dto.MediumImageUrl           = e.MediumImageUrl;
            dto.LargeImageUrl            = e.LargeImageUrl;
            dto.DetailImageUrl           = e.DetailImageUrl;
            dto.OriginalImageUrl         = e.OriginalImageUrl;
            dto.DetailScreen             = e.DetailScreen;
            dto.InventoryMessage         = e.InventoryMessage;
            dto.InventoryItemTypeId      = e.InventoryItemTypeId;
            dto.RequireInventory         = e.RequireInventory;
            dto.QuantityUomId            = e.QuantityUomId;
            dto.QuantityIncluded         = e.QuantityIncluded;
            dto.PiecesIncluded           = e.PiecesIncluded;
            dto.RequireAmount            = e.RequireAmount;
            dto.FixedAmount              = e.FixedAmount;
            dto.AmountUomTypeId          = e.AmountUomTypeId;
            dto.WeightUomId              = e.WeightUomId;
            dto.ShippingWeight           = e.ShippingWeight;
            dto.ProductWeight            = e.ProductWeight;
            dto.HeightUomId              = e.HeightUomId;
            dto.ProductHeight            = e.ProductHeight;
            dto.ShippingHeight           = e.ShippingHeight;
            dto.WidthUomId               = e.WidthUomId;
            dto.ProductWidth             = e.ProductWidth;
            dto.ShippingWidth            = e.ShippingWidth;
            dto.DepthUomId               = e.DepthUomId;
            dto.ProductDepth             = e.ProductDepth;
            dto.ShippingDepth            = e.ShippingDepth;
            dto.DiameterUomId            = e.DiameterUomId;
            dto.ProductDiameter          = e.ProductDiameter;
            dto.ProductRating            = e.ProductRating;
            dto.RatingTypeEnum           = e.RatingTypeEnum;
            dto.Returnable               = e.Returnable;
            dto.Taxable                  = e.Taxable;
            dto.ChargeShipping           = e.ChargeShipping;
            dto.AutoCreateKeywords       = e.AutoCreateKeywords;
            dto.IncludeInPromotions      = e.IncludeInPromotions;
            dto.IsVirtual                = e.IsVirtual;
            dto.IsVariant                = e.IsVariant;
            dto.VirtualVariantMethodEnum = e.VirtualVariantMethodEnum;
            dto.InShippingBox            = e.InShippingBox;
            dto.DefaultShipmentBoxTypeId = e.DefaultShipmentBoxTypeId;
            dto.IsSerialNumbered         = e.IsSerialNumbered;
            dto.IsManagedByLot           = e.IsManagedByLot;
            dto.AttributeSetId           = e.AttributeSetId;
            dto.AttributeSetInstanceId   = e.AttributeSetInstanceId;
            dto.Active = e.Active;
            dto.IsPropertyProductTypeIdRemoved            = e.IsPropertyProductTypeIdRemoved;
            dto.IsPropertyPrimaryProductCategoryIdRemoved = e.IsPropertyPrimaryProductCategoryIdRemoved;
            dto.IsPropertyManufacturerPartyIdRemoved      = e.IsPropertyManufacturerPartyIdRemoved;
            dto.IsPropertyFacilityIdRemoved                 = e.IsPropertyFacilityIdRemoved;
            dto.IsPropertyIntroductionDateRemoved           = e.IsPropertyIntroductionDateRemoved;
            dto.IsPropertyReleaseDateRemoved                = e.IsPropertyReleaseDateRemoved;
            dto.IsPropertySupportDiscontinuationDateRemoved = e.IsPropertySupportDiscontinuationDateRemoved;
            dto.IsPropertySalesDiscontinuationDateRemoved   = e.IsPropertySalesDiscontinuationDateRemoved;
            dto.IsPropertySalesDiscWhenNotAvailRemoved      = e.IsPropertySalesDiscWhenNotAvailRemoved;
            dto.IsPropertyInternalNameRemoved               = e.IsPropertyInternalNameRemoved;
            dto.IsPropertyBrandNameRemoved                = e.IsPropertyBrandNameRemoved;
            dto.IsPropertyCommentsRemoved                 = e.IsPropertyCommentsRemoved;
            dto.IsPropertyProductNameRemoved              = e.IsPropertyProductNameRemoved;
            dto.IsPropertyDescriptionRemoved              = e.IsPropertyDescriptionRemoved;
            dto.IsPropertyPriceDetailTextRemoved          = e.IsPropertyPriceDetailTextRemoved;
            dto.IsPropertySmallImageUrlRemoved            = e.IsPropertySmallImageUrlRemoved;
            dto.IsPropertyMediumImageUrlRemoved           = e.IsPropertyMediumImageUrlRemoved;
            dto.IsPropertyLargeImageUrlRemoved            = e.IsPropertyLargeImageUrlRemoved;
            dto.IsPropertyDetailImageUrlRemoved           = e.IsPropertyDetailImageUrlRemoved;
            dto.IsPropertyOriginalImageUrlRemoved         = e.IsPropertyOriginalImageUrlRemoved;
            dto.IsPropertyDetailScreenRemoved             = e.IsPropertyDetailScreenRemoved;
            dto.IsPropertyInventoryMessageRemoved         = e.IsPropertyInventoryMessageRemoved;
            dto.IsPropertyInventoryItemTypeIdRemoved      = e.IsPropertyInventoryItemTypeIdRemoved;
            dto.IsPropertyRequireInventoryRemoved         = e.IsPropertyRequireInventoryRemoved;
            dto.IsPropertyQuantityUomIdRemoved            = e.IsPropertyQuantityUomIdRemoved;
            dto.IsPropertyQuantityIncludedRemoved         = e.IsPropertyQuantityIncludedRemoved;
            dto.IsPropertyPiecesIncludedRemoved           = e.IsPropertyPiecesIncludedRemoved;
            dto.IsPropertyRequireAmountRemoved            = e.IsPropertyRequireAmountRemoved;
            dto.IsPropertyFixedAmountRemoved              = e.IsPropertyFixedAmountRemoved;
            dto.IsPropertyAmountUomTypeIdRemoved          = e.IsPropertyAmountUomTypeIdRemoved;
            dto.IsPropertyWeightUomIdRemoved              = e.IsPropertyWeightUomIdRemoved;
            dto.IsPropertyShippingWeightRemoved           = e.IsPropertyShippingWeightRemoved;
            dto.IsPropertyProductWeightRemoved            = e.IsPropertyProductWeightRemoved;
            dto.IsPropertyHeightUomIdRemoved              = e.IsPropertyHeightUomIdRemoved;
            dto.IsPropertyProductHeightRemoved            = e.IsPropertyProductHeightRemoved;
            dto.IsPropertyShippingHeightRemoved           = e.IsPropertyShippingHeightRemoved;
            dto.IsPropertyWidthUomIdRemoved               = e.IsPropertyWidthUomIdRemoved;
            dto.IsPropertyProductWidthRemoved             = e.IsPropertyProductWidthRemoved;
            dto.IsPropertyShippingWidthRemoved            = e.IsPropertyShippingWidthRemoved;
            dto.IsPropertyDepthUomIdRemoved               = e.IsPropertyDepthUomIdRemoved;
            dto.IsPropertyProductDepthRemoved             = e.IsPropertyProductDepthRemoved;
            dto.IsPropertyShippingDepthRemoved            = e.IsPropertyShippingDepthRemoved;
            dto.IsPropertyDiameterUomIdRemoved            = e.IsPropertyDiameterUomIdRemoved;
            dto.IsPropertyProductDiameterRemoved          = e.IsPropertyProductDiameterRemoved;
            dto.IsPropertyProductRatingRemoved            = e.IsPropertyProductRatingRemoved;
            dto.IsPropertyRatingTypeEnumRemoved           = e.IsPropertyRatingTypeEnumRemoved;
            dto.IsPropertyReturnableRemoved               = e.IsPropertyReturnableRemoved;
            dto.IsPropertyTaxableRemoved                  = e.IsPropertyTaxableRemoved;
            dto.IsPropertyChargeShippingRemoved           = e.IsPropertyChargeShippingRemoved;
            dto.IsPropertyAutoCreateKeywordsRemoved       = e.IsPropertyAutoCreateKeywordsRemoved;
            dto.IsPropertyIncludeInPromotionsRemoved      = e.IsPropertyIncludeInPromotionsRemoved;
            dto.IsPropertyIsVirtualRemoved                = e.IsPropertyIsVirtualRemoved;
            dto.IsPropertyIsVariantRemoved                = e.IsPropertyIsVariantRemoved;
            dto.IsPropertyVirtualVariantMethodEnumRemoved = e.IsPropertyVirtualVariantMethodEnumRemoved;
            dto.IsPropertyInShippingBoxRemoved            = e.IsPropertyInShippingBoxRemoved;
            dto.IsPropertyDefaultShipmentBoxTypeIdRemoved = e.IsPropertyDefaultShipmentBoxTypeIdRemoved;
            dto.IsPropertyIsSerialNumberedRemoved         = e.IsPropertyIsSerialNumberedRemoved;
            dto.IsPropertyIsManagedByLotRemoved           = e.IsPropertyIsManagedByLotRemoved;
            dto.IsPropertyAttributeSetIdRemoved           = e.IsPropertyAttributeSetIdRemoved;
            dto.IsPropertyAttributeSetInstanceIdRemoved   = e.IsPropertyAttributeSetInstanceIdRemoved;
            dto.IsPropertyActiveRemoved = e.IsPropertyActiveRemoved;
            var goodIdentificationEvents = new List <GoodIdentificationStateCreatedOrMergePatchedOrRemovedDto>();

            foreach (var ee in e.GoodIdentificationEvents)
            {
                GoodIdentificationStateCreatedOrMergePatchedOrRemovedDto eeDto = GoodIdentificationStateEventDtoConverter.ToGoodIdentificationStateEventDto(ee);
                goodIdentificationEvents.Add(eeDto);
            }
            dto.GoodIdentificationEvents = goodIdentificationEvents.ToArray();


            return(dto);
        }
Exemplo n.º 4
0
        protected virtual IProductStateMergePatched Map(IMergePatchProduct c)
        {
            var stateEventId            = new ProductEventId(c.ProductId, c.Version);
            IProductStateMergePatched e = NewProductStateMergePatched(stateEventId);

            e.ProductTypeId            = c.ProductTypeId;
            e.PrimaryProductCategoryId = c.PrimaryProductCategoryId;
            e.ManufacturerPartyId      = c.ManufacturerPartyId;
            e.FacilityId                 = c.FacilityId;
            e.IntroductionDate           = c.IntroductionDate;
            e.ReleaseDate                = c.ReleaseDate;
            e.SupportDiscontinuationDate = c.SupportDiscontinuationDate;
            e.SalesDiscontinuationDate   = c.SalesDiscontinuationDate;
            e.SalesDiscWhenNotAvail      = c.SalesDiscWhenNotAvail;
            e.InternalName               = c.InternalName;
            e.BrandName                = c.BrandName;
            e.Comments                 = c.Comments;
            e.ProductName              = c.ProductName;
            e.Description              = c.Description;
            e.PriceDetailText          = c.PriceDetailText;
            e.SmallImageUrl            = c.SmallImageUrl;
            e.MediumImageUrl           = c.MediumImageUrl;
            e.LargeImageUrl            = c.LargeImageUrl;
            e.DetailImageUrl           = c.DetailImageUrl;
            e.OriginalImageUrl         = c.OriginalImageUrl;
            e.DetailScreen             = c.DetailScreen;
            e.InventoryMessage         = c.InventoryMessage;
            e.InventoryItemTypeId      = c.InventoryItemTypeId;
            e.RequireInventory         = c.RequireInventory;
            e.QuantityUomId            = c.QuantityUomId;
            e.QuantityIncluded         = c.QuantityIncluded;
            e.PiecesIncluded           = c.PiecesIncluded;
            e.RequireAmount            = c.RequireAmount;
            e.FixedAmount              = c.FixedAmount;
            e.AmountUomTypeId          = c.AmountUomTypeId;
            e.WeightUomId              = c.WeightUomId;
            e.ShippingWeight           = c.ShippingWeight;
            e.ProductWeight            = c.ProductWeight;
            e.HeightUomId              = c.HeightUomId;
            e.ProductHeight            = c.ProductHeight;
            e.ShippingHeight           = c.ShippingHeight;
            e.WidthUomId               = c.WidthUomId;
            e.ProductWidth             = c.ProductWidth;
            e.ShippingWidth            = c.ShippingWidth;
            e.DepthUomId               = c.DepthUomId;
            e.ProductDepth             = c.ProductDepth;
            e.ShippingDepth            = c.ShippingDepth;
            e.DiameterUomId            = c.DiameterUomId;
            e.ProductDiameter          = c.ProductDiameter;
            e.ProductRating            = c.ProductRating;
            e.RatingTypeEnum           = c.RatingTypeEnum;
            e.Returnable               = c.Returnable;
            e.Taxable                  = c.Taxable;
            e.ChargeShipping           = c.ChargeShipping;
            e.AutoCreateKeywords       = c.AutoCreateKeywords;
            e.IncludeInPromotions      = c.IncludeInPromotions;
            e.IsVirtual                = c.IsVirtual;
            e.IsVariant                = c.IsVariant;
            e.VirtualVariantMethodEnum = c.VirtualVariantMethodEnum;
            e.InShippingBox            = c.InShippingBox;
            e.DefaultShipmentBoxTypeId = c.DefaultShipmentBoxTypeId;
            e.IsSerialNumbered         = c.IsSerialNumbered;
            e.IsManagedByLot           = c.IsManagedByLot;
            e.AttributeSetId           = c.AttributeSetId;
            e.AttributeSetInstanceId   = c.AttributeSetInstanceId;
            e.Active = c.Active;
            e.IsPropertyProductTypeIdRemoved            = c.IsPropertyProductTypeIdRemoved;
            e.IsPropertyPrimaryProductCategoryIdRemoved = c.IsPropertyPrimaryProductCategoryIdRemoved;
            e.IsPropertyManufacturerPartyIdRemoved      = c.IsPropertyManufacturerPartyIdRemoved;
            e.IsPropertyFacilityIdRemoved                 = c.IsPropertyFacilityIdRemoved;
            e.IsPropertyIntroductionDateRemoved           = c.IsPropertyIntroductionDateRemoved;
            e.IsPropertyReleaseDateRemoved                = c.IsPropertyReleaseDateRemoved;
            e.IsPropertySupportDiscontinuationDateRemoved = c.IsPropertySupportDiscontinuationDateRemoved;
            e.IsPropertySalesDiscontinuationDateRemoved   = c.IsPropertySalesDiscontinuationDateRemoved;
            e.IsPropertySalesDiscWhenNotAvailRemoved      = c.IsPropertySalesDiscWhenNotAvailRemoved;
            e.IsPropertyInternalNameRemoved               = c.IsPropertyInternalNameRemoved;
            e.IsPropertyBrandNameRemoved                = c.IsPropertyBrandNameRemoved;
            e.IsPropertyCommentsRemoved                 = c.IsPropertyCommentsRemoved;
            e.IsPropertyProductNameRemoved              = c.IsPropertyProductNameRemoved;
            e.IsPropertyDescriptionRemoved              = c.IsPropertyDescriptionRemoved;
            e.IsPropertyPriceDetailTextRemoved          = c.IsPropertyPriceDetailTextRemoved;
            e.IsPropertySmallImageUrlRemoved            = c.IsPropertySmallImageUrlRemoved;
            e.IsPropertyMediumImageUrlRemoved           = c.IsPropertyMediumImageUrlRemoved;
            e.IsPropertyLargeImageUrlRemoved            = c.IsPropertyLargeImageUrlRemoved;
            e.IsPropertyDetailImageUrlRemoved           = c.IsPropertyDetailImageUrlRemoved;
            e.IsPropertyOriginalImageUrlRemoved         = c.IsPropertyOriginalImageUrlRemoved;
            e.IsPropertyDetailScreenRemoved             = c.IsPropertyDetailScreenRemoved;
            e.IsPropertyInventoryMessageRemoved         = c.IsPropertyInventoryMessageRemoved;
            e.IsPropertyInventoryItemTypeIdRemoved      = c.IsPropertyInventoryItemTypeIdRemoved;
            e.IsPropertyRequireInventoryRemoved         = c.IsPropertyRequireInventoryRemoved;
            e.IsPropertyQuantityUomIdRemoved            = c.IsPropertyQuantityUomIdRemoved;
            e.IsPropertyQuantityIncludedRemoved         = c.IsPropertyQuantityIncludedRemoved;
            e.IsPropertyPiecesIncludedRemoved           = c.IsPropertyPiecesIncludedRemoved;
            e.IsPropertyRequireAmountRemoved            = c.IsPropertyRequireAmountRemoved;
            e.IsPropertyFixedAmountRemoved              = c.IsPropertyFixedAmountRemoved;
            e.IsPropertyAmountUomTypeIdRemoved          = c.IsPropertyAmountUomTypeIdRemoved;
            e.IsPropertyWeightUomIdRemoved              = c.IsPropertyWeightUomIdRemoved;
            e.IsPropertyShippingWeightRemoved           = c.IsPropertyShippingWeightRemoved;
            e.IsPropertyProductWeightRemoved            = c.IsPropertyProductWeightRemoved;
            e.IsPropertyHeightUomIdRemoved              = c.IsPropertyHeightUomIdRemoved;
            e.IsPropertyProductHeightRemoved            = c.IsPropertyProductHeightRemoved;
            e.IsPropertyShippingHeightRemoved           = c.IsPropertyShippingHeightRemoved;
            e.IsPropertyWidthUomIdRemoved               = c.IsPropertyWidthUomIdRemoved;
            e.IsPropertyProductWidthRemoved             = c.IsPropertyProductWidthRemoved;
            e.IsPropertyShippingWidthRemoved            = c.IsPropertyShippingWidthRemoved;
            e.IsPropertyDepthUomIdRemoved               = c.IsPropertyDepthUomIdRemoved;
            e.IsPropertyProductDepthRemoved             = c.IsPropertyProductDepthRemoved;
            e.IsPropertyShippingDepthRemoved            = c.IsPropertyShippingDepthRemoved;
            e.IsPropertyDiameterUomIdRemoved            = c.IsPropertyDiameterUomIdRemoved;
            e.IsPropertyProductDiameterRemoved          = c.IsPropertyProductDiameterRemoved;
            e.IsPropertyProductRatingRemoved            = c.IsPropertyProductRatingRemoved;
            e.IsPropertyRatingTypeEnumRemoved           = c.IsPropertyRatingTypeEnumRemoved;
            e.IsPropertyReturnableRemoved               = c.IsPropertyReturnableRemoved;
            e.IsPropertyTaxableRemoved                  = c.IsPropertyTaxableRemoved;
            e.IsPropertyChargeShippingRemoved           = c.IsPropertyChargeShippingRemoved;
            e.IsPropertyAutoCreateKeywordsRemoved       = c.IsPropertyAutoCreateKeywordsRemoved;
            e.IsPropertyIncludeInPromotionsRemoved      = c.IsPropertyIncludeInPromotionsRemoved;
            e.IsPropertyIsVirtualRemoved                = c.IsPropertyIsVirtualRemoved;
            e.IsPropertyIsVariantRemoved                = c.IsPropertyIsVariantRemoved;
            e.IsPropertyVirtualVariantMethodEnumRemoved = c.IsPropertyVirtualVariantMethodEnumRemoved;
            e.IsPropertyInShippingBoxRemoved            = c.IsPropertyInShippingBoxRemoved;
            e.IsPropertyDefaultShipmentBoxTypeIdRemoved = c.IsPropertyDefaultShipmentBoxTypeIdRemoved;
            e.IsPropertyIsSerialNumberedRemoved         = c.IsPropertyIsSerialNumberedRemoved;
            e.IsPropertyIsManagedByLotRemoved           = c.IsPropertyIsManagedByLotRemoved;
            e.IsPropertyAttributeSetIdRemoved           = c.IsPropertyAttributeSetIdRemoved;
            e.IsPropertyAttributeSetInstanceIdRemoved   = c.IsPropertyAttributeSetInstanceIdRemoved;
            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 (IGoodIdentificationCommand innerCommand in c.GoodIdentificationCommands)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IGoodIdentificationEvent innerEvent = Map(innerCommand, c, version, _state);
                e.AddGoodIdentificationEvent(innerEvent);
            }


            return(e);
        }