From 0e5f47c5e98ee3dcd94995fbf15fcae2f2b224c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Mon, 25 May 2026 17:18:16 +0300 Subject: [PATCH] feat(db): seed suppliers.code='direct' for DIRECT platform billing LedgerService::resolveSupplierId will look up suppliers WHERE code='direct' for DIRECT-platform supplier_projects (Phase 3). cost_rub matches B1 (same supplier company, different lead-routing channel). Spec: docs/superpowers/specs/2026-05-25-supplier-webhook-reliability-design.md Co-Authored-By: Claude Opus 4.7 --- ...2026_05_25_120100_seed_direct_supplier.php | 41 +++++++++++++++++++ docs/observer/STATUS.md | 2 +- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 app/database/migrations/2026_05_25_120100_seed_direct_supplier.php diff --git a/app/database/migrations/2026_05_25_120100_seed_direct_supplier.php b/app/database/migrations/2026_05_25_120100_seed_direct_supplier.php new file mode 100644 index 00000000..ea4d4850 --- /dev/null +++ b/app/database/migrations/2026_05_25_120100_seed_direct_supplier.php @@ -0,0 +1,41 @@ +where('code', 'b1')->first(); + if ($b1 === null) { + // Если B1 нет — significant prod drift, не должно произойти. + // Создаём с дефолтным cost_rub=1.00 (как на prod 25.05.2026). + $costRub = '1.00'; + } else { + $costRub = (string) $b1->cost_rub; + } + + DB::table('suppliers')->updateOrInsert( + ['code' => 'direct'], + [ + 'name' => 'DIRECT — Прямые проекты', + 'cost_rub' => $costRub, + ] + ); + } + + public function down(): void + { + DB::table('suppliers')->where('code', 'direct')->delete(); + } +}; diff --git a/docs/observer/STATUS.md b/docs/observer/STATUS.md index 18f5d25b..eaa8b644 100644 --- a/docs/observer/STATUS.md +++ b/docs/observer/STATUS.md @@ -1,6 +1,6 @@ # Brain Status (auto-generated) -Last updated: 2026-05-25T14:54:22.281Z +Last updated: 2026-05-25T14:58:58.369Z | Контролёр | Состояние | Детали | |---|---|---|