Example #1
0
        }// END Map(ICreate... ////////////////////////////

        protected virtual IOrderShipGroupStateMergePatched MapMergePatch(IMergePatchOrderShipGroup c, IOrderCommand outerCommand, long version, IOrderState outerState)
        {
            c.RequesterId = outerCommand.RequesterId;
            var stateEventId = new OrderShipGroupEventId(c.OrderId, c.ShipGroupSeqId, version);
            IOrderShipGroupStateMergePatched e = NewOrderShipGroupStateMergePatched(stateEventId);
            var s = outerState.OrderShipGroups.Get(c.ShipGroupSeqId);

            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.Active                = c.Active;
            e.IsPropertyShipmentMethodTypeIdRemoved = c.IsPropertyShipmentMethodTypeIdRemoved;
            e.IsPropertySupplierPartyIdRemoved      = c.IsPropertySupplierPartyIdRemoved;
            e.IsPropertyVendorPartyIdRemoved        = c.IsPropertyVendorPartyIdRemoved;
            e.IsPropertyCarrierPartyIdRemoved       = c.IsPropertyCarrierPartyIdRemoved;
            e.IsPropertyCarrierRoleTypeIdRemoved    = c.IsPropertyCarrierRoleTypeIdRemoved;
            e.IsPropertyFacilityIdRemoved           = c.IsPropertyFacilityIdRemoved;
            e.IsPropertyContactMechIdRemoved        = c.IsPropertyContactMechIdRemoved;
            e.IsPropertyTelecomContactMechIdRemoved = c.IsPropertyTelecomContactMechIdRemoved;
            e.IsPropertyTrackingNumberRemoved       = c.IsPropertyTrackingNumberRemoved;
            e.IsPropertyShippingInstructionsRemoved = c.IsPropertyShippingInstructionsRemoved;
            e.IsPropertyMaySplitRemoved             = c.IsPropertyMaySplitRemoved;
            e.IsPropertyGiftMessageRemoved          = c.IsPropertyGiftMessageRemoved;
            e.IsPropertyIsGiftRemoved                = c.IsPropertyIsGiftRemoved;
            e.IsPropertyShipAfterDateRemoved         = c.IsPropertyShipAfterDateRemoved;
            e.IsPropertyShipByDateRemoved            = c.IsPropertyShipByDateRemoved;
            e.IsPropertyEstimatedShipDateRemoved     = c.IsPropertyEstimatedShipDateRemoved;
            e.IsPropertyEstimatedDeliveryDateRemoved = c.IsPropertyEstimatedDeliveryDateRemoved;
            e.IsPropertyPickwaveIdRemoved            = c.IsPropertyPickwaveIdRemoved;
            e.IsPropertyActiveRemoved                = c.IsPropertyActiveRemoved;

            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();

            foreach (IOrderItemShipGroupAssociationCommand innerCommand in c.OrderItemShipGroupAssociationCommands)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IOrderItemShipGroupAssociationEvent innerEvent = Map(innerCommand, c, version, s);
                e.AddOrderItemShipGroupAssociationEvent(innerEvent);
            }

            return(e);
        }// END Map(IMergePatch... ////////////////////////////
Example #2
0
        private OrderShipGroupEventId NewOrderShipGroupEventId(long?shipGroupSeqId)
        {
            var eId = new OrderShipGroupEventId();

            eId.OrderId        = this.OrderEventId.OrderId;
            eId.ShipGroupSeqId = shipGroupSeqId;
            eId.OrderVersion   = this.OrderEventId.Version;
            return(eId);
        }
Example #3
0
        }// END Map(IMergePatch... ////////////////////////////

        protected virtual IOrderShipGroupStateRemoved MapRemove(IRemoveOrderShipGroup c, IOrderCommand outerCommand, long version)
        {
            c.RequesterId = outerCommand.RequesterId;
            var stateEventId = new OrderShipGroupEventId(c.OrderId, c.ShipGroupSeqId, version);
            IOrderShipGroupStateRemoved e = NewOrderShipGroupStateRemoved(stateEventId);


            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();

            return(e);
        }// END Map(IRemove... ////////////////////////////
