public void InventoryItem_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _inventoryitem_item_inventoryitems = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "33eeefb1-ac7b-43ab-a3bf-c69fa7d98121Item_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 2692,
                SupplierPackSize = 2570,
                InnerPackSize    = 5055,
                PalletType       = "Item_PalletType",
                PalTI            = 6008,
                PalHI            = 1352,
                UOM              = "Item_UOM",
            };
            var _inventoryitem_warehouse_inventoryitems = new DSS1_RetailerDriverStockOptimisation.BO.Warehouse
            {
                Code        = "Warehouse_Code",
                Description = "Warehouse_Description",
                FlowType    = "Warehouse_FlowType",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.InventoryItem>(Session)
            .CheckProperty(p => p.CoverageDays, 4875)
            .CheckProperty(p => p.SafetyStock, 7640)
            .CheckProperty(p => p.Status, "InventoryItem_Status")
            .CheckReference(p => p.Item, _inventoryitem_item_inventoryitems)
            .CheckReference(p => p.Warehouse, _inventoryitem_warehouse_inventoryitems)
            .VerifyTheMappings();
        }
        public void SLAStatistics_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _sla_item_slastatistics = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "6b3d7c77-f0ad-4078-b835-9bb64cf69ac9Item_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 3157,
                SupplierPackSize = 6837,
                InnerPackSize    = 1593,
                PalletType       = "Item_PalletType",
                PalTI            = 618,
                PalHI            = 2257,
                UOM              = "Item_UOM",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.SLAStatistics>(Session)
            .CheckProperty(p => p.Percentage, 222222.22M)
            .CheckProperty(p => p.Threshold, 222222.22M)
            .CheckProperty(p => p.Month, "SLAStatistics_Month")
            .CheckReference(p => p.Item, _sla_item_slastatistics)
            .VerifyTheMappings();
        }
        public void WasteOld_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _itemwaste_item_wasteold = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "5377d7f9-ce05-494c-a9be-2471ce561381Item_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 393,
                SupplierPackSize = 3073,
                InnerPackSize    = 7494,
                PalletType       = "Item_PalletType",
                PalTI            = 4586,
                PalHI            = 5268,
                UOM              = "Item_UOM",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.WasteOld>(Session)
            .CheckProperty(p => p.WastedStock, 222222.22M)
            .CheckProperty(p => p.StockPerSKU, "WasteOld_StockPerSKU")
            .CheckProperty(p => p.SKU, "WasteOld_SKU")
            .CheckProperty(p => p.WastePercentage, 222222.22M)
            .CheckProperty(p => p.ItemDescription, "WasteOld_ItemDescription")
            .CheckProperty(p => p.DateFormatted, "WasteOld_DateFormatted")
            .CheckReference(p => p.Item, _itemwaste_item_wasteold)
            .VerifyTheMappings();
        }
        public void ItemParameter_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _orderproposal_item_itemcriterion = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "38fd002c-87a3-45be-8fe4-9a8f480d7295Item_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 2226,
                SupplierPackSize = 4979,
                InnerPackSize    = 6924,
                PalletType       = "Item_PalletType",
                PalTI            = 5123,
                PalHI            = 5807,
                UOM              = "Item_UOM",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.ItemParameter>(Session)
            .CheckProperty(p => p.CoverageDays, 5525)
            .CheckProperty(p => p.SupplierCanDeliver, true)
            .CheckProperty(p => p.SupplierQuantity, 2429)
            .CheckProperty(p => p.SupplierComments, "ItemParameter_SupplierComments")
            .CheckReference(p => p.Item, _orderproposal_item_itemcriterion)
            .VerifyTheMappings();
        }
        public void MinimumQuantity_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _minimumquantity_item_minimumquantity = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "135a803a-e650-4865-b6af-627277d14ed8Item_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 428,
                SupplierPackSize = 9864,
                InnerPackSize    = 1088,
                PalletType       = "Item_PalletType",
                PalTI            = 4293,
                PalHI            = 958,
                UOM              = "Item_UOM",
            };
            var _minimumquantity_supplier_minimumquantity = new DSS1_RetailerDriverStockOptimisation.BO.Supplier
            {
                Code = "Supplier_Code",
                Name = "Supplier_Name",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.MinimumQuantity>(Session)
            .CheckProperty(p => p.Country, "MinimumQuantity_Country")
            .CheckProperty(p => p.Quantity, 695)
            .CheckReference(p => p.Item, _minimumquantity_item_minimumquantity)
            .CheckReference(p => p.Supplier, _minimumquantity_supplier_minimumquantity)
            .VerifyTheMappings();
        }
