public virtual void Initialize(IShipmentReceiptMvoStateCreated stateCreated) { var aggregateId = stateCreated.ShipmentReceiptMvoEventId.ShipmentReceiptId; var state = new ShipmentReceiptMvoState(); state.ShipmentReceiptId = aggregateId; var aggregate = (ShipmentReceiptMvoAggregate)GetShipmentReceiptMvoAggregate(state); var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId); aggregate.Apply(stateCreated); Persist(eventStoreAggregateId, aggregate, state); }
public virtual IShipmentReceiptMvoState ToShipmentReceiptMvoState() { var state = new ShipmentReceiptMvoState(true); state.ShipmentReceiptId = this.ShipmentReceiptId; state.ProductId = this.ProductId; state.AttributeSetInstanceId = this.AttributeSetInstanceId; state.LocatorId = this.LocatorId; state.ShipmentItemSeqId = this.ShipmentItemSeqId; state.ShipmentPackageSeqId = this.ShipmentPackageSeqId; state.OrderId = this.OrderId; state.OrderItemSeqId = this.OrderItemSeqId; state.ReturnId = this.ReturnId; state.ReturnItemSeqId = this.ReturnItemSeqId; state.RejectionReasonId = this.RejectionReasonId; state.DamageStatusId = this.DamageStatusId; state.DamageReasonId = this.DamageReasonId; state.ReceivedBy = this.ReceivedBy; state.DatetimeReceived = this.DatetimeReceived; state.ItemDescription = this.ItemDescription; state.AcceptedQuantity = this.AcceptedQuantity; state.RejectedQuantity = this.RejectedQuantity; state.DamagedQuantity = this.DamagedQuantity; if (this.Version != null && this.Version.HasValue) { state.Version = this.Version.Value; } if (this.Active != null && this.Active.HasValue) { state.Active = this.Active.Value; } state.ShipmentShipmentTypeId = this.ShipmentShipmentTypeId; state.ShipmentStatusId = this.ShipmentStatusId; state.ShipmentPrimaryOrderId = this.ShipmentPrimaryOrderId; state.ShipmentPrimaryReturnId = this.ShipmentPrimaryReturnId; state.ShipmentPrimaryShipGroupSeqId = this.ShipmentPrimaryShipGroupSeqId; state.ShipmentPicklistBinId = this.ShipmentPicklistBinId; state.ShipmentEstimatedReadyDate = this.ShipmentEstimatedReadyDate; state.ShipmentEstimatedShipDate = this.ShipmentEstimatedShipDate; state.ShipmentEstimatedShipWorkEffId = this.ShipmentEstimatedShipWorkEffId; state.ShipmentEstimatedArrivalDate = this.ShipmentEstimatedArrivalDate; state.ShipmentEstimatedArrivalWorkEffId = this.ShipmentEstimatedArrivalWorkEffId; state.ShipmentLatestCancelDate = this.ShipmentLatestCancelDate; state.ShipmentEstimatedShipCost = this.ShipmentEstimatedShipCost; state.ShipmentCurrencyUomId = this.ShipmentCurrencyUomId; state.ShipmentHandlingInstructions = this.ShipmentHandlingInstructions; state.ShipmentOriginFacilityId = this.ShipmentOriginFacilityId; state.ShipmentDestinationFacilityId = this.ShipmentDestinationFacilityId; state.ShipmentOriginContactMechId = this.ShipmentOriginContactMechId; state.ShipmentOriginTelecomNumberId = this.ShipmentOriginTelecomNumberId; state.ShipmentDestinationContactMechId = this.ShipmentDestinationContactMechId; state.ShipmentDestinationTelecomNumberId = this.ShipmentDestinationTelecomNumberId; state.ShipmentPartyIdTo = this.ShipmentPartyIdTo; state.ShipmentPartyIdFrom = this.ShipmentPartyIdFrom; state.ShipmentAdditionalShippingCharge = this.ShipmentAdditionalShippingCharge; state.ShipmentAddtlShippingChargeDesc = this.ShipmentAddtlShippingChargeDesc; state.ShipmentCreatedBy = this.ShipmentCreatedBy; if (this.ShipmentCreatedAt != null && this.ShipmentCreatedAt.HasValue) { state.ShipmentCreatedAt = this.ShipmentCreatedAt.Value; } state.ShipmentUpdatedBy = this.ShipmentUpdatedBy; if (this.ShipmentUpdatedAt != null && this.ShipmentUpdatedAt.HasValue) { state.ShipmentUpdatedAt = this.ShipmentUpdatedAt.Value; } if (this.ShipmentActive != null && this.ShipmentActive.HasValue) { state.ShipmentActive = this.ShipmentActive.Value; } if (this.ShipmentVersion != null && this.ShipmentVersion.HasValue) { state.ShipmentVersion = this.ShipmentVersion.Value; } state.CreatedBy = this.CreatedBy; if (this.CreatedAt != null && this.CreatedAt.HasValue) { state.CreatedAt = this.CreatedAt.Value; } state.UpdatedBy = this.UpdatedBy; if (this.UpdatedAt != null && this.UpdatedAt.HasValue) { state.UpdatedAt = this.UpdatedAt.Value; } return(state); }
public static CreateShipmentReceiptMvo ToCreateShipmentReceiptMvo(this ShipmentReceiptMvoState state) { return(state.ToCreateShipmentReceiptMvo <CreateShipmentReceiptMvo>()); }
public static MergePatchShipmentReceiptMvo ToMergePatchShipmentReceiptMvo(this ShipmentReceiptMvoState state) { return(state.ToMergePatchShipmentReceiptMvo <MergePatchShipmentReceiptMvo>()); }
public static DeleteShipmentReceiptMvo ToDeleteShipmentReceiptMvo(this ShipmentReceiptMvoState state) { return(state.ToDeleteShipmentReceiptMvo <DeleteShipmentReceiptMvo>()); }
public static IShipmentReceiptMvoCommand ToCreateOrMergePatchShipmentReceiptMvo(this ShipmentReceiptMvoState state) { return(state.ToCreateOrMergePatchShipmentReceiptMvo <CreateShipmentReceiptMvo, MergePatchShipmentReceiptMvo>()); }