refactor: replace ignored numeric literals with constants
Backend security / security (push) Successful in 8s
Backend verify / verify (push) Failing after 2m17s
Conventional commits / commits (pull_request) Successful in 31s
Backend security / security (pull_request) Successful in 8s
Backend verify / verify (pull_request) Failing after 1m56s

This commit is contained in:
2026-09-28 11:24:59 +03:00
parent 9b3558f96c
commit 9cc9fbdcff
60 changed files with 510 additions and 283 deletions
@@ -5,6 +5,8 @@ import type { Prisma } from '../../../../../generated/prisma/client';
import { PrismaService } from '../../../../prisma/prisma.service';
const FIRST_BATCH_OFFSET = 0;
export type ForecastSourceVersion = {
dataRevision: number;
fetchedAt: Date;
@@ -82,7 +84,7 @@ export class ForecastRepository {
// Four identity parameters per source: stay below SQLite's parameter limit.
const sources: ForecastSourceVersion[] = [];
for (
let offset = 0;
let offset = FIRST_BATCH_OFFSET;
offset < input.sources.length;
offset += forecastSourceReadBatchSize
) {
@@ -10,6 +10,8 @@ import {
} from '../../../../integrations/tbank/tbank.api';
import { PrismaService } from '../../../../prisma/prisma.service';
const EXPECTED_UPDATED_ACCOUNTS = 1;
type PortfolioAttempt = {
attemptId: string;
id: string;
@@ -152,7 +154,7 @@ export class PortfolioRepository {
},
data: { state: 'failed', errorCode: 'TBANK_UNAVAILABLE' },
});
return result.count === 1;
return result.count === EXPECTED_UPDATED_ACCOUNTS;
}
}