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)
- Support for layering configuration
- Exception when querying non-existent entity by unique attribute HOT 1
- Avoid certificate generation when no TLS endpoint is configured
- Catalog data file gets broken after compaction
- Query targeting localized attribute returns no result
- Referenced entity bodies are not returned for hierarchically fetched parents
- Selecting facet combination from different groups enables hasSense for invalid facets
- Allow custom price for sale parameters for `multiplePricesForSaleAvailable` field in GQL HOT 2
- Filter references without referenced objects (optionally) HOT 1
- Support for disabling keep-alive header in configuration
- Unique ID identifying the catalog
- System status endpoint doesn't work
- SortIndex handles BigDecimal in wrong way
- System services for evitaLab HOT 1
- Failed to remove all references
- Remove classifier token distinction in evitaQL parser HOT 1
- REST / GraphQL support for backup / restore process
- Slow queries logging
- Support catalog ID in GQL and REST APIs HOT 1
- Support custom sessions in GQL and REST APIs
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.