evitaDB is a specialized database with an easy-to-use API for e-commerce systems. It is a low-latency NoSQL in-memory engine that handles all the complex tasks that e-commerce systems have to deal with on a daily basis. evitaDB is expected to act as a fast secondary lookup/search index used by front stores.
We should build on issue #549 and introduce a new sort option that would allow to specify a list of price lists that should be considered as discounted. The query engine should then calculate the discounted price according to the inner record price handling rules and calculate the discount compared to the selling price:
If the discount result is negative (i.e. the discounted price is greater than the selling price), it's considered to be zero. Sorting in ascending order means that the products with no discount are returned first, and the products with the largest discount are returned last. Descending order returns the product with the largest discount first.
❗ Important change
The sellable property on the PriceContract interface has been renamed to indexed because it better describes its purpose. It's also more aligned with property naming in the attribute schema - which also uses the `indexed' keyword for the same purpose.
We should build on issue #549 and introduce a new sort option that would allow to specify a list of price lists that should be considered as discounted. The query engine should then calculate the discounted price according to the inner record price handling rules and calculate the discount compared to the selling price:
And in evitaQL:
If the discount result is negative (i.e. the discounted price is greater than the selling price), it's considered to be zero. Sorting in ascending order means that the products with no discount are returned first, and the products with the largest discount are returned last. Descending order returns the product with the largest discount first.
❗ Important change
The
sellable
property on thePriceContract
interface has been renamed toindexed
because it better describes its purpose. It's also more aligned with property naming in the attribute schema - which also uses the `indexed' keyword for the same purpose.