feat(migrations): add national_code_verified flag to users and normalize bank_account representation

- Added a new column `national_code_verified` to the `users` table.
- Normalized the `bank_account` field in the `representations` table from a single object to an array of IBANs with a default `verified` status of false.

feat(ApiIrService): implement identity verification client for api.ir

- Created `ApiIrService` to handle identity verification via api.ir.
- Implemented methods for matching national code with mobile and IBAN with national code and birth date.
- Added error handling and logging for external API requests.
This commit is contained in:
hamed
2026-06-25 19:38:47 +03:30
parent 9b608aaeac
commit c2c6ae4d02
515 changed files with 194899 additions and 55 deletions
+14
View File
@@ -75,6 +75,14 @@ class ErrorCodes
// Rating
public const ERR_RATING_NOT_ELIGIBLE = 'ERR_RATING_NOT_ELIGIBLE';
// External Inquiry (s.api.ir)
public const ERR_EXTERNAL_001 = 'ERR_EXTERNAL_001';
public const ERR_EXTERNAL_NOT_CONFIGURED = 'ERR_EXTERNAL_002';
public const ERR_NATIONAL_CODE_MISMATCH = 'ERR_IDENTITY_001';
public const ERR_IBAN_MISMATCH = 'ERR_IDENTITY_002';
public const ERR_IBAN_LIMIT = 'ERR_IDENTITY_003';
public const ERR_NATIONAL_CODE_UNVERIFIED = 'ERR_IDENTITY_004';
public static function message(string $code): string
{
return match ($code) {
@@ -113,6 +121,12 @@ class ErrorCodes
self::ERR_SESSION_NOT_FOUND => 'مراجعه یافت نشد',
self::ERR_SMS_WALLET_INSUFFICIENT => 'موجودی کیف پیامک کافی نیست',
self::ERR_RATING_NOT_ELIGIBLE => 'برای ثبت نظر یا امتیاز باید در یک ماه گذشته نوبت تایید‌شده نزد این پزشک داشته باشید',
self::ERR_EXTERNAL_001 => 'خطا در استعلام. لطفاً بعداً تلاش کنید',
self::ERR_EXTERNAL_NOT_CONFIGURED => 'سرویس استعلام پیکربندی نشده است',
self::ERR_NATIONAL_CODE_MISMATCH => 'کد ملی متعلق به این شماره موبایل نیست',
self::ERR_IBAN_MISMATCH => 'شماره شبا متعلق به شما نیست',
self::ERR_IBAN_LIMIT => 'حداکثر دو شماره شبا می‌توانید ثبت کنید',
self::ERR_NATIONAL_CODE_UNVERIFIED => 'ابتدا کد ملی خود را تأیید کنید',
default => 'خطای ناشناخته',
};
}