From 3b689a24f67e224cf4ff5e0935a1dea2c2b51c08 Mon Sep 17 00:00:00 2001 From: safavimohadeseh78 Date: Mon, 2 Nov 2026 11:49:47 +0330 Subject: [PATCH] fix(shayegan): build the account number as moin plus customer id Customer 530 with moin 12101 is sent as 12101530 again. Co-authored-by: Cursor --- .cursor/skills/abshode-domain-lookup/learned-notes.md | 3 ++- app/Services/ShayeganSyncService.php | 4 ++-- .../2026_11_02_000001_shayegan_customer_tafsil_code.php | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.cursor/skills/abshode-domain-lookup/learned-notes.md b/.cursor/skills/abshode-domain-lookup/learned-notes.md index abf7dd2..bb18037 100644 --- a/.cursor/skills/abshode-domain-lookup/learned-notes.md +++ b/.cursor/skills/abshode-domain-lookup/learned-notes.md @@ -3,7 +3,8 @@ فرمت هر خط: - YYYY-MM-DD | موضوع | مسیر فایل(ها) | نکتهٔ ۱ خطی -- 2026-11-02 | شماره تفصیلی شایگان | `ShayeganSyncService::registerCustomer` | `AccountNumber` = کد کاربری + معین. مشتری 530 و معین 12101 → `53012101` +- 2026-11-02 | جدول اسناد شایگان | `shayeganTable.vue` + `ShayeganController::table` | مثل پرگار با BaseTable و TableEngine؛ صفحه‌بندی «مورد یافت شد / ردیف» نه page انگلیسی +- 2026-11-02 | شماره تفصیلی شایگان | `ShayeganSyncService::registerCustomer` | `AccountNumber` = معین + کد کاربری. معین 12101 و مشتری 530 → `12101530` - 2026-11-02 | دیباگ تبادل شایگان | `ShayeganClient::request` + `registerCustomer` / health / retry | پاسخ ادمین `client_request` و `server_response` دارد؛ رمز DB و Auth برابر `***` - 2026-11-02 | سه سطح شایگان | `ShayeganSyncService::registerCustomer` + migration `2026_11_02_000001` | کل 121، معین `12101`، تفصیلی = معین+کد کاربری (`12101530`). `1210101` غلط است - 2026-11-01 | پیامک تبدیل | `CopperConvertRequestService::notifyCustomer` | بعد از تأیید یا رد، پیامک جدا به موبایل مشتری؛ خطا پیامک سفارش را برنمی‌گرداند diff --git a/app/Services/ShayeganSyncService.php b/app/Services/ShayeganSyncService.php index a2361b5..72122ff 100644 --- a/app/Services/ShayeganSyncService.php +++ b/app/Services/ShayeganSyncService.php @@ -121,8 +121,8 @@ class ShayeganSyncService $name = 'مشتری ' . $customer->id; } - // تفصیلی = کد کاربری + معین. مثال: مشتری 530 و معین 12101 → 53012101 - $requestedAccountNumber = ((string) (int) $customer->id) . $moinRaw; + // تفصیلی = معین + کد کاربری. مثال: معین 12101 و مشتری 530 → 12101530 + $requestedAccountNumber = $moinRaw . ((string) (int) $customer->id); $guid = (string) Str::uuid(); $put = [[ diff --git a/database/migrations/2026_11_02_000001_shayegan_customer_tafsil_code.php b/database/migrations/2026_11_02_000001_shayegan_customer_tafsil_code.php index 45822d9..e0d2683 100644 --- a/database/migrations/2026_11_02_000001_shayegan_customer_tafsil_code.php +++ b/database/migrations/2026_11_02_000001_shayegan_customer_tafsil_code.php @@ -5,7 +5,7 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; /** - * سه سطح: کل 121، معین 12101، تفصیلی = کد کاربری + معین (53012101). + * سه سطح: کل 121، معین 12101، تفصیلی = معین + کد کاربری (12101530). * مقدار 1210101 اشتباه بود و به 12101 برمی‌گردد. مقدار دیگر دست نمی‌خورد. */ return new class extends Migration @@ -23,7 +23,7 @@ return new class extends Migration $current = trim((string) ($row->value ?? '')); $update = [ - 'description' => 'معین Account/Put. شماره تفصیلی = کد کاربری + این مقدار. مثال: مشتری 530 و 12101 → 53012101.', + 'description' => 'معین Account/Put. شماره تفصیلی = این مقدار + کد کاربری. مثال: 12101 و مشتری 530 → 12101530.', 'updated_at' => now(), ]; if ($current === '' || $current === '1210101') {