chore(ci+logs): eslint в CI, npm audit, logger с уровнями, retention error_logs

Шаги 1.6 и 1.7 плана production-готовности:
- eslint flat-config (баг-ловушки, легаси warn), lint блокирующий в pr-check
- npm audit --audit-level=high в CI (отчёт)
- фикс реального бага: условный useRef в TaskTitleInline
- server/utils/logger.ts (LOG_LEVEL/LOG_FORMAT) в 5 горячих местах
- error_logs retention 30 дней (worker), redactSensitive в captureErrorLog
- 0 errors lint, vitest 96/96
This commit is contained in:
2026-09-08 00:11:38 +03:00
parent 6eaca79cc6
commit abd5d4b65f
14 changed files with 1579 additions and 19 deletions

View File

@@ -2,8 +2,10 @@ import { and, desc, eq, sql } from "drizzle-orm";
import { db } from "../db";
import { billingPayments, billingTransactions, organizationBilling, organizations } from "@shared/schema";
import type { BillingPayment } from "@shared/schema";
import { logger } from "../utils/logger";
// Сервис платежей биллинга: создание, выборки и зачисление успешных платежей.
const log = logger("billing");
export interface CreateBillingPaymentParams {
organizationId: number;
@@ -99,6 +101,8 @@ export async function applySucceededPayment(
.from(billingPayments)
.where(eq(billingPayments.id, paymentId))
.limit(1);
// Повторный webhook/гонка: платёж уже не в pending — зачисление пропускаем
log.warn(`Повторное зачисление платежа пропущено (paymentId=${paymentId}, status=${current?.status ?? 'not found'})`);
return { applied: false, payment: current ?? null };
}