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 <cursoragent@cursor.com>
This commit is contained in:
2026-11-02 11:49:47 +03:30
co-authored by Cursor
parent 77a448e4e1
commit 3b689a24f6
3 changed files with 6 additions and 5 deletions
@@ -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` | بعد از تأیید یا رد، پیامک جدا به موبایل مشتری؛ خطا پیامک سفارش را برنمی‌گرداند
+2 -2
View File
@@ -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 = [[
@@ -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') {