diff --git a/server/AyaNova/biz/PartBiz.cs b/server/AyaNova/biz/PartBiz.cs index 5e9f2e84..39067e2f 100644 --- a/server/AyaNova/biz/PartBiz.cs +++ b/server/AyaNova/biz/PartBiz.cs @@ -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? var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(x => x.FormKey == AyaType.Part.ToString()); diff --git a/server/AyaNova/biz/PurchaseOrderBiz.cs b/server/AyaNova/biz/PurchaseOrderBiz.cs index 40c9dbe7..1364e342 100644 --- a/server/AyaNova/biz/PurchaseOrderBiz.cs +++ b/server/AyaNova/biz/PurchaseOrderBiz.cs @@ -790,7 +790,7 @@ namespace AyaNova.Biz return RequestsToUpdate; } - //MIGRATE_OUTSTANDING - update workorderitempart here if applicable + //Update part values into poitem if the vendor has changed if (oldObj.VendorId != newObj.VendorId) diff --git a/server/AyaNova/biz/QuoteStatusBiz.cs b/server/AyaNova/biz/QuoteStatusBiz.cs index a0b5abeb..66f77928 100644 --- a/server/AyaNova/biz/QuoteStatusBiz.cs +++ b/server/AyaNova/biz/QuoteStatusBiz.cs @@ -202,8 +202,7 @@ namespace AyaNova.Biz } private async Task ValidateCanDeleteAsync(QuoteStatus inObj) - { - //MIGRATE_OUTSTANDING - check workorder records once wo is coded here + { await Task.CompletedTask; //Referential integrity //FOREIGN KEY CHECKS diff --git a/server/AyaNova/biz/UserBiz.cs b/server/AyaNova/biz/UserBiz.cs index 05c509e2..448261a4 100644 --- a/server/AyaNova/biz/UserBiz.cs +++ b/server/AyaNova/biz/UserBiz.cs @@ -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()) { AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "UserType"); diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index a3f1ed04..42c23a53 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -711,11 +711,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE"); //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"); - //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 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, "