diff --git a/docs/api/representation.md b/docs/api/representation.md
index 705fb61d..431e0f1d 100644
--- a/docs/api/representation.md
+++ b/docs/api/representation.md
@@ -268,7 +268,7 @@ Get yearly earnings dashboard for a representation.
### POST `/api/v1/representation/doctor`
-افزودن پزشک توسط نماینده. `representation_id` پزشک بهصورت خودکار روی نمایندهی کاربر جاری ست میشود.
+افزودن پزشک توسط نماینده. `representation_id` پزشک بهصورت خودکار روی نمایندهی کاربر جاری ست میشود. پس از ثبت موفق، یک پیامک خوشآمد (تگ `welcome`) بهصورت async به موبایل پزشک ارسال میشود.
#### Request Body
```json
@@ -296,7 +296,7 @@ Get yearly earnings dashboard for a representation.
### POST `/api/v1/representation/clinic`
-افزودن کلینیک توسط نماینده. `representation_id` کلینیک خودکار روی نمایندهی کاربر جاری ست میشود (مثل createDoctor) تا در لیستهای scoped دیده شود.
+افزودن کلینیک توسط نماینده. `representation_id` کلینیک خودکار روی نمایندهی کاربر جاری ست میشود (مثل createDoctor) تا در لیستهای scoped دیده شود. پس از ثبت موفق، یک پیامک خوشآمد (تگ `welcome`) بهصورت async به موبایل مالک کلینیک ارسال میشود.
#### Request Body
```json
diff --git a/docs/api/sms.md b/docs/api/sms.md
index 61b38ca8..4ad58e69 100644
--- a/docs/api/sms.md
+++ b/docs/api/sms.md
@@ -474,7 +474,9 @@ Updated template with `status: "rejected"`.
متن پیامکهای سیستمی (OTP، پرداخت، دعوت کلینیک، پیشثبتنام، تأیید موبایل) از پنل قابل ویرایش است و بر اساس **تگ** کلیددار میشود. هر متن placeholderهای مجاز خود را دارد (مثل `{code}`، `{doctor}`، `{date}`). هنگام ارسال، `SmsTextResolver` متنِ ویرایششدهی DB را میگیرد و placeholderها را جایگزین میکند؛ اگر رکوردی نبود به متن پیشفرض fallback میشود.
-> تگها: `otp`، `payment`، `clinic_invitation`، `pre_registration`، `notification_mobile`. (پیامک قالبیِ کاربر با تگ `user_template` جداگانه از طریق `POST /api/v1/sms/template` مدیریت میشود.)
+> تگها: `otp`، `payment`، `clinic_invitation`، `pre_registration`، `notification_mobile`، `welcome`. (پیامک قالبیِ کاربر با تگ `user_template` جداگانه از طریق `POST /api/v1/sms/template` مدیریت میشود.)
+>
+> تگ `welcome`: پیامک خوشآمد که هنگام افزودن پزشک/کلینیک توسط نماینده (`POST /api/v1/representation/doctor|clinic`) بهصورت async به موبایل پزشک/مالک ارسال میشود. متن فعلاً ثابت است (نام + `site_name`)، نه از قالب DB.
### GET `/api/v1/admin/sms/messages`
diff --git a/src/Representation/Controller/RepresentationActionController.php b/src/Representation/Controller/RepresentationActionController.php
index bf7cb391..341246ce 100644
--- a/src/Representation/Controller/RepresentationActionController.php
+++ b/src/Representation/Controller/RepresentationActionController.php
@@ -33,6 +33,8 @@ class RepresentationActionController extends BaseController
private readonly RepresentationRepository $representationRepo,
private readonly \App\Settlement\Repository\SettlementRepository $settlementRepo,
private readonly \App\Subscription\Service\SubscriptionService $subscriptionService,
+ private readonly \App\Sms\Service\SmsService $smsService,
+ private readonly \App\Config\Repository\SiteConfigRepository $configRepo,
) {}
#[OA\Get(
@@ -133,6 +135,14 @@ class RepresentationActionController extends BaseController
$this->em->persist($doctor);
$this->em->flush();
+ // پیام خوشآمد به پزشک
+ $siteName = $this->configRepo->get('site_name') ?: 'کلینیکپرو';
+ $this->smsService->dispatchAsync(
+ $mobile,
+ sprintf('دکتر %s عزیز، به %s خوش آمدید. پروفایل شما توسط نماینده ثبت شد.', $name, $siteName),
+ tag: \App\Sms\Entity\SmsLog::TAG_WELCOME,
+ );
+
return $this->success(['uuid' => $doctor->getUuid()], 201);
}
@@ -200,6 +210,14 @@ class RepresentationActionController extends BaseController
$this->em->persist($clinic);
$this->em->flush();
+ // پیام خوشآمد به مالک کلینیک
+ $siteName = $this->configRepo->get('site_name') ?: 'کلینیکپرو';
+ $this->smsService->dispatchAsync(
+ $mobile,
+ sprintf('کلینیک %s به %s خوش آمد. پروفایل کلینیک شما توسط نماینده ثبت شد.', $name, $siteName),
+ tag: \App\Sms\Entity\SmsLog::TAG_WELCOME,
+ );
+
return $this->success([
'uuid' => $clinic->getUuid(),
'name' => $clinic->getName(),
diff --git a/src/Sms/Entity/SmsLog.php b/src/Sms/Entity/SmsLog.php
index a92735ca..487174c9 100644
--- a/src/Sms/Entity/SmsLog.php
+++ b/src/Sms/Entity/SmsLog.php
@@ -17,6 +17,7 @@ class SmsLog
public const TAG_PRE_REGISTRATION = 'pre_registration';
public const TAG_NOTIFICATION_MOBILE = 'notification_mobile';
public const TAG_USER_TEMPLATE = 'user_template';
+ public const TAG_WELCOME = 'welcome';
public const TAGS = [
self::TAG_GLOBAL,
@@ -26,6 +27,7 @@ class SmsLog
self::TAG_PRE_REGISTRATION,
self::TAG_NOTIFICATION_MOBILE,
self::TAG_USER_TEMPLATE,
+ self::TAG_WELCOME,
];
#[ORM\Id]