nus-cs2103-AY2324S2 / pe-dev-response

0 stars 0 forks source link

Incorrect sorting order in price #4739

Open nus-pe-bot opened 5 months ago

nus-pe-bot commented 5 months ago

Steps to reproduce:

  1. Run the following four commands. /add-supplier ; name : S1 ; phone : 98673098 ; address : Meow Street 24 ; email : ilovewombatstoo@gmail.com ; product : kibble ; price : $13/bag /add-supplier ; name : S2 ; phone : 98673098 ; address : Meow Street 24 ; email : ilovewombatstoo@gmail.com ; product : kibble ; price : $5/bag /add-supplier ; name : S3 ; phone : 98673098 ; address : Meow Street 24 ; email : ilovewombatstoo@gmail.com ; product : kibble ; price : $52/bag /add-supplier ; name : S4 ; phone : 98673098 ; address : Meow Street 24 ; email : ilovewombatstoo@gmail.com ; product : kibble ; price : $98/bag
  2. Run /sort ; field : price.

Expected: The sorting order should be S2, S1, S3, S4.

Observed: The order is S1, S2, S3, S4.

image.png


[original: nus-cs2103-AY2324S2/pe-interim#4152] [original labels: type.FunctionalityBug severity.Medium]

yleeyilin commented 5 months ago

Team's Response

This is our intended behaviour. In our UG, we mentioned that we intended to sort the price by lexicographical ordering, not by the exact value of the price, as for the price of products, there is no fixed quantity (e.g. bag, litre, kg etc.), so the prices themselves are not comparable against each other. So, our intended behaviour is to perform a lexicographical search through the whole price of the item.

telegram-cloud-photo-size-5-6138804929951809370-x.jpg

Duplicate status (if any):

--