public virtual void Initialize(IOrderShipGroupMvoStateCreated stateCreated) { var aggregateId = stateCreated.OrderShipGroupMvoEventId.OrderShipGroupId; var state = new OrderShipGroupMvoState(); state.OrderShipGroupId = aggregateId; var aggregate = (OrderShipGroupMvoAggregate)GetOrderShipGroupMvoAggregate(state); var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId); aggregate.Apply(stateCreated); Persist(eventStoreAggregateId, aggregate, state); }
public virtual void When(IOrderShipGroupMvoStateCreated e) { ThrowOnWrongEvent(e); this.ShipmentMethodTypeId = e.ShipmentMethodTypeId; this.SupplierPartyId = e.SupplierPartyId; this.VendorPartyId = e.VendorPartyId; this.CarrierPartyId = e.CarrierPartyId; this.CarrierRoleTypeId = e.CarrierRoleTypeId; this.FacilityId = e.FacilityId; this.ContactMechId = e.ContactMechId; this.TelecomContactMechId = e.TelecomContactMechId; this.TrackingNumber = e.TrackingNumber; this.ShippingInstructions = e.ShippingInstructions; this.MaySplit = e.MaySplit; this.GiftMessage = e.GiftMessage; this.IsGift = e.IsGift; this.ShipAfterDate = e.ShipAfterDate; this.ShipByDate = e.ShipByDate; this.EstimatedShipDate = e.EstimatedShipDate; this.EstimatedDeliveryDate = e.EstimatedDeliveryDate; this.PickwaveId = e.PickwaveId; this.Version = (e.Version != null && e.Version.HasValue) ? e.Version.Value : default(long); this.Active = (e.Active != null && e.Active.HasValue) ? e.Active.Value : default(bool); this.OrderOrderTypeId = e.OrderOrderTypeId; this.OrderOrderName = e.OrderOrderName; this.OrderExternalId = e.OrderExternalId; this.OrderSalesChannelEnumId = e.OrderSalesChannelEnumId; this.OrderOrderDate = e.OrderOrderDate; this.OrderPriority = e.OrderPriority; this.OrderEntryDate = e.OrderEntryDate; this.OrderPickSheetPrintedDate = e.OrderPickSheetPrintedDate; this.OrderStatusId = e.OrderStatusId; this.OrderCurrencyUom = e.OrderCurrencyUom; this.OrderSyncStatusId = e.OrderSyncStatusId; this.OrderBillingAccountId = e.OrderBillingAccountId; this.OrderOriginFacilityId = e.OrderOriginFacilityId; this.OrderWebSiteId = e.OrderWebSiteId; this.OrderProductStoreId = e.OrderProductStoreId; this.OrderTerminalId = e.OrderTerminalId; this.OrderTransactionId = e.OrderTransactionId; this.OrderAutoOrderShoppingListId = e.OrderAutoOrderShoppingListId; this.OrderNeedsInventoryIssuance = e.OrderNeedsInventoryIssuance; this.OrderIsRushOrder = e.OrderIsRushOrder; this.OrderInternalCode = e.OrderInternalCode; this.OrderRemainingSubTotal = e.OrderRemainingSubTotal; this.OrderGrandTotal = e.OrderGrandTotal; this.OrderInvoicePerShipment = e.OrderInvoicePerShipment; this.OrderCreatedBy = e.OrderCreatedBy; this.OrderCreatedAt = (e.OrderCreatedAt != null && e.OrderCreatedAt.HasValue) ? e.OrderCreatedAt.Value : default(DateTime); this.OrderUpdatedBy = e.OrderUpdatedBy; this.OrderUpdatedAt = (e.OrderUpdatedAt != null && e.OrderUpdatedAt.HasValue) ? e.OrderUpdatedAt.Value : default(DateTime); this.OrderActive = (e.OrderActive != null && e.OrderActive.HasValue) ? e.OrderActive.Value : default(bool); this.Deleted = false; this.CreatedBy = e.CreatedBy; this.CreatedAt = e.CreatedAt; }
public virtual void Create(ICreateOrderShipGroupMvo c) { IOrderShipGroupMvoStateCreated e = Map(c); Apply(e); }
protected virtual IOrderShipGroupMvoStateCreated Map(ICreateOrderShipGroupMvo c) { var stateEventId = new OrderShipGroupMvoEventId(c.OrderShipGroupId, c.OrderVersion); IOrderShipGroupMvoStateCreated e = NewOrderShipGroupMvoStateCreated(stateEventId); e.ShipmentMethodTypeId = c.ShipmentMethodTypeId; e.SupplierPartyId = c.SupplierPartyId; e.VendorPartyId = c.VendorPartyId; e.CarrierPartyId = c.CarrierPartyId; e.CarrierRoleTypeId = c.CarrierRoleTypeId; e.FacilityId = c.FacilityId; e.ContactMechId = c.ContactMechId; e.TelecomContactMechId = c.TelecomContactMechId; e.TrackingNumber = c.TrackingNumber; e.ShippingInstructions = c.ShippingInstructions; e.MaySplit = c.MaySplit; e.GiftMessage = c.GiftMessage; e.IsGift = c.IsGift; e.ShipAfterDate = c.ShipAfterDate; e.ShipByDate = c.ShipByDate; e.EstimatedShipDate = c.EstimatedShipDate; e.EstimatedDeliveryDate = c.EstimatedDeliveryDate; e.PickwaveId = c.PickwaveId; e.Version = c.Version; e.Active = c.Active; e.OrderOrderTypeId = c.OrderOrderTypeId; e.OrderOrderName = c.OrderOrderName; e.OrderExternalId = c.OrderExternalId; e.OrderSalesChannelEnumId = c.OrderSalesChannelEnumId; e.OrderOrderDate = c.OrderOrderDate; e.OrderPriority = c.OrderPriority; e.OrderEntryDate = c.OrderEntryDate; e.OrderPickSheetPrintedDate = c.OrderPickSheetPrintedDate; e.OrderStatusId = c.OrderStatusId; e.OrderCurrencyUom = c.OrderCurrencyUom; e.OrderSyncStatusId = c.OrderSyncStatusId; e.OrderBillingAccountId = c.OrderBillingAccountId; e.OrderOriginFacilityId = c.OrderOriginFacilityId; e.OrderWebSiteId = c.OrderWebSiteId; e.OrderProductStoreId = c.OrderProductStoreId; e.OrderTerminalId = c.OrderTerminalId; e.OrderTransactionId = c.OrderTransactionId; e.OrderAutoOrderShoppingListId = c.OrderAutoOrderShoppingListId; e.OrderNeedsInventoryIssuance = c.OrderNeedsInventoryIssuance; e.OrderIsRushOrder = c.OrderIsRushOrder; e.OrderInternalCode = c.OrderInternalCode; e.OrderRemainingSubTotal = c.OrderRemainingSubTotal; e.OrderGrandTotal = c.OrderGrandTotal; e.OrderInvoicePerShipment = c.OrderInvoicePerShipment; e.OrderCreatedBy = c.OrderCreatedBy; e.OrderCreatedAt = c.OrderCreatedAt; e.OrderUpdatedBy = c.OrderUpdatedBy; e.OrderUpdatedAt = c.OrderUpdatedAt; e.OrderActive = c.OrderActive; e.CommandId = c.CommandId; e.CreatedBy = (string)c.RequesterId; e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>(); var orderVersion = c.OrderVersion; return(e); }
public virtual OrderShipGroupMvoStateCreatedDto ToOrderShipGroupMvoStateCreatedDto(IOrderShipGroupMvoStateCreated e) { var dto = new OrderShipGroupMvoStateCreatedDto(); dto.OrderShipGroupMvoEventId = e.OrderShipGroupMvoEventId; dto.CreatedAt = e.CreatedAt; dto.CreatedBy = e.CreatedBy; dto.CommandId = e.CommandId; dto.ShipmentMethodTypeId = e.ShipmentMethodTypeId; dto.SupplierPartyId = e.SupplierPartyId; dto.VendorPartyId = e.VendorPartyId; dto.CarrierPartyId = e.CarrierPartyId; dto.CarrierRoleTypeId = e.CarrierRoleTypeId; dto.FacilityId = e.FacilityId; dto.ContactMechId = e.ContactMechId; dto.TelecomContactMechId = e.TelecomContactMechId; dto.TrackingNumber = e.TrackingNumber; dto.ShippingInstructions = e.ShippingInstructions; dto.MaySplit = e.MaySplit; dto.GiftMessage = e.GiftMessage; dto.IsGift = e.IsGift; dto.ShipAfterDate = e.ShipAfterDate; dto.ShipByDate = e.ShipByDate; dto.EstimatedShipDate = e.EstimatedShipDate; dto.EstimatedDeliveryDate = e.EstimatedDeliveryDate; dto.PickwaveId = e.PickwaveId; dto.Version = e.Version; dto.Active = e.Active; dto.OrderOrderTypeId = e.OrderOrderTypeId; dto.OrderOrderName = e.OrderOrderName; dto.OrderExternalId = e.OrderExternalId; dto.OrderSalesChannelEnumId = e.OrderSalesChannelEnumId; dto.OrderOrderDate = e.OrderOrderDate; dto.OrderPriority = e.OrderPriority; dto.OrderEntryDate = e.OrderEntryDate; dto.OrderPickSheetPrintedDate = e.OrderPickSheetPrintedDate; dto.OrderStatusId = e.OrderStatusId; dto.OrderCurrencyUom = e.OrderCurrencyUom; dto.OrderSyncStatusId = e.OrderSyncStatusId; dto.OrderBillingAccountId = e.OrderBillingAccountId; dto.OrderOriginFacilityId = e.OrderOriginFacilityId; dto.OrderWebSiteId = e.OrderWebSiteId; dto.OrderProductStoreId = e.OrderProductStoreId; dto.OrderTerminalId = e.OrderTerminalId; dto.OrderTransactionId = e.OrderTransactionId; dto.OrderAutoOrderShoppingListId = e.OrderAutoOrderShoppingListId; dto.OrderNeedsInventoryIssuance = e.OrderNeedsInventoryIssuance; dto.OrderIsRushOrder = e.OrderIsRushOrder; dto.OrderInternalCode = e.OrderInternalCode; dto.OrderRemainingSubTotal = e.OrderRemainingSubTotal; dto.OrderGrandTotal = e.OrderGrandTotal; dto.OrderInvoicePerShipment = e.OrderInvoicePerShipment; dto.OrderCreatedBy = e.OrderCreatedBy; dto.OrderCreatedAt = e.OrderCreatedAt; dto.OrderUpdatedBy = e.OrderUpdatedBy; dto.OrderUpdatedAt = e.OrderUpdatedAt; dto.OrderActive = e.OrderActive; return(dto); }
void IOrderShipGroupMvoState.When(IOrderShipGroupMvoStateCreated e) { throw new NotSupportedException(); }