Дмитрий
3b142f9375
fix(billing-security): хардненинг webhook ЮKassa + чистка admin-auth комментариев
...
Accessibility (Pa11y live) / a11y (push) Has been cancelled
SAST — Semgrep / Semgrep SAST scan (push) Has been cancelled
Webhook (PaymentWebhookController): строгий матч gatewayPaymentId===paymentId
(confused-deputy), проверка валюты RUB (WebhookVerifyResult.currency), IP-allowlist
services.yookassa.webhook_ip_allowlist (fail-open при пустом). web.php: убраны
устаревшие «MVP без auth» комментарии — saas-admin зона fail-closed (nginx-basic
+ M-1 REMOTE_USER allowlist, проверено на проде). +3 теста, 11/11 зелёные.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
2026-06-23 04:15:48 +03:00
Дмитрий
a9714c8c5d
feat(billing): развилка topup по флагу billing_yookassa_enabled — шлюз vs заглушка
...
Флаг ВКЛ → создание платежа через OnlineTopupService + confirmation_url;
ВЫКЛ → прежнее мгновенное зачисление. Биндинг PaymentGatewayDriver в
AppServiceProvider. Также мелкая гигиена SystemSettingsHelperTest
(DatabaseTransactions для отката).
2026-06-22 21:36:30 +03:00
Дмитрий
3fdfa4a2ee
feat(billing): YooKassaDriver — создание платежа и server-to-server сверка
2026-06-22 20:36:17 +03:00
Дмитрий
5c0e3760f6
feat(billing): интерфейс PaymentGatewayDriver + DTO результата платежа и сверки
2026-06-22 20:33:22 +03:00
Дмитрий
fa05fc38fb
feat(billing): флаги billing_yookassa_enabled/billing_receipt_enabled + хелпер SystemSettings
2026-06-22 20:32:18 +03:00
Дмитрий
6aeeff24d3
feat(billing): Eloquent-модели legal_entities/payment_gateways/saas_transactions
2026-06-22 20:26:47 +03:00
Дмитрий
7332387c19
feat(billing-v2-c): BalancePreflightService — pure-проверка платёжеспособности
...
Task 1.2 Спека C. evaluate(balanceRub, deliveredInMonth, requiredLeads, tiers) →
PreflightResult{passes, requiredLeads, capacityLeads, deficitLeads}. Сравнение в
лидах через BalanceToLeadsConverter::convert (7 ступеней + месячный объём).
3 unit-теста GREEN. Pint passed.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-26 20:39:13 +03:00
Дмитрий
1e0c0ab90a
fix(billing): Plan 4 Task 2 code-review fixes (2 Important + 1 Minor)
...
- PricingTierResolver::resolveForCount — InvalidArgumentException на
$leadOrdinal < 1 (closes I-1: defensive contract validation).
- PricingTierRepository::activeAt — explicit @var Collection<int,
PricingTier> annotation для type narrowing (closes I-2; firstOrFail
отвергнут — Stan ругается на Eloquent\Model return-type).
- PricingTierResolverTest — +1 unit test (8/8 PASS): throws на 0/-1.
- PricingTierRepositoryTest — +1 integration test (5/5 PASS): excludes
inactive tiers (closes M-2 coverage gap).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-11 09:17:13 +03:00
Дмитрий
e07d025efd
feat(billing): Plan 4 Task 2 — PricingTierResolver + Repository (pure resolver + DB-обёртка)
...
- PricingTierResolver: pure-function, ищет tier для N-го лида (1-based).
100→tier1, 101→tier2, 6000→tier6 (cumul.sum 1-6), 6001+→tier7 (NULL=unlimited).
RuntimeException на пустой коллекции.
- PricingTierRepository::activeAt(Carbon): DB-обёртка, MAX(effective_from) <= $at
per tier_no (учёт «новая сетка перекрывает старую»), is_active=true.
- 7 unit-тестов (in-memory, без БД) + 4 integration-теста (DatabaseTransactions
с baseline-cleanup для seed-7-tiers из PricingTierSeeder Task 1).
- phpstan-baseline.neon: +3 entry (Pest TestCall::\$resolver/\$tiers/\$repo) —
следуем project-convention (см. SupplierResolverTest идентичные baseline-entries).
Spec: docs/superpowers/specs/2026-05-11-plan4-billing-csv-admin-design.md §3.1
Plan: docs/superpowers/plans/2026-05-11-plan4-billing-csv-admin.md Task 2
Tests: 633 passed / 3 skipped / 0 failed (+11 new); pint clean; stan 0 errors above baseline.
2026-05-11 09:05:22 +03:00