You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are 3 endpoints that return details of batches, each of which has different default ordering:
/customers/{customerId}/queue/batches - Get all customer batches, ordered by batch Id ASC (earliest created first)
/customers/{customerId}/queue/active - Get customer batches that are incomplete and not superseded, ordered by database default (no specific ordering applied).
/customers/{customerId}/queue/recent - Get customer batches that are finished, ordered by finished DESC (last finished first)
These endpoints should be updated to handle ?orderBy and ?orderByDescending query parameters to allow consumer to specify ordering. Handling the following values as these allow sorting by finished and created order:
finished - order by "Finished" date. Note that Postgres treats null values as larger than non-null so orderByDescending=finished would return unfinished first by default. Is this expected? Or would it be confusing? (may be able to avoid with coalesce DateTime.Min but NULLS LAST doesn't look to be supported by npgsql)
id - order by the PK "batch", this is generated from a sequence so will be the order the rows were written.
Do we also want to allow ordering by counts?
count - order by the total number of items in batch
errors - order by total number of errors
completed - order by total number of completed assets
Any DB implications? Will we need new indexes for larger dbs?
The text was updated successfully, but these errors were encountered:
There are 3 endpoints that return details of batches, each of which has different default ordering:
/customers/{customerId}/queue/batches
- Get all customer batches, ordered by batch Id ASC (earliest created first)/customers/{customerId}/queue/active
- Get customer batches that are incomplete and not superseded, ordered by database default (no specific ordering applied)./customers/{customerId}/queue/recent
- Get customer batches that are finished, ordered by finished DESC (last finished first)These endpoints should be updated to handle
?orderBy
and?orderByDescending
query parameters to allow consumer to specify ordering. Handling the following values as these allow sorting by finished and created order:finished
- order by"Finished"
date. Note that Postgres treatsnull
values as larger than non-null soorderByDescending=finished
would return unfinished first by default. Is this expected? Or would it be confusing? (may be able to avoid with coalesceDateTime.Min
butNULLS LAST
doesn't look to be supported by npgsql)id
- order by the PK"batch"
, this is generated from a sequence so will be the order the rows were written.Do we also want to allow ordering by counts?
count
- order by the total number of items in batcherrors
- order by total number of errorscompleted
- order by total number of completed assetsAny DB implications? Will we need new indexes for larger dbs?
The text was updated successfully, but these errors were encountered: