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

This commit is contained in:
2026-09-10 00:31:00 -04:00
parent d3821e9c76
commit 7c9518923d
8 changed files with 95 additions and 2 deletions
@@ -31,3 +31,24 @@ test('exports seller inventory through the admin DTO boundary', async () => {
updatedAt: '2026-09-10T00:00:00.000Z',
}]);
});
test('exports inventory as escaped CSV rows', async () => {
const service = createAdminExportService({
inventoryItemService: {
async listBySellerId() {
return [{
id: 'item-1',
productId: 'product-1',
conditionId: 'condition-1',
status: 'ACTIVE',
notes: 'Front, "clean"\nback',
}];
},
},
});
assert.equal(await service.inventoryCsv({ sellerId: 'seller-1' }), [
'id,productId,conditionId,status,notes,createdAt,updatedAt',
'"item-1","product-1","condition-1","ACTIVE","Front, ""clean""\nback","",""',
].join('\r\n'));
});