feat: persist image derivative jobs
Quality / test (push) Canceled after 0s

This commit is contained in:
2026-09-08 22:00:18 -04:00
parent b00bd388a9
commit 7be79f4840
8 changed files with 1773 additions and 1 deletions
@@ -17,6 +17,7 @@ const input = {
test('stores validated upload bytes before persisting image metadata', async () => {
const stored = [];
const jobs = [];
const service = createInventoryImageService({
imageStorage: {
async put(value) { stored.push(value); },
@@ -27,6 +28,9 @@ test('stores validated upload bytes before persisting image metadata', async ()
return { id: 'image-1', ...image };
},
},
imageDerivativeJobRepository: {
async create(job) { jobs.push(job); },
},
});
const image = await service.upload(input);
@@ -36,6 +40,11 @@ test('stores validated upload bytes before persisting image metadata', async ()
assert.equal(image.id, 'image-1');
assert.equal(image.processingStatus, 'PENDING');
assert.equal('data' in image, false);
assert.deepEqual(jobs, [{
inventoryImageId: 'image-1',
sourceKey: input.storageKey,
status: 'PENDING',
}]);
});
test('removes stored bytes when metadata persistence fails', async () => {