Skip to content

Additional bulk adjunct query operations#1226

Open
JackLewis-digirati wants to merge 4 commits into
developfrom
feature/bulkAdjunctOperations
Open

Additional bulk adjunct query operations#1226
JackLewis-digirati wants to merge 4 commits into
developfrom
feature/bulkAdjunctOperations

Conversation

@JackLewis-digirati

@JackLewis-digirati JackLewis-digirati commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

What does this change?

Resolves #1160

This PR adds a pair of new endpoints to allow further querying of data, along with enabling querying. These mimic existing functionality in assets

  • GET /customers/{customer}/adjunctQueue/batches/{batchId}/current
    • Adjuncts that are currently part of the batch (i.e.: not superseded)
  • GET /customers/{customer}/adjunctQueue/batches/{batchId}/adjuncts
    • Adjuncts that were part of the batch when first created (i.e.: this would include adjuncts that nave been superseded)

@JackLewis-digirati
JackLewis-digirati requested a review from a team as a code owner July 21, 2026 15:28
@JackLewis-digirati
JackLewis-digirati marked this pull request as draft July 22, 2026 11:34
@JackLewis-digirati

Copy link
Copy Markdown
Collaborator Author

Summary

Implements #1160: two new GET endpoints for listing the Adjunct members of an adjunct batch, mirroring the existing asset/image batch-queue endpoints (/queue/batches/{batchId}/images and /assets).

  • GET /customers/{customer}/adjunctQueue/batches/{batchId}/current — adjuncts whose Batch currently points at this batch.
  • GET /customers/{customer}/adjunctQueue/batches/{batchId}/adjuncts — adjuncts that were part of the batch at creation time (via the AdjunctBatchAdjuncts join table), even if since reassigned to another batch, excluding any since deleted.

Both support page/pageSize paging (same ApiSettings.PageSize config as the asset endpoints) and orderBy/orderByDescending, with Created as the only supported sort field per the ticket.

Notable implementation details

  • Reuses the existing generic paging plumbing (PagingHelpers.CreatePagedResult, HydraController.HandlePagedFetch/SetPaging/SetOrderBy) unchanged.
  • Introduces a shared GetBatchEntitiesBase<TEntity, TRequest> in API/Infrastructure/Page, extracting the "run paged query → if empty, check the batch exists to disambiguate 404 vs empty page" pattern that was previously duplicated between the asset (GetBatchAssetsBase) and new adjunct (GetBatchAdjunctsBase) handlers. Both now just supply their entity-specific filter/ordering/batch-existence hooks.
  • The historical /adjuncts query joins AdjunctBatchAdjuncts to Adjuncts on the composite (AdjunctId, AssetId)/(Id, AssetId) key, since there's no Adjunct navigation property on the join entity.
  • 10 new integration tests cover 404s, paging, Created ordering, and the two edge cases that most matter for this ticket: an adjunct reassigned to a different batch drops out of the old batch's current listing but stays in its adjuncts (historical) listing, and a deleted adjunct drops out of adjuncts entirely.

No database migration required — this only adds read endpoints over existing tables.

@JackLewis-digirati
JackLewis-digirati marked this pull request as ready for review July 22, 2026 15:59
Comment thread src/protagonist/API/Features/AdjunctQueues/Requests/GetBatchAdjuncts.cs Outdated
Comment thread src/protagonist/API/Infrastructure/Page/GetBatchEntitiesBase.cs Outdated
Comment thread src/protagonist/API.Tests/Integration/CustomerAdjunctQueueTests.cs
- Tixghten GetBatchEntitiesBase
- Add additional test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get bulk adjuncts in batches endpoints

2 participants