Example #4
0
        protected virtual IOrderShipGroupStateCreated MapCreate(ICreateOrderShipGroup c, IOrderCommand outerCommand, long version, IOrderState outerState)
        {
            c.RequesterId = outerCommand.RequesterId;
            var stateEventId = new OrderShipGroupEventId(c.OrderId, c.ShipGroupSeqId, version);
            IOrderShipGroupStateCreated e = NewOrderShipGroupStateCreated(stateEventId);
            var s = outerState.OrderShipGroups.Get(c.ShipGroupSeqId, true);

            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.DestinationFacilityId = c.DestinationFacilityId;
            e.ContactMechId         = c.ContactMechId;
            e.TelecomContactMechId  = c.TelecomContactMechId;
            e.TrackingNumber        = c.TrackingNumber;
            e.ContactPartyId        = c.ContactPartyId;
            e.VehiclePlateNumber    = c.VehiclePlateNumber;
            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.NumberOfPackages            = c.NumberOfPackages;
            e.NumberOfContainers          = c.NumberOfContainers;
            e.NumberOfPakagesPerContainer = c.NumberOfPakagesPerContainer;
            NewOrderShipGroupOrderShipGroupActionCommandAndExecute(c, s, e);
            e.Active = c.Active;

            e.CreatedBy = (string)c.RequesterId;
            e.CreatedAt = ApplicationContext.Current.TimestampService.Now <DateTime>();

            foreach (ICreateOrderItemShipGroupAssociation innerCommand in c.OrderItemShipGroupAssociations)
            {
                ThrowOnInconsistentCommands(c, innerCommand);

                IOrderItemShipGroupAssociationStateCreated innerEvent = MapCreate(innerCommand, c, version, s);
                e.AddOrderItemShipGroupAssociationEvent(innerEvent);
            }

            return(e);
        }// END Map(ICreate... ////////////////////////////
Example #5
0
        public override bool Equals(object obj)
        {
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }

            OrderShipGroupEventId other = obj as OrderShipGroupEventId;

            if (other == null)
            {
                return(false);
            }

            return(true &&
                   Object.Equals(this.OrderId, other.OrderId) &&
                   Object.Equals(this.ShipGroupSeqId, other.ShipGroupSeqId) &&
                   Object.Equals(this.OrderVersion, other.OrderVersion)
                   );
        }
Example #6
0
 protected OrderShipGroupEventBase(OrderShipGroupEventId stateEventId)
 {
     this.OrderShipGroupEventId = stateEventId;
 }
Example #7
0
 public OrderShipGroupStateRemoved(OrderShipGroupEventId stateEventId) : base(stateEventId)
 {
 }
Example #8
0
 public OrderShipGroupStateMergePatched(OrderShipGroupEventId stateEventId) : base(stateEventId)
 {
 }
Example #9
0
 public OrderShipGroupStateCreated(OrderShipGroupEventId stateEventId) : base(stateEventId)
 {
 }
Example #10
0
 protected OrderShipGroupStateEventBase(OrderShipGroupEventId stateEventId) : base(stateEventId)
 {
 }
Example #11
0
 private OrderShipGroupStateRemoved NewOrderShipGroupStateRemoved(OrderShipGroupEventId stateEventId)
 {
     return(new OrderShipGroupStateRemoved(stateEventId));
 }
Example #12
0
 private OrderShipGroupStateMergePatched NewOrderShipGroupStateMergePatched(OrderShipGroupEventId stateEventId)
 {
     return(new OrderShipGroupStateMergePatched(stateEventId));
 }
Example #13
0
        protected OrderShipGroupEventId NewOrderShipGroupEventId(string shipGroupSeqId)
        {
            var stateEventId = new OrderShipGroupEventId(this.OrderEventId.OrderId, shipGroupSeqId, this.OrderEventId.Version);

            return(stateEventId);
        }