protected ShipmentStateMergePatched NewShipmentStateMergePatched(long version, string commandId, string requesterId) { var stateEventId = new ShipmentEventId(_state.ShipmentId, version); var e = NewShipmentStateMergePatched(stateEventId); e.CommandId = commandId; e.CreatedBy = (string)requesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); return(e); }
public override bool Equals(object obj) { if (Object.ReferenceEquals(this, obj)) { return(true); } ShipmentEventId other = obj as ShipmentEventId; if (other == null) { return(false); } return(true && Object.Equals(this.ShipmentId, other.ShipmentId) && Object.Equals(this.Version, other.Version) ); }
protected virtual IShipmentStateCreated Map(ICreateShipment c) { var stateEventId = new ShipmentEventId(c.ShipmentId, c.Version); IShipmentStateCreated e = NewShipmentStateCreated(stateEventId); e.ShipmentTypeId = c.ShipmentTypeId; e.StatusId = c.StatusId; e.PrimaryOrderId = c.PrimaryOrderId; e.PrimaryReturnId = c.PrimaryReturnId; e.PrimaryShipGroupSeqId = c.PrimaryShipGroupSeqId; e.PicklistBinId = c.PicklistBinId; e.BolNumber = c.BolNumber; e.SealNumber = c.SealNumber; e.VehicleId = c.VehicleId; e.ExternalOrderNumber = c.ExternalOrderNumber; e.Carrier = c.Carrier; e.DateShipped = c.DateShipped; e.EstimatedReadyDate = c.EstimatedReadyDate; e.EstimatedShipDate = c.EstimatedShipDate; e.EstimatedShipWorkEffId = c.EstimatedShipWorkEffId; e.EstimatedArrivalDate = c.EstimatedArrivalDate; e.EstimatedArrivalWorkEffId = c.EstimatedArrivalWorkEffId; e.LatestCancelDate = c.LatestCancelDate; e.EstimatedShipCost = c.EstimatedShipCost; e.CurrencyUomId = c.CurrencyUomId; e.HandlingInstructions = c.HandlingInstructions; e.OriginFacilityId = c.OriginFacilityId; e.DestinationFacilityId = c.DestinationFacilityId; e.OriginContactMechId = c.OriginContactMechId; e.OriginTelecomNumberId = c.OriginTelecomNumberId; e.DestinationContactMechId = c.DestinationContactMechId; e.DestinationTelecomNumberId = c.DestinationTelecomNumberId; e.PartyIdTo = c.PartyIdTo; e.PartyIdFrom = c.PartyIdFrom; e.AdditionalShippingCharge = c.AdditionalShippingCharge; e.AddtlShippingChargeDesc = c.AddtlShippingChargeDesc; e.Active = c.Active; e.CommandId = c.CommandId; e.CreatedBy = (string)c.RequesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); var version = c.Version; foreach (ICreateShipmentImage innerCommand in c.ShipmentImages) { ThrowOnInconsistentCommands(c, innerCommand); IShipmentImageStateCreated innerEvent = MapCreate(innerCommand, c, version, _state); e.AddShipmentImageEvent(innerEvent); } foreach (ICreateShipmentItem innerCommand in c.ShipmentItems) { ThrowOnInconsistentCommands(c, innerCommand); IShipmentItemStateCreated innerEvent = MapCreate(innerCommand, c, version, _state); e.AddShipmentItemEvent(innerEvent); } foreach (ICreateShipmentReceipt innerCommand in c.ShipmentReceipts) { ThrowOnInconsistentCommands(c, innerCommand); IShipmentReceiptStateCreated innerEvent = MapCreate(innerCommand, c, version, _state); e.AddShipmentReceiptEvent(innerEvent); } foreach (ICreateItemIssuance innerCommand in c.ItemIssuances) { ThrowOnInconsistentCommands(c, innerCommand); IItemIssuanceStateCreated innerEvent = MapCreate(innerCommand, c, version, _state); e.AddItemIssuanceEvent(innerEvent); } return(e); }
private ShipmentStateMergePatched NewShipmentStateMergePatched(ShipmentEventId stateEventId) { return(new ShipmentStateMergePatched(stateEventId)); }
//////////////////////// private ShipmentStateCreated NewShipmentStateCreated(ShipmentEventId stateEventId) { return(new ShipmentStateCreated(stateEventId)); }
protected ShipmentEventBase(ShipmentEventId stateEventId) { this.ShipmentEventId = stateEventId; }
public ShipmentStateMergePatched(ShipmentEventId stateEventId) : base(stateEventId) { }
public ShipmentStateCreated(ShipmentEventId stateEventId) : base(stateEventId) { }
protected ShipmentStateEventBase(ShipmentEventId stateEventId) : base(stateEventId) { }
protected virtual IShipmentStateMergePatched Map(IMergePatchShipment c) { var stateEventId = new ShipmentEventId(c.ShipmentId, c.Version); IShipmentStateMergePatched e = NewShipmentStateMergePatched(stateEventId); e.ShipmentTypeId = c.ShipmentTypeId; e.StatusId = c.StatusId; e.PrimaryOrderId = c.PrimaryOrderId; e.PrimaryReturnId = c.PrimaryReturnId; e.PrimaryShipGroupSeqId = c.PrimaryShipGroupSeqId; e.PicklistBinId = c.PicklistBinId; e.EstimatedReadyDate = c.EstimatedReadyDate; e.EstimatedShipDate = c.EstimatedShipDate; e.EstimatedShipWorkEffId = c.EstimatedShipWorkEffId; e.EstimatedArrivalDate = c.EstimatedArrivalDate; e.EstimatedArrivalWorkEffId = c.EstimatedArrivalWorkEffId; e.LatestCancelDate = c.LatestCancelDate; e.EstimatedShipCost = c.EstimatedShipCost; e.CurrencyUomId = c.CurrencyUomId; e.HandlingInstructions = c.HandlingInstructions; e.OriginFacilityId = c.OriginFacilityId; e.DestinationFacilityId = c.DestinationFacilityId; e.OriginContactMechId = c.OriginContactMechId; e.OriginTelecomNumberId = c.OriginTelecomNumberId; e.DestinationContactMechId = c.DestinationContactMechId; e.DestinationTelecomNumberId = c.DestinationTelecomNumberId; e.PartyIdTo = c.PartyIdTo; e.PartyIdFrom = c.PartyIdFrom; e.AdditionalShippingCharge = c.AdditionalShippingCharge; e.AddtlShippingChargeDesc = c.AddtlShippingChargeDesc; e.Active = c.Active; e.IsPropertyShipmentTypeIdRemoved = c.IsPropertyShipmentTypeIdRemoved; e.IsPropertyStatusIdRemoved = c.IsPropertyStatusIdRemoved; e.IsPropertyPrimaryOrderIdRemoved = c.IsPropertyPrimaryOrderIdRemoved; e.IsPropertyPrimaryReturnIdRemoved = c.IsPropertyPrimaryReturnIdRemoved; e.IsPropertyPrimaryShipGroupSeqIdRemoved = c.IsPropertyPrimaryShipGroupSeqIdRemoved; e.IsPropertyPicklistBinIdRemoved = c.IsPropertyPicklistBinIdRemoved; e.IsPropertyEstimatedReadyDateRemoved = c.IsPropertyEstimatedReadyDateRemoved; e.IsPropertyEstimatedShipDateRemoved = c.IsPropertyEstimatedShipDateRemoved; e.IsPropertyEstimatedShipWorkEffIdRemoved = c.IsPropertyEstimatedShipWorkEffIdRemoved; e.IsPropertyEstimatedArrivalDateRemoved = c.IsPropertyEstimatedArrivalDateRemoved; e.IsPropertyEstimatedArrivalWorkEffIdRemoved = c.IsPropertyEstimatedArrivalWorkEffIdRemoved; e.IsPropertyLatestCancelDateRemoved = c.IsPropertyLatestCancelDateRemoved; e.IsPropertyEstimatedShipCostRemoved = c.IsPropertyEstimatedShipCostRemoved; e.IsPropertyCurrencyUomIdRemoved = c.IsPropertyCurrencyUomIdRemoved; e.IsPropertyHandlingInstructionsRemoved = c.IsPropertyHandlingInstructionsRemoved; e.IsPropertyOriginFacilityIdRemoved = c.IsPropertyOriginFacilityIdRemoved; e.IsPropertyDestinationFacilityIdRemoved = c.IsPropertyDestinationFacilityIdRemoved; e.IsPropertyOriginContactMechIdRemoved = c.IsPropertyOriginContactMechIdRemoved; e.IsPropertyOriginTelecomNumberIdRemoved = c.IsPropertyOriginTelecomNumberIdRemoved; e.IsPropertyDestinationContactMechIdRemoved = c.IsPropertyDestinationContactMechIdRemoved; e.IsPropertyDestinationTelecomNumberIdRemoved = c.IsPropertyDestinationTelecomNumberIdRemoved; e.IsPropertyPartyIdToRemoved = c.IsPropertyPartyIdToRemoved; e.IsPropertyPartyIdFromRemoved = c.IsPropertyPartyIdFromRemoved; e.IsPropertyAdditionalShippingChargeRemoved = c.IsPropertyAdditionalShippingChargeRemoved; e.IsPropertyAddtlShippingChargeDescRemoved = c.IsPropertyAddtlShippingChargeDescRemoved; 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 (IShipmentItemCommand innerCommand in c.ShipmentItemCommands) { ThrowOnInconsistentCommands(c, innerCommand); IShipmentItemEvent innerEvent = Map(innerCommand, c, version, _state); e.AddShipmentItemEvent(innerEvent); } foreach (IShipmentReceiptCommand innerCommand in c.ShipmentReceiptCommands) { ThrowOnInconsistentCommands(c, innerCommand); IShipmentReceiptEvent innerEvent = Map(innerCommand, c, version, _state); e.AddShipmentReceiptEvent(innerEvent); } foreach (IItemIssuanceCommand innerCommand in c.ItemIssuanceCommands) { ThrowOnInconsistentCommands(c, innerCommand); IItemIssuanceEvent innerEvent = Map(innerCommand, c, version, _state); e.AddItemIssuanceEvent(innerEvent); } return(e); }