This commit is contained in:
2021-02-26 17:29:02 +00:00
parent 009bcffc29
commit 5e7a99a668
2 changed files with 13 additions and 5 deletions

View File

@@ -22,11 +22,11 @@ namespace AyaNova.Util
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
private const int DESIRED_SCHEMA_LEVEL = 15;
internal const long EXPECTED_COLUMN_COUNT = 736;
internal const long EXPECTED_COLUMN_COUNT = 747;
internal const long EXPECTED_INDEX_COUNT = 125;
internal const long EXPECTED_CHECK_CONSTRAINTS = 328;
internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 70;
internal const long EXPECTED_VIEWS = 1;
internal const long EXPECTED_VIEWS = 3;
internal const long EXPECTED_ROUTINES = 2;
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!

View File

@@ -1576,9 +1576,10 @@ namespace AyaNova.Util
//
public async Task SeedPartAsync(ILogger log, int count, int maxQuantity)
{
todo: need to have a few partstocklevel entries for testing, maybe here, maybe in known seed data or I guess part must exist first so...
//maybe just do the first X number with restock values higher than in stock values??
//or seed known parts??
//for testing purposes make a quarter (approx) of parts that are lower than restock level
int PartStockLevelParts = count / 4;
Console.WriteLine($"SEEDER PartStockLevelParts is {PartStockLevelParts}");
for (int x = 0; x < count; x++)
{
@@ -1665,6 +1666,13 @@ namespace AyaNova.Util
}
}
if (PartStockLevelParts > 0)
{
PartStockLevelParts--;
List<PartStockLevel> partStockLevels = new List<PartStockLevel>();
partStockLevels.Add(new PartStockLevel() { PartWarehouseId = 1, PartId = NewObject.Id, MinimumQuantity = OpeningInventoryLevel * 2 });
await biz.PutStockLevelsAsync(NewObject.Id, partStockLevels);
}
}
}
}