Exemplo n.º 6
0
        public void Sales_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _sale_item_itemsforecast = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "8737af96-31fe-464d-8ef6-cb1e588c4593Item_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 6151,
                SupplierPackSize = 6114,
                InnerPackSize    = 376,
                PalletType       = "Item_PalletType",
                PalTI            = 5455,
                PalHI            = 1822,
                UOM              = "Item_UOM",
            };
            var _sale_warehouse_sales = new DSS1_RetailerDriverStockOptimisation.BO.Warehouse
            {
                Code        = "Warehouse_Code",
                Description = "Warehouse_Description",
                FlowType    = "Warehouse_FlowType",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.Sales>(Session)
            .CheckProperty(p => p.ForecastDate, now)
            .CheckProperty(p => p.Units, 88)
            .CheckReference(p => p.Item, _sale_item_itemsforecast)
            .CheckReference(p => p.Warehouse, _sale_warehouse_sales)
            .VerifyTheMappings();
        }
Exemplo n.º 7
0
        public void SupplierCapacity_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _item_item_suppliercapacities = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "6c860b10-22f5-4832-9d5c-61dd38ee90c8Item_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 9701,
                SupplierPackSize = 9067,
                InnerPackSize    = 8518,
                PalletType       = "Item_PalletType",
                PalTI            = 3887,
                PalHI            = 354,
                UOM              = "Item_UOM",
            };
            var _item_supplier_suppliercapacities = new DSS1_RetailerDriverStockOptimisation.BO.Supplier
            {
                Code = "Supplier_Code",
                Name = "Supplier_Name",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.SupplierCapacity>(Session)
            .CheckProperty(p => p.DateOfStockUpdate, now)
            .CheckProperty(p => p.DailyProduction, 2503)
            .CheckProperty(p => p.Stock, 1388)
            .CheckReference(p => p.Item, _item_item_suppliercapacities)
            .CheckReference(p => p.Supplier, _item_supplier_suppliercapacities)
            .VerifyTheMappings();
        }
        public void Notification_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _notification_item_notifications = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "8a430ffc-1da7-4374-ad34-4d3f1a331aeaItem_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 7256,
                SupplierPackSize = 5965,
                InnerPackSize    = 7979,
                PalletType       = "Item_PalletType",
                PalTI            = 3577,
                PalHI            = 998,
                UOM              = "Item_UOM",
            };
            var _notification_warehouse_notification = new DSS1_RetailerDriverStockOptimisation.BO.Warehouse
            {
                Code        = "Warehouse_Code",
                Description = "Warehouse_Description",
                FlowType    = "Warehouse_FlowType",
            };
            var _orderproposal_orderforecastdetails_notification = new DSS1_RetailerDriverStockOptimisation.BO.OrderForecastDetails
            {
                ReplenishmentCycle        = 5236,
                AutomatedForecast         = 349,
                Quantity                  = 2222222222.22222M,
                RoundQuantity             = 6891,
                OrderInventoryDays        = 2222222222.22222M,
                RecommendedOrderDate      = now,
                SalesForecastDate         = now,
                SupplierCanDeliver        = true,
                SupplierMaxQuantity       = 2222222222.22222M,
                SupplierCoverageDays      = 3753,
                ItemCoverageDays          = 9727,
                InitialStockLevel         = 6612,
                SupplierAvailableQuantity = 484,
                SupplierSharesStock       = true,
                CreatedOn                 = now,
                Status = "OrderForecastDetails_Status",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.Notification>(Session)
            .CheckProperty(p => p.Message, "Notification_Message")
            .CheckProperty(p => p.TotalSupplierStock, 9421)
            .CheckProperty(p => p.OrderForecastQuantity, 7030)
            .CheckProperty(p => p.Diff, 1721)
            .CheckProperty(p => p.SalesForecastDate, now)
            .CheckProperty(p => p.CreatedBy, "Notification_CreatedBy")
            .CheckReference(p => p.Item, _notification_item_notifications)
            .CheckReference(p => p.Warehouse, _notification_warehouse_notification)
            .CheckReference(p => p.OrderForecastDetails, _orderproposal_orderforecastdetails_notification)
            .VerifyTheMappings();
        }
Exemplo n.º 9
0
        public void Statistics_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _dashboard_warehouse_statistics = new DSS1_RetailerDriverStockOptimisation.BO.Warehouse
            {
                Code        = "Warehouse_Code",
                Description = "Warehouse_Description",
                FlowType    = "Warehouse_FlowType",
            };
            var _dashboard_item_statistics = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "cbcf0ee7-73f9-4a9d-91ba-53b7b1592c82Item_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 2247,
                SupplierPackSize = 5584,
                InnerPackSize    = 506,
                PalletType       = "Item_PalletType",
                PalTI            = 1012,
                PalHI            = 9698,
                UOM              = "Item_UOM",
            };
            var _dashboard_supplier_statistics = new DSS1_RetailerDriverStockOptimisation.BO.Supplier
            {
                Code = "Supplier_Code",
                Name = "Supplier_Name",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.Statistics>(Session)
            .CheckProperty(p => p.TotalUnits, 9280)
            .CheckProperty(p => p.Description, "Statistics_Description")
            .CheckProperty(p => p.Result, 9298)
            .CheckProperty(p => p.LeadTime, 6133)
            .CheckProperty(p => p.WeekDay, "Statistics_WeekDay")
            .CheckProperty(p => p.StockOnHandDate, now)
            .CheckProperty(p => p.StockOnHand, 2924)
            .CheckProperty(p => p.OrderQuantity, 5073)
            .CheckProperty(p => p.SalesQuantity, 2255)
            .CheckProperty(p => p.QuantitySalesForecast, 6658)
            .CheckProperty(p => p.StockOnHandDateFormatted, "Statistics_StockOnHandDateFormatted")
            .CheckProperty(p => p.SupplierStock, 9709)
            .CheckProperty(p => p.QuantitySum, 1034)
            .CheckProperty(p => p.SalesForecastDate, now)
            .CheckProperty(p => p.SalesForecastDateFormatted, "Statistics_SalesForecastDateFormatted")
            .CheckProperty(p => p.Threshold, 222222.22M)
            .CheckProperty(p => p.OrderDate, now)
            .CheckProperty(p => p.OrderDateFormatted, "Statistics_OrderDateFormatted")
            .CheckProperty(p => p.RealOrderQuantity, 580)
            .CheckReference(p => p.Warehouse, _dashboard_warehouse_statistics)
            .CheckReference(p => p.Item, _dashboard_item_statistics)
            .CheckReference(p => p.Supplier, _dashboard_supplier_statistics)
            .VerifyTheMappings();
        }
Exemplo n.º 10
0
        public void StockOnHand_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _agreement_agreement_stockonhands = new DSS1_RetailerDriverStockOptimisation.BO.Agreement
            {
                FullTruckLoad       = true,
                AgreementDocument   = "Agreement_AgreementDocument",
                LeadTime            = "Agreement_LeadTime",
                DateCreated         = now,
                WDDeliveries        = true,
                TargetInventoryDays = 8764,
                Profile             = "Agreement_Profile",
            };
            var _stockonhand_warehouse_stockonhand = new DSS1_RetailerDriverStockOptimisation.BO.Warehouse
            {
                Code        = "Warehouse_Code",
                Description = "Warehouse_Description",
                FlowType    = "Warehouse_FlowType",
            };
            var _stockonhand_item_stocksonhand = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "92a3478b-812b-4ac5-aa84-8457682959a9Item_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 2137,
                SupplierPackSize = 4261,
                InnerPackSize    = 1604,
                PalletType       = "Item_PalletType",
                PalTI            = 6908,
                PalHI            = 310,
                UOM              = "Item_UOM",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.StockOnHand>(Session)
            .CheckProperty(p => p.Units, 7896)
            .CheckProperty(p => p.CurrentInventoryDays, 222222.22M)
            .CheckProperty(p => p.StockOnHandDate, now)
            .CheckProperty(p => p.LeadTime, "StockOnHand_LeadTime")
            .CheckProperty(p => p.TargetInventoryDays, 222222.22M)
            .CheckProperty(p => p.FullTrackLoad, true)
            .CheckProperty(p => p.WDDays, true)
            .CheckReference(p => p.Agreement, _agreement_agreement_stockonhands)
            .CheckReference(p => p.Warehouse, _stockonhand_warehouse_stockonhand)
            .CheckReference(p => p.Item, _stockonhand_item_stocksonhand)
            .VerifyTheMappings();
        }
        public void SLALeadTime_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _sla_item_slaleadtimes = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "2b4359a7-87fa-4b7d-8e90-5033a6f6c94dItem_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 3627,
                SupplierPackSize = 5852,
                InnerPackSize    = 8255,
                PalletType       = "Item_PalletType",
                PalTI            = 162,
                PalHI            = 7438,
                UOM              = "Item_UOM",
            };
            var _sla_warehouse_slaleadtimes = new DSS1_RetailerDriverStockOptimisation.BO.Warehouse
            {
                Code        = "Warehouse_Code",
                Description = "Warehouse_Description",
                FlowType    = "Warehouse_FlowType",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.SLALeadTime>(Session)
            .CheckProperty(p => p.AgreedLeadTime, 522)
            .CheckProperty(p => p.RealLeadTime, 3380)
            .CheckProperty(p => p.Percentage, 222222.22M)
            .CheckProperty(p => p.ItemDescription, "SLALeadTime_ItemDescription")
            .CheckProperty(p => p.DateFormatted, "SLALeadTime_DateFormatted")
            .CheckProperty(p => p.Threshold, 222222.22M)
            .CheckProperty(p => p.SLALeadDate, now)
            .CheckProperty(p => p.Month, 5619)
            .CheckProperty(p => p.MonthlyDelayed, 222222.22M)
            .CheckProperty(p => p.MontlhyOrders, 222222.22M)
            .CheckProperty(p => p.MonthlyPercentage, 222222.22M)
            .CheckReference(p => p.Item, _sla_item_slaleadtimes)
            .CheckReference(p => p.Warehouse, _sla_warehouse_slaleadtimes)
            .VerifyTheMappings();
        }
        public void DeliverySchedule_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _forecast_supplier_deliveryschedules = new DSS1_RetailerDriverStockOptimisation.BO.Supplier
            {
                Code = "Supplier_Code",
                Name = "Supplier_Name",
            };
            var _forecast_item_deliveryschedules = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "eed02b3d-68f4-4b88-8ce3-b98afc728fd4Item_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 1930,
                SupplierPackSize = 7383,
                InnerPackSize    = 9520,
                PalletType       = "Item_PalletType",
                PalTI            = 7431,
                PalHI            = 6344,
                UOM              = "Item_UOM",
            };
            var _forecast_warehouse_deliveryschedules = new DSS1_RetailerDriverStockOptimisation.BO.Warehouse
            {
                Code        = "Warehouse_Code",
                Description = "Warehouse_Description",
                FlowType    = "Warehouse_FlowType",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.DeliverySchedule>(Session)
            .CheckProperty(p => p.LeadTime, 5120)
            .CheckProperty(p => p.Weekday, 9596)
            .CheckProperty(p => p.NameOfDay, "DeliverySchedule_NameOfDay")
            .CheckProperty(p => p.DBWeekday, 6539)
            .CheckReference(p => p.Supplier, _forecast_supplier_deliveryschedules)
            .CheckReference(p => p.Item, _forecast_item_deliveryschedules)
            .CheckReference(p => p.Warehouse, _forecast_warehouse_deliveryschedules)
            .VerifyTheMappings();
        }
        public void SLADelivery_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _sla_item_sladeliveries = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "8d5821db-dd6a-4780-933a-440d5e960329Item_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 6460,
                SupplierPackSize = 4445,
                InnerPackSize    = 4626,
                PalletType       = "Item_PalletType",
                PalTI            = 1779,
                PalHI            = 950,
                UOM              = "Item_UOM",
            };
            var _sla_warehouse_sladelivery = new DSS1_RetailerDriverStockOptimisation.BO.Warehouse
            {
                Code        = "Warehouse_Code",
                Description = "Warehouse_Description",
                FlowType    = "Warehouse_FlowType",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.SLADelivery>(Session)
            .CheckProperty(p => p.OrderedQuantities, 222222.22M)
            .CheckProperty(p => p.DeliveredQuantities, 222222.22M)
            .CheckProperty(p => p.Percentage, 222222.22M)
            .CheckProperty(p => p.ItemDescription, "SLADelivery_ItemDescription")
            .CheckProperty(p => p.Threshold, 222222.22M)
            .CheckProperty(p => p.SLADate, now)
            .CheckProperty(p => p.DateFormatted, "SLADelivery_DateFormatted")
            .CheckProperty(p => p.Month, 7434)
            .CheckReference(p => p.Item, _sla_item_sladeliveries)
            .CheckReference(p => p.Warehouse, _sla_warehouse_sladelivery)
            .VerifyTheMappings();
        }
