feat: add public seller directory

This commit is contained in:
2026-09-08 19:36:13 -04:00
parent 206bb18da6
commit a76d777a6b
11 changed files with 152 additions and 2 deletions
@@ -0,0 +1,32 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import { buildApp } from '../../src/app/build-app.js';
test('returns only public seller identity fields', async (testContext) => {
const app = buildApp({
publicSellerService: {
async list() {
return [{
id: 'seller-1',
userId: 'private-user-id',
displayName: 'Catalog Owner',
createdAt: new Date('2026-09-07T00:00:00.000Z'),
updatedAt: new Date('2026-09-07T00:00:00.000Z'),
}];
},
},
});
testContext.after(() => app.close());
const response = await app.inject({ method: 'GET', url: '/api/v1/public/sellers' });
assert.equal(response.statusCode, 200);
assert.deepEqual(response.json().data[0], {
id: 'seller-1',
displayName: 'Catalog Owner',
createdAt: '2026-09-07T00:00:00.000Z',
updatedAt: '2026-09-07T00:00:00.000Z',
});
assert.equal('userId' in response.json().data[0], false);
});