public virtual void Initialize(IOrderItemShipGroupAssociationMvoStateCreated stateCreated)
        {
            var aggregateId = stateCreated.OrderItemShipGroupAssociationMvoEventId.OrderItemShipGroupAssociationId;
            var state       = new OrderItemShipGroupAssociationMvoState();

            state.OrderItemShipGroupAssociationId = aggregateId;
            var aggregate = (OrderItemShipGroupAssociationMvoAggregate)GetOrderItemShipGroupAssociationMvoAggregate(state);

            var eventStoreAggregateId = ToEventStoreAggregateId(aggregateId);

            aggregate.Apply(stateCreated);
            Persist(eventStoreAggregateId, aggregate, state);
        }
Ejemplo n.º 2
0
        public virtual void Create(ICreateOrderItemShipGroupAssociationMvo c)
        {
            IOrderItemShipGroupAssociationMvoStateCreated e = Map(c);

            Apply(e);
        }
        public virtual OrderItemShipGroupAssociationMvoStateCreatedDto ToOrderItemShipGroupAssociationMvoStateCreatedDto(IOrderItemShipGroupAssociationMvoStateCreated e)
        {
            var dto = new OrderItemShipGroupAssociationMvoStateCreatedDto();

            dto.OrderItemShipGroupAssociationMvoEventId = e.OrderItemShipGroupAssociationMvoEventId;
            dto.CreatedAt      = e.CreatedAt;
            dto.CreatedBy      = e.CreatedBy;
            dto.CommandId      = e.CommandId;
            dto.Quantity       = e.Quantity;
            dto.CancelQuantity = e.CancelQuantity;
            dto.Version        = e.Version;
            dto.Active         = e.Active;
            dto.OrderShipGroupShipmentMethodTypeId = e.OrderShipGroupShipmentMethodTypeId;
            dto.OrderShipGroupSupplierPartyId      = e.OrderShipGroupSupplierPartyId;
            dto.OrderShipGroupVendorPartyId        = e.OrderShipGroupVendorPartyId;
            dto.OrderShipGroupCarrierPartyId       = e.OrderShipGroupCarrierPartyId;
            dto.OrderShipGroupCarrierRoleTypeId    = e.OrderShipGroupCarrierRoleTypeId;
            dto.OrderShipGroupFacilityId           = e.OrderShipGroupFacilityId;
            dto.OrderShipGroupContactMechId        = e.OrderShipGroupContactMechId;
            dto.OrderShipGroupTelecomContactMechId = e.OrderShipGroupTelecomContactMechId;
            dto.OrderShipGroupTrackingNumber       = e.OrderShipGroupTrackingNumber;
            dto.OrderShipGroupShippingInstructions = e.OrderShipGroupShippingInstructions;
            dto.OrderShipGroupMaySplit             = e.OrderShipGroupMaySplit;
            dto.OrderShipGroupGiftMessage          = e.OrderShipGroupGiftMessage;
            dto.OrderShipGroupIsGift                = e.OrderShipGroupIsGift;
            dto.OrderShipGroupShipAfterDate         = e.OrderShipGroupShipAfterDate;
            dto.OrderShipGroupShipByDate            = e.OrderShipGroupShipByDate;
            dto.OrderShipGroupEstimatedShipDate     = e.OrderShipGroupEstimatedShipDate;
            dto.OrderShipGroupEstimatedDeliveryDate = e.OrderShipGroupEstimatedDeliveryDate;
            dto.OrderShipGroupPickwaveId            = e.OrderShipGroupPickwaveId;
            dto.OrderShipGroupVersion               = e.OrderShipGroupVersion;
            dto.OrderShipGroupCreatedBy             = e.OrderShipGroupCreatedBy;
            dto.OrderShipGroupCreatedAt             = e.OrderShipGroupCreatedAt;
            dto.OrderShipGroupUpdatedBy             = e.OrderShipGroupUpdatedBy;
            dto.OrderShipGroupUpdatedAt             = e.OrderShipGroupUpdatedAt;
            dto.OrderShipGroupActive                = e.OrderShipGroupActive;
            dto.OrderShipGroupDeleted               = e.OrderShipGroupDeleted;
            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);
        }
