Comments (5)
@novoj I don't think we can do it similarly easy in REST as in GQL without introducing separate endpoint for prices. Because in REST we use standard priceContent constraints for fetching prices, the priceContent doesn't have such option.
I could either return all prices for sale automatically when PriceContentMode.ALL
is requested, or we could introduce another PriceContentMode
similar to RESPECTING_FILTER
which would return the price for sale as well as the rest of prices for sale.
from evitadb.
I don't understand. If you use RESPECTING_FILTER
in price content - you'll receive ALL PRICES FOR SALE in the returned entity. But as I study the implementation you'd get really all the prices that are participating in the calculation - we lack method that would return winning prices for sale for each inner record id. I'd have to add such method.
from evitadb.
So, we have new fields in GQL allPricesForSale
and multiplePricesForSaleAvailable
where the first one can take arguments to calculate custom prices besides the main query the same way priceForSale
field does.
In REST, there is new multiplePricesForSaleAvailable
property for entities that have price inner record handling FIRST_OCCURENCE
or SUM
.
from evitadb.
Reopening this issue because we need to rework the multiplePricesForSaleAvailable
behaviour.
After some discussion we agreed on following behaviour:
- NONE:
- always
false
- there isn't a scenario whereNONE
returns multiple prices for sale
- always
- FIRST_OCCURENCE:
- price for sale for only one
innerRecordId
->false
- prices for sale for multiple
innerRecordId
s that have different price values ->true
- prices for sale for multiple
innerRecordId
s that all have the same price value ->false
- price for sale for only one
- SUM:
- price for sale for only one
innerRecordId
->false
- prices for sale for multiple
innerRecordId
s no matter the price values ->true
- price for sale for only one
We need to somehow be able to tell if two prices for sale for different innerRecordId
s have same value, but we have priceWithoutVat
, priceWithVat
and the vat
. We've agreed to use the priceType
for determining by which value to compare so that it is up to the client to specify it's use-case. So if priceType = WITH_VAT
we will use the priceWithVat
of each price to compare sameness, if priceType = WITHOUT_VAT
we will use the priceWithoutVat
of each price to compare sameness.
The same logic for comparing we will use for sorting the allPricesForSale
array returned from GraphQL API (this is new as well), so that FEs can easily determine lowest and highest values.
from evitadb.
I've updated the computation - please push your changes as a fix so that we don't trigger next major version - only patch. Thanks.
from evitadb.
Related Issues (20)
- Reference mutations set via OEM might be incomplete
- Speeding up the algorithm for finding a match at the beginning of a word
- Constraint `stopAt` is not correctly applied on `siblings` when used inside `parents` requirement HOT 1
- Constraint AttributeInRange doesn't correctly work with suffix Now
- Generated OpenAPI has version 3.0.1 even though internally we use 3.1
- Compute was not yet called on price termination formula, this is not expected! HOT 2
- Ineffective query execution plan
- Slow facet summary formula generation HOT 1
- QueryPlanner chooses sub-optimal execution path
- Extra results sorter does not carry the correct query context
- Conditional contents / GraphQL directives support
- Query targetting global attributes that doesn't match any record returns error instead of empty result HOT 1
- Multiple views of the same filtered entity set
- GraphQL returns errors when fetching referenced entities in a locale they don't have
- Facet group conjunction is ignored
- Revise documentation `documentation/user/en/operate/monitor.md`
- Rename FIRST_OCCURRENCE to LOWEST_PRICE HOT 2
- GraphQL/REST APIs allow EntityProperty constraint but evitaDB doesn't HOT 2
- Trailing comma in evitaQL HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from evitadb.