}// END Map(ICreate... //////////////////////////// protected virtual IOrderItemShipGroupAssociationStateMergePatched MapMergePatch(IMergePatchOrderItemShipGroupAssociation c, IOrderShipGroupCommand outerCommand, long version, IOrderShipGroupState outerState) { c.RequesterId = outerCommand.RequesterId; var stateEventId = new OrderItemShipGroupAssociationEventId(c.OrderId, c.OrderShipGroupShipGroupSeqId, c.OrderItemSeqId, version); IOrderItemShipGroupAssociationStateMergePatched e = NewOrderItemShipGroupAssociationStateMergePatched(stateEventId); var s = outerState.OrderItemShipGroupAssociations.Get(c.OrderItemSeqId); e.Quantity = c.Quantity; e.CancelQuantity = c.CancelQuantity; e.Active = c.Active; e.IsPropertyQuantityRemoved = c.IsPropertyQuantityRemoved; e.IsPropertyCancelQuantityRemoved = c.IsPropertyCancelQuantityRemoved; e.IsPropertyActiveRemoved = c.IsPropertyActiveRemoved; e.CreatedBy = (string)c.RequesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); return(e); }// END Map(IMergePatch... ////////////////////////////
public virtual void When(IOrderItemShipGroupAssociationStateMergePatched e) { ThrowOnWrongEvent(e); if (e.Quantity == null) { if (e.IsPropertyQuantityRemoved) { this.Quantity = default(decimal?); } } else { this.Quantity = e.Quantity; } if (e.CancelQuantity == null) { if (e.IsPropertyCancelQuantityRemoved) { this.CancelQuantity = default(decimal?); } } else { this.CancelQuantity = e.CancelQuantity; } 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; }
public virtual OrderItemShipGroupAssociationStateMergePatchedDto ToOrderItemShipGroupAssociationStateMergePatchedDto(IOrderItemShipGroupAssociationStateMergePatched e) { var dto = new OrderItemShipGroupAssociationStateMergePatchedDto(); dto.OrderItemShipGroupAssociationEventId = e.OrderItemShipGroupAssociationEventId; dto.CreatedAt = e.CreatedAt; dto.CreatedBy = e.CreatedBy; dto.Version = e.Version; dto.CommandId = e.CommandId; dto.Quantity = e.Quantity; dto.CancelQuantity = e.CancelQuantity; dto.Active = e.Active; dto.IsPropertyQuantityRemoved = e.IsPropertyQuantityRemoved; dto.IsPropertyCancelQuantityRemoved = e.IsPropertyCancelQuantityRemoved; dto.IsPropertyActiveRemoved = e.IsPropertyActiveRemoved; return(dto); }
void IOrderItemShipGroupAssociationState.When(IOrderItemShipGroupAssociationStateMergePatched e) { throw new NotSupportedException(); }