refactor: retire legacy tbank-sync status and sync=observe (WealthLedger/backend#196)
Backend verify / commits (pull_request) Successful in 1m25s
Backend verify / security (pull_request) Successful in 1m8s
Backend verify / verify (pull_request) Successful in 6m20s

This commit is contained in:
2026-11-05 22:22:48 +03:00
parent 83b515a453
commit d1c5f575cf
36 changed files with 182 additions and 832 deletions
+14 -25
View File
@@ -28,31 +28,11 @@ describe('OpenAPI contract (integration)', () => {
const document = createOpenApiDocument(app);
const schemas = document.components?.schemas;
expect(document.paths['/api/v1/tbank-sync']).toBeUndefined();
expect(schemas?.TbankSyncStatusDto).toBeDefined();
for (const [model, screen] of [
['IncomeInvestmentScreenDto', 'income'],
['EventsInvestmentScreenDto', 'events'],
]) {
// eslint-disable-next-line security/detect-object-injection -- Keys come from local test fixtures or numeric iteration, not external input.
const schema = schemas?.[model];
assert(schema && !('$ref' in schema));
expect(schema.required).toContain('screen');
expect(schema.required).toContain('accountId');
expect(schema).toMatchObject({
properties: {
screen: { enum: [screen] },
from: { type: 'string', format: 'date' },
to: { type: 'string', format: 'date' },
},
});
}
expect(schemas?.TimestampInvestmentScreenDto).toMatchObject({
properties: {
from: { type: 'string', format: 'date-time' },
to: { type: 'string', format: 'date-time' },
},
});
expect(schemas).not.toHaveProperty('InvestmentScreenDto');
expect(document.paths['/api/v1/tbank-sync/{id}']).toBeUndefined();
expect(schemas?.TbankSyncStatusDto).toBeUndefined();
expect(schemas).not.toHaveProperty('IncomeInvestmentScreenDto');
expect(schemas).not.toHaveProperty('EventsInvestmentScreenDto');
expect(schemas).not.toHaveProperty('TimestampInvestmentScreenDto');
for (const scope of ['all', '{accountId}']) {
for (const [resource, format] of [
['income-analytics', 'date'],
@@ -77,6 +57,15 @@ describe('OpenAPI contract (integration)', () => {
}
});
it('does not advertise the retired observe query on investment reads', () => {
const document = createOpenApiDocument(app);
for (const [path, resource] of Object.entries(document.paths)) {
if (!path.startsWith('/api/v1/')) continue;
const parameters = resource.get?.parameters ?? [];
expect(parameters.some((parameter) => 'name' in parameter && parameter.name === 'sync')).toBe(false);
}
});
it('exposes only the selected income dependency role and no comparison data', () => {
const schemas = createOpenApiDocument(app).components?.schemas;
expect(schemas?.IncomeAnalyticsResourceDto).toMatchObject({