Exemplo n.º 14
0
        public void PastOrder_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _pastorder_item_pastorders = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "b1ac3a9d-90df-4b3c-b365-057e200f9ed2Item_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 4261,
                SupplierPackSize = 8639,
                InnerPackSize    = 4286,
                PalletType       = "Item_PalletType",
                PalTI            = 3193,
                PalHI            = 2821,
                UOM              = "Item_UOM",
            };
            var _pastorder_warehouse_pastorders = new DSS1_RetailerDriverStockOptimisation.BO.Warehouse
            {
                Code        = "Warehouse_Code",
                Description = "Warehouse_Description",
                FlowType    = "Warehouse_FlowType",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.PastOrder>(Session)
            .CheckProperty(p => p.OrderNumber, 8141)
            .CheckProperty(p => p.WrittenDate, now)
            .CheckProperty(p => p.NotBeforeDate, now)
            .CheckProperty(p => p.QuantityOrdered, 536)
            .CheckProperty(p => p.ReceiveDate, now)
            .CheckProperty(p => p.QuantityReceived, 6161)
            .CheckProperty(p => p.Caller, "PastOrder_Caller")
            .CheckReference(p => p.Item, _pastorder_item_pastorders)
            .CheckReference(p => p.Warehouse, _pastorder_warehouse_pastorders)
            .VerifyTheMappings();
        }
        public void Platform_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _sla_item_platform = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "09fb359d-afca-4807-ab3f-42b4f4e6bdd1Item_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 1983,
                SupplierPackSize = 1897,
                InnerPackSize    = 8760,
                PalletType       = "Item_PalletType",
                PalTI            = 2174,
                PalHI            = 6771,
                UOM              = "Item_UOM",
            };
            var _sla_warehouse_platform = new DSS1_RetailerDriverStockOptimisation.BO.Warehouse
            {
                Code        = "Warehouse_Code",
                Description = "Warehouse_Description",
                FlowType    = "Warehouse_FlowType",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.Platform>(Session)
            .CheckProperty(p => p.percentage, 222222.22M)
            .CheckProperty(p => p.ItemDescription, "Platform_ItemDescription")
            .CheckProperty(p => p.RealOrderedQuantities, 222222.22M)
            .CheckProperty(p => p.ForecastOrders, 222222.22M)
            .CheckProperty(p => p.Month, "Platform_Month")
            .CheckReference(p => p.Item, _sla_item_platform)
            .CheckReference(p => p.Warehouse, _sla_warehouse_platform)
            .VerifyTheMappings();
        }
