feat: resolve refresh providers from mappings
Quality / test (push) Canceled after 0s

This commit is contained in:
2026-09-09 13:01:16 -04:00
parent 4d3af37cd7
commit 4c041e069d
7 changed files with 55 additions and 4 deletions
@@ -55,9 +55,11 @@ test('enqueues a seller-scoped pricing refresh and reads its status', async () =
async create(input) { return { id: 'job-1', status: 'PENDING', ...input }; },
async findByIdForSeller(id, sellerId) { return { id, sellerId, status: 'COMPLETED' }; },
},
providerMappingRepository: { async findActiveForSeller() { return { providerId: 'mapped-provider' }; } },
});
const job = await service.enqueueRefresh({ sellerId: 'seller-1', inventoryItemId: 'item-1', providerId: 'provider-1', productId: 'product-1', conditionId: 'condition-1' });
assert.equal(job.status, 'PENDING');
assert.equal(job.providerId, 'mapped-provider');
assert.equal((await service.getJob({ sellerId: 'seller-1', jobId: job.id })).status, 'COMPLETED');
});