Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Basket.API/Model/BasketItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public IEnumerable<ValidationResult> Validate(ValidationContext validationContex
results.Add(new ValidationResult("Invalid number of units", new[] { "Quantity" }));
}

if (OldUnitPrice >= UnitPrice)
{
results.Add(new ValidationResult("Der Preis ist zu heiß!", new[] { "OldUnitPrice", "UnitPrice" }));
Copy link

Copilot AI Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error message is in German and inconsistent with the existing English messages; consider using a clear English message like "UnitPrice must be greater than OldUnitPrice".

Suggested change
results.Add(new ValidationResult("Der Preis ist zu heiß!", new[] { "OldUnitPrice", "UnitPrice" }));
results.Add(new ValidationResult("UnitPrice must be greater than OldUnitPrice", new[] { "OldUnitPrice", "UnitPrice" }));

Copilot uses AI. Check for mistakes.
}

return results;
}
}