This commit is contained in:
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@@ -53,7 +53,7 @@
|
|||||||
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
|
"AYANOVA_FOLDER_USER_FILES": "c:\\temp\\RavenTestData\\userfiles",
|
||||||
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
|
"AYANOVA_FOLDER_BACKUP_FILES": "c:\\temp\\RavenTestData\\backupfiles",
|
||||||
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
|
"AYANOVA_FOLDER_TEMPORARY_SERVER_FILES": "c:\\temp\\RavenTestData\\tempfiles",
|
||||||
"AYANOVA_SERVER_TEST_MODE": "false",
|
"AYANOVA_SERVER_TEST_MODE": "true",
|
||||||
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
|
"AYANOVA_SERVER_TEST_MODE_SEEDLEVEL": "small",
|
||||||
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
|
"AYANOVA_SERVER_TEST_MODE_TZ_OFFSET": "-7",
|
||||||
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"
|
"AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_13\\bin\\"
|
||||||
|
|||||||
Binary file not shown.
@@ -109,7 +109,7 @@ namespace AyaNova.Biz
|
|||||||
if (logTheGetEvent && ret != null)
|
if (logTheGetEvent && ret != null)
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, id, BizType, AyaEvent.Retrieved), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, id, BizType, AyaEvent.Retrieved), ct);
|
||||||
|
|
||||||
if (populatePartNames && ret.Items!=null && ret.Items.Count > 0)
|
if (populatePartNames && ret.Items != null && ret.Items.Count > 0)
|
||||||
{
|
{
|
||||||
var partIdList = ret.Items.Select(z => z.PartId).ToArray();
|
var partIdList = ret.Items.Select(z => z.PartId).ToArray();
|
||||||
var PickList = PickListFactory.GetAyaPickList(AyaType.Part);
|
var PickList = PickListFactory.GetAyaPickList(AyaType.Part);
|
||||||
@@ -265,6 +265,15 @@ namespace AyaNova.Biz
|
|||||||
if (proposedObj.Items.GroupBy(z => z.PartId).Any(g => g.Count() > 1))
|
if (proposedObj.Items.GroupBy(z => z.PartId).Any(g => g.Count() > 1))
|
||||||
{
|
{
|
||||||
AddError(ApiErrorCode.VALIDATION_FAILED, "Items", "Duplicate parts are not allowed in the items collection");
|
AddError(ApiErrorCode.VALIDATION_FAILED, "Items", "Duplicate parts are not allowed in the items collection");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Make sure there are no < 1 quantities and if there are make them 1 rather than reporting a broken rule
|
||||||
|
//(decided this based on UI and likelyhood etc it woudl be hard to show this as a biz rule with the simple UI for it)
|
||||||
|
foreach (var pai in proposedObj.Items)
|
||||||
|
{
|
||||||
|
if (pai.Quantity < 1)
|
||||||
|
pai.Quantity = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Any form customizations to validate?
|
//Any form customizations to validate?
|
||||||
|
|||||||
@@ -12,12 +12,16 @@ namespace AyaNova.Models
|
|||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public long PartAssemblyId { get; set; }
|
public long PartAssemblyId { get; set; }
|
||||||
|
[Required]
|
||||||
public long PartId { get; set; }
|
public long PartId { get; set; }
|
||||||
|
[Required]
|
||||||
|
public decimal Quantity { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public PartAssembly PartAssembly { get; set; }
|
public PartAssembly PartAssembly { get; set; }
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public string PartDisplay {get;set;}
|
public string PartDisplay { get; set; }
|
||||||
|
|
||||||
}//eoc
|
}//eoc
|
||||||
|
|
||||||
|
|||||||
@@ -671,7 +671,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
|||||||
|
|
||||||
//PARTASSEMBLYITEM
|
//PARTASSEMBLYITEM
|
||||||
await ExecQueryAsync("CREATE TABLE apartassemblyitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, partassemblyid bigint not null REFERENCES apartassembly on delete cascade, " +
|
await ExecQueryAsync("CREATE TABLE apartassemblyitem (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, partassemblyid bigint not null REFERENCES apartassembly on delete cascade, " +
|
||||||
"partid bigint not null REFERENCES apart, " +
|
"partid bigint not null REFERENCES apart, quantity decimal(19,4) not null default 1, " +
|
||||||
"CONSTRAINT UNQ_PartAssemblyPart UNIQUE (partid, partassemblyid) " +//ensure no duplicate parts in the same assembly
|
"CONSTRAINT UNQ_PartAssemblyPart UNIQUE (partid, partassemblyid) " +//ensure no duplicate parts in the same assembly
|
||||||
")");
|
")");
|
||||||
// await ExecQueryAsync("CREATE INDEX idx_apartassemblyitem_partid ON apartassemblyitem(partid)");
|
// await ExecQueryAsync("CREATE INDEX idx_apartassemblyitem_partid ON apartassemblyitem(partid)");
|
||||||
|
|||||||
Reference in New Issue
Block a user