feat(profile): enhance national_code uniqueness error message with masked mobile number

This commit is contained in:
hamed
2026-06-24 12:16:16 +03:30
parent 650e36bce2
commit 8b419d0272
5 changed files with 21 additions and 19 deletions
@@ -222,9 +222,10 @@ class UserProfileController extends BaseController
$existing = $this->repository->findOneByNationalCode($code);
if ($existing !== null && ($current === null || $existing->getUuid() !== $current->getUuid())) {
$masked = InputValidator::maskMobile($existing->getUser()->getMobileNumber());
return $this->error(
ErrorCodes::ERR_PROFILE_NATIONAL_CODE_TAKEN,
'این کد ملی قبلاً برای کاربر دیگری ثبت شده است',
"این کد ملی قبلاً با شماره {$masked} ثبت شده است",
409,
'national_code'
);