fix: implement backend testing amendments and atomic source publication
Some checks failed
Mostovik Backend CI/CD / Tests and lint (push) Successful in 3m16s
Mostovik Backend CI/CD / Deploy dev (push) Has been cancelled
Mostovik Backend CI/CD / Deploy and verify internal main (push) Has been cancelled
Mostovik Backend CI/CD / Build linux/amd64 release images (push) Has been cancelled

This commit is contained in:
Aleksandr Meshchryakov
2026-10-12 09:47:28 +02:00
parent 2eeb237a47
commit 9b3da5b505
46 changed files with 2918 additions and 335 deletions

View File

@@ -172,6 +172,19 @@ for (const [prefix, group, source, recordType, payloadPrefix] of extendedVariant
}
}
// Swagger 2 produces is operation-wide; binary success and JSON errors differ.
for (const endpoint of ['export', 'export-download']) {
const operation = document.paths[`/api/v2/organization-source-records/${endpoint}/`]?.post;
if (!operation) throw new Error(`Source export endpoint missing: ${endpoint}`);
operation.responses['200'].content = {
'application/zip': { schema: { type: 'string', format: 'binary' } },
};
for (const [code, response] of Object.entries(operation.responses)) {
if (Number(code) < 400 || !response.content) continue;
response.content = { 'application/json': Object.values(response.content)[0] };
}
}
const attachmentPath = document.paths['/api/v2/organization-source-records/{uid}/documents/{document_id}/attachment/'];
if (!attachmentPath?.get) throw new Error('Integrated attachment endpoint missing');
attachmentPath.get.responses['200'] = {

View File

@@ -1,6 +1,9 @@
import { readFile } from 'node:fs/promises';
import { isDeepStrictEqual } from 'node:util';
import {
V2OrganizationSourceRecordsFilterOptions200Response,
V2OrganizationSourceRecordsFilterOptions400Response,
ApiV1JobsRead200Response,
ApiV2OrganizationSourceRecordsRead200Response,
ApiV2OrganizationSourceRecordsRead400Response,
ApiV2OrganizationSourceRecordsRead404Response,
@@ -14,6 +17,9 @@ import {
} from './generated-zod/contract.ts';
const schemas = new Map([
['options:200', V2OrganizationSourceRecordsFilterOptions200Response],
['options:400', V2OrganizationSourceRecordsFilterOptions400Response],
['job:200', ApiV1JobsRead200Response],
['refresh:202', ApiV1SourcesRefreshCreate202Response],
['refresh:400', ApiV1SourcesRefreshCreate400Response],
['refresh:403', ApiV1SourcesRefreshCreate403Response],
@@ -26,6 +32,7 @@ const schemas = new Map([
['detail:404', ApiV2OrganizationSourceRecordsRead404Response],
]);
const requiredCases = new Set([
'message-type-options', 'message-type-options-invalid', 'job-failed', 'job-success', 'job-skipped',
'mixed-list', 'empty-list', 'invalid-list', 'invalid-detail', 'missing-detail',
'stock_exchange_activity-spb-detail', 'missing-refresh',
...['fssp_enforcement_proceedings', 'checko_leasing', 'checko_messages', 'checko_licenses', 'stock_exchange_activity']