Skip to content

New Validations#81

Open
robinmanuelthiel wants to merge 1 commit intomainfrom
feat/newvalidations
Open

New Validations#81
robinmanuelthiel wants to merge 1 commit intomainfrom
feat/newvalidations

Conversation

@robinmanuelthiel
Copy link
Owner

@robinmanuelthiel robinmanuelthiel commented Oct 1, 2025

This pull request introduces a minor bug fix and validation improvement to the basket service. The main updates are the addition of a default image URL for basket items and enhanced validation for negative unit prices.

Basket item enhancements:

  • Added a default PictureUrl ("http://mypictures/demo.jpg") to each item when mapping to a CustomerBasket in BasketService.cs to ensure items always have an image.

Validation improvements:

  • Updated BasketItem validation to add an error if UnitPrice is negative, improving data integrity. The error message is in German: "Unit Preis muss grösser als null sein".

Code cleanup:

  • Reordered using statements in BasketService.cs for better organization.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces new validations to the basket functionality by adding unit price validation and reorganizing imports.

  • Adds validation for negative unit prices in BasketItem
  • Reorders using statements in BasketService for better organization
  • Adds a hardcoded picture URL to basket item mapping

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/Basket.API/Model/BasketItem.cs Adds validation to prevent negative unit prices
src/Basket.API/Grpc/BasketService.cs Reorders imports and adds hardcoded picture URL to basket items

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants