diff --git a/.cursor/skills/abshode-domain-lookup/learned-notes.md b/.cursor/skills/abshode-domain-lookup/learned-notes.md index 1a3ad60..abf7dd2 100644 --- a/.cursor/skills/abshode-domain-lookup/learned-notes.md +++ b/.cursor/skills/abshode-domain-lookup/learned-notes.md @@ -3,6 +3,7 @@ فرمت هر خط: - YYYY-MM-DD | موضوع | مسیر فایل(ها) | نکتهٔ ۱ خطی +- 2026-11-02 | شماره تفصیلی شایگان | `ShayeganSyncService::registerCustomer` | `AccountNumber` = کد کاربری + معین. مشتری 530 و معین 12101 → `53012101` - 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 8c5fc59..a2361b5 100644 --- a/app/Services/ShayeganSyncService.php +++ b/app/Services/ShayeganSyncService.php @@ -121,19 +121,19 @@ class ShayeganSyncService $name = 'مشتری ' . $customer->id; } - // کل ۱۲۱ داخل معین است. تفصیلی = معین + کد کاربری. مثال: 12101 و مشتری 530 → 12101530 - $requestedAccountNumber = $moinRaw . ((string) (int) $customer->id); + // تفصیلی = کد کاربری + معین. مثال: مشتری 530 و معین 12101 → 53012101 + $requestedAccountNumber = ((string) (int) $customer->id) . $moinRaw; $guid = (string) Str::uuid(); $put = [[ 'MoinNumber' => $moinNumber, 'AccountNumber' => $requestedAccountNumber, - 'AccountTypeId' => null, + 'AccountTypeId' => 1, 'AccountName' => mb_substr($name, 0, 200), 'Mobile' => trim((string) ($customer->mobile ?? '')) ?: null, 'mellicode' => trim((string) ($customer->n_code ?? '')) ?: null, 'GuId' => $guid, - 'UpdateKind' => 3, + 'UpdateKind' => 0, ]]; $result = $this->client->put('Account/Put', $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 e91e34d..45822d9 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، تفصیلی = معین + کد کاربری (12101530). + * سه سطح: کل 121، معین 12101، تفصیلی = کد کاربری + معین (53012101). * مقدار 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. کل ۱۲۱ داخل همین کد است. شماره تفصیلی = این مقدار + کد کاربری. مثال: 12101 و مشتری 530 → 12101530.', + 'description' => 'معین Account/Put. شماره تفصیلی = کد کاربری + این مقدار. مثال: مشتری 530 و 12101 → 53012101.', 'updated_at' => now(), ]; if ($current === '' || $current === '1210101') {