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:
@@ -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 };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user