feat: add portfolio

This commit is contained in:
2026-08-13 22:44:53 +03:00
parent c0a4a93880
commit dfca11c81f
11 changed files with 771 additions and 78 deletions
+19
View File
@@ -121,4 +121,23 @@ describe('Authentication (e2e)', () => {
expect((body as Problem).code).toBe('TBANK_NOT_CONNECTED'),
);
});
it('guards portfolio and reports a missing connection', async () => {
const registration = await request(app.getHttpServer())
.post('/api/v1/auth/register')
.send({ email: 'portfolio@example.com', password: 'a secure password' })
.expect(201);
const accessToken = (registration.body as Authentication).accessToken;
await request(app.getHttpServer())
.get('/api/v1/brokerage-accounts/account/portfolio')
.expect(401);
await request(app.getHttpServer())
.get('/api/v1/brokerage-accounts/account/portfolio')
.set('Authorization', `Bearer ${accessToken}`)
.expect(409)
.expect(({ body }: { body: unknown }) =>
expect((body as Problem).code).toBe('TBANK_NOT_CONNECTED'),
);
});
});