Closed ThanhSonITNIC closed 4 months ago
https://github.com/Lomkit/laravel-rest-api/issues/105 aggregates can't be complex and multiple response keys in a relation
Could you please add unit tests, i'm quite sur when you'll have problems with your example because the query is manipulated multiple time and is immutable
Another example, we need stats of orders:
I have some ways:
[relation, type, field]
in relation transactions
"aggregates": [
{
"relation": "transactions",
"type": "sum",
"field": "amount",
"filters": [
{"field": "type", "value": "debit"}
]
},
{
"relation": "transactions",
"type": "sum",
"field": "amount",
"filters": [
{"field": "type", "value": "payment"}
]
},
{
"relation": "items",
"type": "sum",
"field": "quantity_return"
}
],
[GET]\api\orders\stats
this api not extend search
and interactions
from this packageCould you please add unit tests, i'm quite sur when you'll have problems with your example because the query is manipulated multiple time and is immutable
unit test better by your
@GautierDele please review, it take 3 days
I gave you the problem, i'm not able to handle this for now
When we want to extend filters and interactions in resource with stats data
PostResource
Request
[POST] api/posts/search
Response