create errors instead of violations for too large waste amounts

This commit is contained in:
Daniel Schick 2024-11-06 10:22:31 +01:00
parent 11b9b14fbd
commit 8e1d41cc0d
2 changed files with 5 additions and 5 deletions

View File

@ -255,16 +255,16 @@ namespace bsmd.database
violations.Add(RuleEngine.CreateViolation(ValidationCode.V784, "WasteCode", null, this.Title, this.Identifier, this.Tablename)); violations.Add(RuleEngine.CreateViolation(ValidationCode.V784, "WasteCode", null, this.Title, this.Identifier, this.Tablename));
if (this.WasteDisposalAmount_MTQ >= 10000) if (this.WasteDisposalAmount_MTQ >= 10000)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste disposal amount too high", null, this.Title, this.Identifier, this.Tablename)); errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "Waste disposal amount too high", null, this.Title, this.Identifier, this.Tablename));
if (this.WasteCapacity_MTQ >= 10000) if (this.WasteCapacity_MTQ >= 10000)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste capacity too high", null, this.Title, this.Identifier, this.Tablename)); errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "Waste capacity too high", null, this.Title, this.Identifier, this.Tablename));
if (this.WasteAmountRetained_MTQ >= 10000) if (this.WasteAmountRetained_MTQ >= 10000)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste amount retained too high", null, this.Title, this.Identifier, this.Tablename)); errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "Waste amount retained too high", null, this.Title, this.Identifier, this.Tablename));
if (this.WasteAmountGeneratedTillNextPort_MTQ >= 10000) if (this.WasteAmountGeneratedTillNextPort_MTQ >= 10000)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste generated till next port too high", null, this.Title, this.Identifier, this.Tablename)); errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "Waste generated till next port too high", null, this.Title, this.Identifier, this.Tablename));
if(this.WasteDisposalAmount_MTQ > this.WasteCapacity_MTQ) if(this.WasteDisposalAmount_MTQ > this.WasteCapacity_MTQ)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Disposal greater than capacity!", null, this.Title, this.Identifier, this.Tablename)); violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Disposal greater than capacity!", null, this.Title, this.Identifier, this.Tablename));

View File

@ -137,7 +137,7 @@ namespace bsmd.database
public override void Validate(List<MessageError> errors, List<MessageViolation> violations) public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
{ {
if (this.AmountWasteReceived_MTQ >= 10000) if (this.AmountWasteReceived_MTQ >= 10000)
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Waste disposal amount too high", null, this.Title, this.Identifier, this.Tablename)); errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE, "Waste disposal amount too high", null, this.Title, this.Identifier, this.Tablename));
} }
#endregion #endregion