feat: expose unified exchange activity APIs and exports

This commit is contained in:
Aleksandr Meshchryakov
2026-10-05 17:33:33 +02:00
parent d69ba600d4
commit 3ce9898c0e
30 changed files with 1324 additions and 85 deletions

View File

@@ -26,6 +26,7 @@ const variants = [
['SroMembership', 'sro_membership', 'sro_membership_check', 'sro_membership', 'SroMembership'],
];
const extendedVariants = [
['ExchangeInstrument', 'stock_exchange_activity', 'stock_exchange_activity', 'exchange_instrument', 'ExchangeInstrument'],
['CheckoLeasing', 'leasing', 'checko_leasing', 'leasing_contract', 'CheckoLeasing'],
['CheckoMessage', 'company_messages', 'checko_messages', 'company_message', 'CheckoMessage'],
['CheckoLicense', 'company_licenses', 'checko_licenses', 'company_license', 'CheckoLicense'],
@@ -123,6 +124,12 @@ for (const name of ['OrganizationSourceRecordListResponse', 'SourceRecordMeta',
}
schemas.OrganizationSourceRecordListResponse.properties.errors = { type: 'object', nullable: true, enum: [null] };
// Source refresh validation details are arbitrary structured JSON from the actual
// exception envelope; they must survive generated validators unchanged.
if (schemas.SourceRefreshErrorItem?.properties?.details) {
schemas.SourceRefreshErrorItem.properties.details = { type: 'object', additionalProperties: true };
}
// The two richer source payloads have stable public DTOs in addition to the
// generic DRF JSONField. Keep these schemas beside the canonical converter so
// both backend /openapi.json and the frontend client come from one contract.
@@ -147,7 +154,7 @@ for (const [prefix, group, source, recordType, payloadPrefix] of extendedVariant
schema.properties.status = { type: 'string' };
schema.properties.payload = ref(payloadName);
schema.properties.organization = ref('SroSourceRecordOrganization');
if (['leasing', 'company_messages', 'company_licenses'].includes(group)) {
if (['leasing', 'company_messages', 'company_licenses', 'stock_exchange_activity'].includes(group)) {
schema.properties.organization = ref('FsspSourceRecordOrganization');
}
if (group === 'enforcement_proceedings') {