Exemplo n.º 16
0
        public void OrderForecastStatistic_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _orderforecastdashboard_item_orderforecaststatistics = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "5e0455f2-825e-4980-a681-4c7ad91b8b82Item_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 2356,
                SupplierPackSize = 6474,
                InnerPackSize    = 6358,
                PalletType       = "Item_PalletType",
                PalTI            = 1603,
                PalHI            = 9285,
                UOM              = "Item_UOM",
            };
            var _orderforecastdashboard_warehouse_orderforecaststatistics = new DSS1_RetailerDriverStockOptimisation.BO.Warehouse
            {
                Code        = "Warehouse_Code",
                Description = "Warehouse_Description",
                FlowType    = "Warehouse_FlowType",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.OrderForecastStatistic>(Session)
            .CheckProperty(p => p.Quantity, 222222.22M)
            .CheckProperty(p => p.RoundQuantity, 7821)
            .CheckProperty(p => p.OrderDate, now)
            .CheckProperty(p => p.OrderDateFormatted, "OrderForecastStatistic_OrderDateFormatted")
            .CheckReference(p => p.Item, _orderforecastdashboard_item_orderforecaststatistics)
            .CheckReference(p => p.Warehouse, _orderforecastdashboard_warehouse_orderforecaststatistics)
            .VerifyTheMappings();
        }
