public virtual PickwaveStateMergePatchedDto ToPickwaveStateMergePatchedDto(IPickwaveStateMergePatched e)
        {
            var dto = new PickwaveStateMergePatchedDto();

            dto.PickwaveEventId              = e.PickwaveEventId;
            dto.CreatedAt                    = e.CreatedAt;
            dto.CreatedBy                    = e.CreatedBy;
            dto.CommandId                    = e.CommandId;
            dto.StatusId                     = e.StatusId;
            dto.Description                  = e.Description;
            dto.Active                       = e.Active;
            dto.IsPropertyStatusIdRemoved    = e.IsPropertyStatusIdRemoved;
            dto.IsPropertyDescriptionRemoved = e.IsPropertyDescriptionRemoved;
            dto.IsPropertyActiveRemoved      = e.IsPropertyActiveRemoved;

            return(dto);
        }
Example #2
0
        public virtual void When(IPickwaveStateMergePatched e)
        {
            ThrowOnWrongEvent(e);

            if (e.StatusId == null)
            {
                if (e.IsPropertyStatusIdRemoved)
                {
                    this.StatusId = default(string);
                }
            }
            else
            {
                this.StatusId = e.StatusId;
            }

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

            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;
        }
Example #3
0
        protected virtual IPickwaveStateMergePatched Map(IMergePatchPickwave c)
        {
            var stateEventId             = new PickwaveEventId(c.PickwaveId, c.Version);
            IPickwaveStateMergePatched e = NewPickwaveStateMergePatched(stateEventId);

            e.StatusId    = c.StatusId;
            e.Description = c.Description;
            e.Active      = c.Active;
            e.IsPropertyStatusIdRemoved    = c.IsPropertyStatusIdRemoved;
            e.IsPropertyDescriptionRemoved = c.IsPropertyDescriptionRemoved;
            e.IsPropertyActiveRemoved      = c.IsPropertyActiveRemoved;

            e.CommandId = c.CommandId;


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

            var version = c.Version;


            return(e);
        }
Example #4
0
 void IPickwaveState.When(IPickwaveStateMergePatched e)
 {
     throw new NotSupportedException();
 }
Example #5
0
        public virtual void MergePatch(IMergePatchPickwave c)
        {
            IPickwaveStateMergePatched e = Map(c);

            Apply(e);
        }