Ejemplo n.º 4
0
        protected virtual IOrderItemShipGroupAssociationMvoStateCreated Map(ICreateOrderItemShipGroupAssociationMvo c)
        {
            var stateEventId = new OrderItemShipGroupAssociationMvoEventId(c.OrderItemShipGroupAssociationId, c.OrderVersion);
            IOrderItemShipGroupAssociationMvoStateCreated e = NewOrderItemShipGroupAssociationMvoStateCreated(stateEventId);

            e.Quantity       = c.Quantity;
            e.CancelQuantity = c.CancelQuantity;
            e.Version        = c.Version;
            e.Active         = c.Active;
            e.OrderShipGroupShipmentMethodTypeId = c.OrderShipGroupShipmentMethodTypeId;
            e.OrderShipGroupSupplierPartyId      = c.OrderShipGroupSupplierPartyId;
            e.OrderShipGroupVendorPartyId        = c.OrderShipGroupVendorPartyId;
            e.OrderShipGroupCarrierPartyId       = c.OrderShipGroupCarrierPartyId;
            e.OrderShipGroupCarrierRoleTypeId    = c.OrderShipGroupCarrierRoleTypeId;
            e.OrderShipGroupFacilityId           = c.OrderShipGroupFacilityId;
            e.OrderShipGroupContactMechId        = c.OrderShipGroupContactMechId;
            e.OrderShipGroupTelecomContactMechId = c.OrderShipGroupTelecomContactMechId;
            e.OrderShipGroupTrackingNumber       = c.OrderShipGroupTrackingNumber;
            e.OrderShipGroupShippingInstructions = c.OrderShipGroupShippingInstructions;
            e.OrderShipGroupMaySplit             = c.OrderShipGroupMaySplit;
            e.OrderShipGroupGiftMessage          = c.OrderShipGroupGiftMessage;
            e.OrderShipGroupIsGift                = c.OrderShipGroupIsGift;
            e.OrderShipGroupShipAfterDate         = c.OrderShipGroupShipAfterDate;
            e.OrderShipGroupShipByDate            = c.OrderShipGroupShipByDate;
            e.OrderShipGroupEstimatedShipDate     = c.OrderShipGroupEstimatedShipDate;
            e.OrderShipGroupEstimatedDeliveryDate = c.OrderShipGroupEstimatedDeliveryDate;
            e.OrderShipGroupPickwaveId            = c.OrderShipGroupPickwaveId;
            e.OrderShipGroupVersion               = c.OrderShipGroupVersion;
            e.OrderShipGroupCreatedBy             = c.OrderShipGroupCreatedBy;
            e.OrderShipGroupCreatedAt             = c.OrderShipGroupCreatedAt;
            e.OrderShipGroupUpdatedBy             = c.OrderShipGroupUpdatedBy;
            e.OrderShipGroupUpdatedAt             = c.OrderShipGroupUpdatedAt;
            e.OrderShipGroupActive                = c.OrderShipGroupActive;
            e.OrderShipGroupDeleted               = c.OrderShipGroupDeleted;
            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 void When(IOrderItemShipGroupAssociationMvoStateCreated e)
        {
            ThrowOnWrongEvent(e);
            this.Quantity = e.Quantity;

            this.CancelQuantity = e.CancelQuantity;

            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.OrderShipGroupShipmentMethodTypeId = e.OrderShipGroupShipmentMethodTypeId;

            this.OrderShipGroupSupplierPartyId = e.OrderShipGroupSupplierPartyId;

            this.OrderShipGroupVendorPartyId = e.OrderShipGroupVendorPartyId;

            this.OrderShipGroupCarrierPartyId = e.OrderShipGroupCarrierPartyId;

            this.OrderShipGroupCarrierRoleTypeId = e.OrderShipGroupCarrierRoleTypeId;

            this.OrderShipGroupFacilityId = e.OrderShipGroupFacilityId;

            this.OrderShipGroupContactMechId = e.OrderShipGroupContactMechId;

            this.OrderShipGroupTelecomContactMechId = e.OrderShipGroupTelecomContactMechId;

            this.OrderShipGroupTrackingNumber = e.OrderShipGroupTrackingNumber;

            this.OrderShipGroupShippingInstructions = e.OrderShipGroupShippingInstructions;

            this.OrderShipGroupMaySplit = e.OrderShipGroupMaySplit;

            this.OrderShipGroupGiftMessage = e.OrderShipGroupGiftMessage;

            this.OrderShipGroupIsGift = e.OrderShipGroupIsGift;

            this.OrderShipGroupShipAfterDate = e.OrderShipGroupShipAfterDate;

            this.OrderShipGroupShipByDate = e.OrderShipGroupShipByDate;

            this.OrderShipGroupEstimatedShipDate = e.OrderShipGroupEstimatedShipDate;

            this.OrderShipGroupEstimatedDeliveryDate = e.OrderShipGroupEstimatedDeliveryDate;

            this.OrderShipGroupPickwaveId = e.OrderShipGroupPickwaveId;

            this.OrderShipGroupVersion = (e.OrderShipGroupVersion != null && e.OrderShipGroupVersion.HasValue) ? e.OrderShipGroupVersion.Value : default(long);

            this.OrderShipGroupCreatedBy = e.OrderShipGroupCreatedBy;

            this.OrderShipGroupCreatedAt = (e.OrderShipGroupCreatedAt != null && e.OrderShipGroupCreatedAt.HasValue) ? e.OrderShipGroupCreatedAt.Value : default(DateTime);

            this.OrderShipGroupUpdatedBy = e.OrderShipGroupUpdatedBy;

            this.OrderShipGroupUpdatedAt = (e.OrderShipGroupUpdatedAt != null && e.OrderShipGroupUpdatedAt.HasValue) ? e.OrderShipGroupUpdatedAt.Value : default(DateTime);

            this.OrderShipGroupActive = (e.OrderShipGroupActive != null && e.OrderShipGroupActive.HasValue) ? e.OrderShipGroupActive.Value : default(bool);

            this.OrderShipGroupDeleted = (e.OrderShipGroupDeleted != null && e.OrderShipGroupDeleted.HasValue) ? e.OrderShipGroupDeleted.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;
        }