Backend security / security (push) Successful in 8s
Backend verify / verify (push) Successful in 11m9s
Conventional commits / commits (pull_request) Successful in 28s
Backend security / security (pull_request) Successful in 7s
Backend verify / verify (pull_request) Successful in 10m38s
Resolve A01-A10 and C01-C07 from the backend audit. Preserve auth failures, forced candle reconciliation and forecast freshness. Validate MOEX responses and nested HTTP errors; remove unused legacy paths. Verified: 209 unit tests, 262 SQLite e2e tests on Linux, OpenAPI and durability. Record the remaining macOS native SQLite abort in the audit.
86 lines
2.4 KiB
JavaScript
86 lines
2.4 KiB
JavaScript
// This process is deliberately killed by the SQLite suite at durable boundaries.
|
|
require('../e2e-env.cjs');
|
|
const { ConfigService } = require('@nestjs/config');
|
|
const { PrismaService } = require('../../dist/src/prisma/prisma.service');
|
|
const {
|
|
TbankTokenService,
|
|
} = require('../../dist/src/integrations/tbank/tbank-token.service');
|
|
const {
|
|
TbankAccessService,
|
|
} = require('../../dist/src/integrations/tbank/tbank-access.service');
|
|
const {
|
|
BrokerageOperationsRepository,
|
|
} = require('../../dist/src/modules/investments/operations/infrastructure/brokerage-operations.repository');
|
|
const {
|
|
BrokerageOperationsSyncService,
|
|
} = require('../../dist/src/modules/investments/operations/application/brokerage-operations-sync.service');
|
|
const mode = process.argv[2];
|
|
const prisma = new PrismaService(new ConfigService(process.env));
|
|
const repository = new BrokerageOperationsRepository(prisma);
|
|
const tokens = new TbankTokenService(new ConfigService(process.env));
|
|
const stopped = new Promise(() => {});
|
|
let handle;
|
|
let pages = 0;
|
|
const checkpoint = () => process.send({ checkpoint: mode, handle });
|
|
const upstream = {
|
|
async getOperationsByCursor() {
|
|
pages += 1;
|
|
if (mode === 'between-pages' && pages === 2) {
|
|
checkpoint();
|
|
return stopped;
|
|
}
|
|
return {
|
|
hasNext: mode === 'between-pages',
|
|
nextCursor: mode === 'between-pages' ? 'discard-after-restart' : '',
|
|
items: [
|
|
{
|
|
id: 'crash-row',
|
|
date: { seconds: '1768000000' },
|
|
payment: { units: '10', nano: 1, currency: 'rub' },
|
|
},
|
|
],
|
|
};
|
|
},
|
|
};
|
|
const publish = repository.publish.bind(repository);
|
|
repository.publish = async (...args) => {
|
|
if (mode === 'before-publish') {
|
|
checkpoint();
|
|
return stopped;
|
|
}
|
|
const result = await publish(...args);
|
|
if (mode === 'after-publish') {
|
|
checkpoint();
|
|
return stopped;
|
|
}
|
|
return result;
|
|
};
|
|
const service = new BrokerageOperationsSyncService(
|
|
repository,
|
|
new TbankAccessService(prisma, tokens),
|
|
upstream,
|
|
{
|
|
event() {
|
|
process.send({ error: 'Unexpected worker persistence failure' });
|
|
},
|
|
},
|
|
);
|
|
process.on('message', () => {});
|
|
(async () => {
|
|
await prisma.$connect();
|
|
handle = await service.request(
|
|
'owner',
|
|
[
|
|
{
|
|
accountId: 'account',
|
|
from: new Date('2026-01-01Z'),
|
|
to: new Date('2026-02-01Z'),
|
|
},
|
|
],
|
|
true,
|
|
);
|
|
})().catch((error) => {
|
|
process.send({ error: error.message });
|
|
process.exitCode = 1;
|
|
});
|