[refactor] Build allocation endpoints (#12361)

* Create benchmark for completing a build and consuming all items

* Refactor build consume task

* Add benchmarking

* Unroll allocate-stock serializer

* Complete build only after allocations are consumed

* re-export batch_events

* Add BulkPrefetchSerializerMixin

* Reduce queries even further

* Refactoring

* Unroll code and use bulk operations

* Refactoring for auto-allocation

* Add more test coverage for auto-allocation

* Fix model_reference_fields

* adjust unit test

* Apply concurrency protection

* Additional unit tests

* Remove per-line validation

* Fix unit test

* Adjust unit test

* Use bulk_create_and_fetch

* Cleanup

* Reimplement wrapper func for backwards compatibility

* Fix unit test

* Increase max query time

* Fix serializer

* Enforce pk ordering

* FIx for mysql
This commit is contained in:
Oliver
2026-07-24 19:48:50 +10:00
committed by GitHub
parent ea68eaf258
commit 145ef21196
12 changed files with 1445 additions and 260 deletions
@@ -627,6 +627,16 @@ test('Build Order - Consume Stock', async ({ browser }) => {
await page.getByText('Fully consumed').first().waitFor();
await page.getByText('15 / 15').first().waitFor();
// There should now not be any allocated stock remaining
await loadTab(page, 'Allocated Stock');
await page.getByText('No records found').first().waitFor();
await loadTab(page, 'Consumed Stock');
await page.getByRole('cell', { name: 'Thumbnail C_1uF_0805' }).waitFor();
await page.getByRole('cell', { name: 'Thumbnail M3x8 Torx' }).waitFor();
await page.getByRole('cell', { name: 'Thumbnail R_10K_0805_1%' }).waitFor();
await page.getByText('1 - 3 / 3').waitFor();
});
test('Build Order - Tracked Outputs', async ({ browser }) => {