Exemplo n.º 17
0
        public void Stats_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _stocklevelkpi_warehouse_stats = new DSS1_RetailerDriverStockOptimisation.BO.Warehouse
            {
                Code        = "Warehouse_Code",
                Description = "Warehouse_Description",
                FlowType    = "Warehouse_FlowType",
            };
            var _stocklevelkpi_item_stats = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "503bf3c8-467b-47d4-8acd-02c46ab23130Item_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 940,
                SupplierPackSize = 5009,
                InnerPackSize    = 6760,
                PalletType       = "Item_PalletType",
                PalTI            = 6022,
                PalHI            = 7389,
                UOM              = "Item_UOM",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.Stats>(Session)
            .CheckProperty(p => p.Percentage, 222222.22M)
            .CheckProperty(p => p.Threshold, 222222.22M)
            .CheckProperty(p => p.DateFormatted, "Stats_DateFormatted")
            .CheckProperty(p => p.Date, now)
            .CheckReference(p => p.Warehouse, _stocklevelkpi_warehouse_stats)
            .CheckReference(p => p.Item, _stocklevelkpi_item_stats)
            .VerifyTheMappings();
        }
 public static DSS1_RetailerDriverStockOptimisation.BO.Response ImportImplementation(System.Collections.Generic.List <DSS1_RetailerDriverStockOptimisation.BO.Item> items)
 {
     foreach (var item in items ?? Enumerable.Empty <DSS1_RetailerDriverStockOptimisation.BO.Item>())
     {
         if (((item?.SKU ?? "") == null || (item?.SKU ?? "") == ""))
         {
             return(DSS1_RetailerDriverStockOptimisation.BO.ResponseExtensions.GenerateResponse("Failed", "Found an item with empty SKU.", "", "-1"));
         }
         if ((item?.Exists() ?? false))
         {
             zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "API", DSS1_RetailerDriverStockOptimisation.Hubs.EventsHub.RaiseDebugMessage, "Item exists.");
             DSS1_RetailerDriverStockOptimisation.BO.Item existingItem = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetById <DSS1_RetailerDriverStockOptimisation.BO.Item>((item?.SKU ?? ""));
             var _var0 = item?.Supplier?.Code;
             existingItem.Supplier = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetAsQueryable <DSS1_RetailerDriverStockOptimisation.BO.Supplier>((a) => a.Code == _var0)?.FirstOrDefault();
             var _var1 = item?.BusinessUnit?.Number;
             existingItem.BusinessUnit = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetAsQueryable <DSS1_RetailerDriverStockOptimisation.BO.BusinessUnit>((b) => b.Number == _var1)?.FirstOrDefault();
             var _var2 = item?.Category?.Number;
             var _var3 = item?.BusinessUnit?.Number;
             existingItem.Category = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetAsQueryable <DSS1_RetailerDriverStockOptimisation.BO.Category>((c) => c.Number == _var2 && c.BusinessUnit.Number == _var3)?.FirstOrDefault();
             var _var4 = item?.SubCategory?.Number;
             var _var5 = existingItem?.Category?.Id;
             existingItem.SubCategory = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetAsQueryable <DSS1_RetailerDriverStockOptimisation.BO.SubCategory>((sc) => sc.Number == _var4 && sc.Category.Id == _var5)?.FirstOrDefault();
             var _var6 = item?.BaseUnit?.Number;
             var _var7 = existingItem?.SubCategory?.Id;
             existingItem.BaseUnit         = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetAsQueryable <DSS1_RetailerDriverStockOptimisation.BO.BaseUnit>((bu) => bu.Number == _var6 && bu.SubCategory.Id == _var7)?.FirstOrDefault();
             existingItem.Description      = (item?.Description ?? "");
             existingItem.UPC              = (item?.UPC ?? "");
             existingItem.PalletSize       = (item?.PalletSize ?? 0);
             existingItem.SupplierPackSize = (item?.SupplierPackSize ?? 0);
             existingItem.InnerPackSize    = (item?.InnerPackSize ?? 0);
             existingItem.PalletType       = (item?.PalletType ?? "");
             existingItem.PalTI            = (item?.PalTI ?? 0);
             existingItem.PalHI            = (item?.PalHI ?? 0);
             existingItem.UOM              = (item?.UOM ?? "");
             new DSS1_RetailerDriverStockOptimisation.DAL.Repository().Save <DSS1_RetailerDriverStockOptimisation.BO.Item>(existingItem);
         }
         else
         {
             zAppDev.DotNet.Framework.Utilities.DebugHelper.Log(zAppDev.DotNet.Framework.Utilities.DebugMessageType.Info, "API", DSS1_RetailerDriverStockOptimisation.Hubs.EventsHub.RaiseDebugMessage, "***** New Item imported with SKU:  " + (item?.SKU ?? ""));
             DSS1_RetailerDriverStockOptimisation.BO.Item newItem = new DSS1_RetailerDriverStockOptimisation.BO.Item();
             newItem.SKU = (item?.SKU ?? "");
             var _var8 = item?.Supplier?.Code;
             newItem.Supplier = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetAsQueryable <DSS1_RetailerDriverStockOptimisation.BO.Supplier>((a) => a.Code == _var8)?.FirstOrDefault();
             var _var9 = item?.BusinessUnit?.Number;
             newItem.BusinessUnit = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetAsQueryable <DSS1_RetailerDriverStockOptimisation.BO.BusinessUnit>((b) => b.Number == _var9)?.FirstOrDefault();
             var _var10 = item?.Category?.Number;
             newItem.Category = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetAsQueryable <DSS1_RetailerDriverStockOptimisation.BO.Category>((c) => c.Number == _var10)?.FirstOrDefault();
             var _var11 = item?.SubCategory?.Number;
             var _var12 = item?.Category?.Id;
             newItem.SubCategory = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetAsQueryable <DSS1_RetailerDriverStockOptimisation.BO.SubCategory>((sc) => sc.Number == _var11 && sc.Category.Id == _var12)?.FirstOrDefault();
             var _var13 = item?.BaseUnit?.Number;
             var _var14 = item?.SubCategory?.Id;
             newItem.BaseUnit         = new DSS1_RetailerDriverStockOptimisation.DAL.Repository().GetAsQueryable <DSS1_RetailerDriverStockOptimisation.BO.BaseUnit>((bu) => bu.Number == _var13 && bu.SubCategory.Id == _var14)?.FirstOrDefault();
             newItem.Description      = (item?.Description ?? "");
             newItem.UPC              = (item?.UPC ?? "");
             newItem.PalletSize       = (item?.PalletSize ?? 0);
             newItem.SupplierPackSize = (item?.SupplierPackSize ?? 0);
             newItem.InnerPackSize    = (item?.InnerPackSize ?? 0);
             newItem.PalletType       = (item?.PalletType ?? "");
             newItem.PalTI            = (item?.PalTI ?? 0);
             newItem.PalHI            = (item?.PalHI ?? 0);
             newItem.UOM              = (item?.UOM ?? "");
             new DSS1_RetailerDriverStockOptimisation.DAL.Repository().Save <DSS1_RetailerDriverStockOptimisation.BO.Item>(newItem);
         }
     }
     return(DSS1_RetailerDriverStockOptimisation.BO.ResponseExtensions.GenerateResponse("Succeed", "All items imported successfully.", "", "1"));
 }
Exemplo n.º 19
0
        public void OrderForecastDetails_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _orderproposal_warehouse_replenishmentcycle = new DSS1_RetailerDriverStockOptimisation.BO.Warehouse
            {
                Code        = "Warehouse_Code",
                Description = "Warehouse_Description",
                FlowType    = "Warehouse_FlowType",
            };
            var _orderproposal_item_replenishmentcycle = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "68e95eb3-1f57-4e61-82ab-c5eeff2484acItem_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 9931,
                SupplierPackSize = 8703,
                InnerPackSize    = 8448,
                PalletType       = "Item_PalletType",
                PalTI            = 3011,
                PalHI            = 5370,
                UOM              = "Item_UOM",
            };
            var _orderproposal_orderforecast_orderforecastdetails = new DSS1_RetailerDriverStockOptimisation.BO.OrderForecast
            {
                ImportId  = 9967,
                Status    = "OrderForecast_Status",
                CreatedBy = "OrderForecast_CreatedBy",
                CreatedOn = now,
                StartDate = now,
                EndDate   = now,
                State     = "OrderForecast_State",
            };
            var _orderproposal_notification_orderforecastdetails = new DSS1_RetailerDriverStockOptimisation.BO.Notification
            {
                Message               = "Notification_Message",
                TotalSupplierStock    = 8630,
                OrderForecastQuantity = 3921,
                Diff = 1087,
                SalesForecastDate = now,
                CreatedBy         = "Notification_CreatedBy",
            };
            var _orderproposal_comments_orderforecastdetails = new DSS1_RetailerDriverStockOptimisation.BO.Comment
            {
                Text    = "Comment_Text",
                AddedBy = "Comment_AddedBy",
            };
            var _orderproposal_comments_orderforecastdetails2 = new DSS1_RetailerDriverStockOptimisation.BO.Comment
            {
                Text    = "Comment_Text",
                AddedBy = "Comment_AddedBy",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.OrderForecastDetails>(Session)
            .CheckProperty(p => p.ReplenishmentCycle, 8054)
            .CheckProperty(p => p.AutomatedForecast, 8786)
            .CheckProperty(p => p.Quantity, 2222222222.22222M)
            .CheckProperty(p => p.RecommendedOrderDate, now)
            .CheckProperty(p => p.SalesForecastDate, now)
            .CheckProperty(p => p.SupplierCanDeliver, true)
            .CheckProperty(p => p.SupplierMaxQuantity, 2222222222.22222M)
            .CheckProperty(p => p.SupplierCoverageDays, 9995)
            .CheckProperty(p => p.ItemCoverageDays, 1553)
            .CheckProperty(p => p.InitialStockLevel, 6286)
            .CheckProperty(p => p.SupplierAvailableQuantity, 6124)
            .CheckProperty(p => p.SupplierSharesStock, true)
            .CheckProperty(p => p.CreatedOn, now)
            .CheckProperty(p => p.Status, "OrderForecastDetails_Status")
            .CheckReference(p => p.Warehouse, _orderproposal_warehouse_replenishmentcycle)
            .CheckReference(p => p.Item, _orderproposal_item_replenishmentcycle)
            .CheckReference(p => p.OrderForecast, _orderproposal_orderforecast_orderforecastdetails)
            .CheckReference(p => p.Notification, _orderproposal_notification_orderforecastdetails)
            .CheckBag(p => p.Comments, (new List <DSS1_RetailerDriverStockOptimisation.BO.Comment>
            {
                _orderproposal_comments_orderforecastdetails,
                _orderproposal_comments_orderforecastdetails2
            }))
            .VerifyTheMappings();
        }
        public void Agreement_persistence_test()
        {
            DateTime now = DateTime.Now;

            // Get datetime without milliseconds
            now = new DateTime(now.Ticks - (now.Ticks % TimeSpan.TicksPerSecond), now.Kind);
            var _agreement_agreementstatuses_agreement = new DSS1_RetailerDriverStockOptimisation.BO.AgreementStatus
            {
                IssuedBy           = "AgreementStatus_IssuedBy",
                Status             = "AgreementStatus_Status",
                DateIssued         = now,
                ApprovedBySonae    = true,
                ApprovedBySupplier = true,
                InProgress         = true,
                Active             = true,
                UnderRevision      = true,
            };
            var _agreement_agreementstatuses_agreement2 = new DSS1_RetailerDriverStockOptimisation.BO.AgreementStatus
            {
                IssuedBy           = "AgreementStatus_IssuedBy",
                Status             = "AgreementStatus_Status",
                DateIssued         = now,
                ApprovedBySonae    = true,
                ApprovedBySupplier = true,
                InProgress         = true,
                Active             = true,
                UnderRevision      = true,
            };
            var _agreement_items_agreements = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "85c41988-a9ba-4eda-9414-d5e910f388a2Item_SKU",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 5412,
                SupplierPackSize = 2461,
                InnerPackSize    = 5128,
                PalletType       = "Item_PalletType",
                PalTI            = 965,
                PalHI            = 4274,
                UOM              = "Item_UOM",
            };
            var _agreement_items_agreements2 = new DSS1_RetailerDriverStockOptimisation.BO.Item
            {
                SKU              = "1111",
                Description      = "Item_Description",
                UPC              = "Item_UPC",
                AvgDailyDemand   = 222222.22M,
                PalletSize       = 2720,
                SupplierPackSize = 6994,
                InnerPackSize    = 6127,
                PalletType       = "Item_PalletType",
                PalTI            = 161,
                PalHI            = 6362,
                UOM              = "Item_UOM",
            };
            var _agreement_supplier_agreements = new DSS1_RetailerDriverStockOptimisation.BO.Supplier
            {
                Code = "Supplier_Code",
                Name = "Supplier_Name",
            };
            var _agreement_warehouses_agreements = new DSS1_RetailerDriverStockOptimisation.BO.Warehouse
            {
                Code        = "Warehouse_Code",
                Description = "Warehouse_Description",
                FlowType    = "Warehouse_FlowType",
            };
            var _agreement_warehouses_agreements2 = new DSS1_RetailerDriverStockOptimisation.BO.Warehouse
            {
                Code        = "Warehouse_Code",
                Description = "Warehouse_Description",
                FlowType    = "Warehouse_FlowType",
            };
            var _agreement_stockonhands_agreement = new DSS1_RetailerDriverStockOptimisation.BO.StockOnHand
            {
                Units = 3710,
                CurrentInventoryDays = 222222.22M,
                StockOnHandDate      = now,
                LeadTime             = "StockOnHand_LeadTime",
                TargetInventoryDays  = 222222.22M,
                FullTrackLoad        = true,
                WDDays = true,
            };
            var _agreement_stockonhands_agreement2 = new DSS1_RetailerDriverStockOptimisation.BO.StockOnHand
            {
                Units = 1751,
                CurrentInventoryDays = 222222.22M,
                StockOnHandDate      = now,
                LeadTime             = "StockOnHand_LeadTime",
                TargetInventoryDays  = 222222.22M,
                FullTrackLoad        = true,
                WDDays = true,
            };
            var _agreement_transportuncaps_agreement = new DSS1_RetailerDriverStockOptimisation.BO.TransportUnCap
            {
                UOP        = "TransportUnCap_UOP",
                PercRound  = 2222222222.22222M,
                Tuc1       = 2222222222.22222M,
                SplitOcInd = "TransportUnCap_SplitOcInd",
                Status     = "TransportUnCap_Status",
            };
            var _agreement_transportuncaps_agreement2 = new DSS1_RetailerDriverStockOptimisation.BO.TransportUnCap
            {
                UOP        = "TransportUnCap_UOP",
                PercRound  = 2222222222.22222M,
                Tuc1       = 2222222222.22222M,
                SplitOcInd = "TransportUnCap_SplitOcInd",
                Status     = "TransportUnCap_Status",
            };

            new PersistenceSpecification <DSS1_RetailerDriverStockOptimisation.BO.Agreement>(Session)
            .CheckProperty(p => p.FullTruckLoad, true)
            .CheckProperty(p => p.AgreementDocument, "Agreement_AgreementDocument")
            .CheckProperty(p => p.LeadTime, "Agreement_LeadTime")
            .CheckProperty(p => p.DateCreated, now)
            .CheckProperty(p => p.WDDeliveries, true)
            .CheckProperty(p => p.TargetInventoryDays, 6622)
            .CheckProperty(p => p.Profile, "Agreement_Profile")
            .CheckBag(p => p.AgreementStatuses, (new List <DSS1_RetailerDriverStockOptimisation.BO.AgreementStatus>
            {
                _agreement_agreementstatuses_agreement,
                _agreement_agreementstatuses_agreement2
            }))
            .CheckBag(p => p.Items, (new List <DSS1_RetailerDriverStockOptimisation.BO.Item>
            {
                _agreement_items_agreements,
                _agreement_items_agreements2
            }))
            .CheckReference(p => p.Supplier, _agreement_supplier_agreements)
            .CheckBag(p => p.Warehouses, (new List <DSS1_RetailerDriverStockOptimisation.BO.Warehouse>
            {
                _agreement_warehouses_agreements,
                _agreement_warehouses_agreements2
            }))
            .CheckBag(p => p.StockOnHands, (new List <DSS1_RetailerDriverStockOptimisation.BO.StockOnHand>
            {
                _agreement_stockonhands_agreement,
                _agreement_stockonhands_agreement2
            }))
            .CheckBag(p => p.TransportUnCaps, (new List <DSS1_RetailerDriverStockOptimisation.BO.TransportUnCap>
            {
                _agreement_transportuncaps_agreement,
                _agreement_transportuncaps_agreement2
            }))
            .VerifyTheMappings();
        }