clean up migrate_outstanding stuff
This commit is contained in:
@@ -447,21 +447,7 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//MIGRATE_OUTSTANDING awaiting inventory / biz rule to ensure serialized part can't be unserialized if there is any inventory
|
|
||||||
/*
|
|
||||||
BrokenRules.Assert("TrackSerialNumberRequired",
|
|
||||||
"Part.Error.MustTrackSerial",
|
|
||||||
"TrackSerialNumber",
|
|
||||||
!this.IsNew && value==false && PartHasSerialNumbers.GetItem(this.mID));
|
|
||||||
|
|
||||||
//case 1011
|
|
||||||
BrokenRules.Assert("TrackSerialHasInventory",
|
|
||||||
"Part.Error.TrackSerialHasInventory",
|
|
||||||
"TrackSerialNumber",
|
|
||||||
!this.IsNew && value == true && PartInventoryValuesFetcher.GetItem(mID).QuantityOnHand>0);
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
//Any form customizations to validate?
|
//Any form customizations to validate?
|
||||||
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(x => x.FormKey == AyaType.Part.ToString());
|
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(x => x.FormKey == AyaType.Part.ToString());
|
||||||
|
|||||||
@@ -790,7 +790,7 @@ namespace AyaNova.Biz
|
|||||||
return RequestsToUpdate;
|
return RequestsToUpdate;
|
||||||
}
|
}
|
||||||
|
|
||||||
//MIGRATE_OUTSTANDING - update workorderitempart here if applicable
|
|
||||||
|
|
||||||
//Update part values into poitem if the vendor has changed
|
//Update part values into poitem if the vendor has changed
|
||||||
if (oldObj.VendorId != newObj.VendorId)
|
if (oldObj.VendorId != newObj.VendorId)
|
||||||
|
|||||||
@@ -202,8 +202,7 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async Task ValidateCanDeleteAsync(QuoteStatus inObj)
|
private async Task ValidateCanDeleteAsync(QuoteStatus inObj)
|
||||||
{
|
{
|
||||||
//MIGRATE_OUTSTANDING - check workorder records once wo is coded here
|
|
||||||
await Task.CompletedTask;
|
await Task.CompletedTask;
|
||||||
//Referential integrity
|
//Referential integrity
|
||||||
//FOREIGN KEY CHECKS
|
//FOREIGN KEY CHECKS
|
||||||
|
|||||||
@@ -799,37 +799,8 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Validation rules that require future other objects that aren't present yet:
|
|
||||||
/*
|
|
||||||
|
|
||||||
|
|
||||||
//MIGRATE_OUTSTANDING TODO: role changes when has things that require a role like notification subscriptions and others
|
|
||||||
|
|
||||||
|
|
||||||
//Don't allow to go from non scheduleable if there are any scheduled workorder items because
|
|
||||||
//it would damage the history
|
|
||||||
BrokenRules.Assert("UserType","User.Label.MustBeScheduleable","UserType",(mUserType==UserTypes.Schedulable) && (ScheduledUserCount(this.mID,false)>0));
|
|
||||||
|
|
||||||
mUserType = value;
|
|
||||||
|
|
||||||
BrokenRules.Assert("UserTypeInvalid","Error.Object.FieldValueNotBetween,User.Label.UserType,1,7","UserType",((int)value<1 || (int)value>6));
|
|
||||||
|
|
||||||
bool bOutOfLicenses=OutOfLicenses;
|
|
||||||
BrokenRules.Assert("ActiveLicense","Error.Security.UserCapacity","Active",bOutOfLicenses);
|
|
||||||
BrokenRules.Assert("UserTypeLicense","Error.Security.UserCapacity","UserType",bOutOfLicenses);
|
|
||||||
|
|
||||||
//Case 850
|
|
||||||
BrokenRules.Assert("ClientIDInvalid", "Error.Object.RequiredFieldEmpty,O.Client", "ClientID",
|
|
||||||
(mUserType== UserTypes.Client && mClientID==Guid.Empty));
|
|
||||||
|
|
||||||
BrokenRules.Assert("HeadOfficeIDInvalid", "Error.Object.RequiredFieldEmpty,O.HeadOffice", "HeadOfficeID",
|
|
||||||
(mUserType == UserTypes.HeadOffice && mHeadOfficeID == Guid.Empty));
|
|
||||||
|
|
||||||
|
|
||||||
ACTIVE: need to check user count against license when re-activating a user
|
|
||||||
need to check open workorders and any other critical items when de-activating a user
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (!proposedObj.UserType.IsValid())
|
if (!proposedObj.UserType.IsValid())
|
||||||
{
|
{
|
||||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "UserType");
|
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "UserType");
|
||||||
|
|||||||
@@ -711,11 +711,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
|
|||||||
//PART INVENTORY VIEW
|
//PART INVENTORY VIEW
|
||||||
await ExecQueryAsync("CREATE VIEW vpartinventorynow AS WITH T AS (SELECT *, ROW_NUMBER() OVER(PARTITION BY partid, partwarehouseid ORDER BY entrydate DESC) AS rn FROM apartinventory) SELECT * FROM T WHERE rn = 1");
|
await ExecQueryAsync("CREATE VIEW vpartinventorynow AS WITH T AS (SELECT *, ROW_NUMBER() OVER(PARTITION BY partid, partwarehouseid ORDER BY entrydate DESC) AS rn FROM apartinventory) SELECT * FROM T WHERE rn = 1");
|
||||||
|
|
||||||
//MIGRATE_OUTSTANDING: index(s) to support inventory ops
|
|
||||||
//recheck this again once have full inventory in place and run some manual queries taken from inventory methods and issued by ef core
|
|
||||||
//see what if any index tuning will help with a huge db of realistic data doing most common ops
|
|
||||||
//await ExecQueryAsync("CREATE INDEX idx_PartInventory_SourceId_SourceType ON apartinventory (sourceid, sourcetype);");
|
|
||||||
|
|
||||||
//PARTSTOCKLEVEL
|
//PARTSTOCKLEVEL
|
||||||
await ExecQueryAsync("CREATE TABLE apartstocklevel (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, partwarehouseid BIGINT NOT NULL REFERENCES apartwarehouse ON DELETE CASCADE, "
|
await ExecQueryAsync("CREATE TABLE apartstocklevel (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, partwarehouseid BIGINT NOT NULL REFERENCES apartwarehouse ON DELETE CASCADE, "
|
||||||
+ "partid BIGINT NOT NULL REFERENCES apart ON DELETE CASCADE, minimumquantity DECIMAL(19,5) NOT NULL default 1, "
|
+ "partid BIGINT NOT NULL REFERENCES apart ON DELETE CASCADE, minimumquantity DECIMAL(19,5) NOT NULL default 1, "
|
||||||
|
|||||||
Reference in New Issue
Block a user