feat: add admin inventory JSON export
Quality / test (push) Canceled after 0s

This commit is contained in:
2026-09-10 00:16:04 -04:00
parent 099ec2fe72
commit d3821e9c76
10 changed files with 176 additions and 15 deletions
@@ -0,0 +1,33 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { createAdminExportService } from '../../src/modules/exports/services/admin-export-service.js';
test('exports seller inventory through the admin DTO boundary', async () => {
const service = createAdminExportService({
inventoryItemService: {
async listBySellerId(sellerId) {
assert.equal(sellerId, 'seller-1');
return [{
id: 'item-1',
productId: 'product-1',
conditionId: 'condition-1',
status: 'ACTIVE',
notes: 'Private note',
createdAt: new Date('2026-09-10T00:00:00.000Z'),
updatedAt: new Date('2026-09-10T00:00:00.000Z'),
}];
},
},
});
assert.deepEqual(await service.inventoryJson({ sellerId: 'seller-1' }), [{
id: 'item-1',
productId: 'product-1',
conditionId: 'condition-1',
status: 'ACTIVE',
notes: 'Private note',
createdAt: '2026-09-10T00:00:00.000Z',
updatedAt: '2026-09-10T00:00:00.000Z',
}]);
});