From 7ffd79299facfdf2deb8dd819ea98f080bb1588a 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 +++++++++++++++++++ 1 file changed, 41 insertions(+) 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(); + } +};