Add AST JSON files for doctor service, tag controller, and SMS log entities

- Created new AST JSON file for the doctor service API documentation, detailing endpoints, parameters, and responses.
- Added AST JSON file for the TagController, including methods and their relationships with imported classes.
- Introduced AST JSON file for the SmsLog entity, outlining its methods and dependencies.
This commit is contained in:
hamed
2026-07-01 14:21:08 +03:30
parent 3120132274
commit a31e8b4314
43 changed files with 3528 additions and 1084 deletions
@@ -10,6 +10,9 @@ use App\Secretary\Entity\DoctorSecretary;
use App\Secretary\Repository\DoctorSecretaryRepository;
use App\Shared\Constant\ErrorCodes;
use App\Shared\Controller\BaseController;
use App\Sms\Entity\SmsLog;
use App\Sms\Service\SmsService;
use App\Sms\Service\SmsTextResolver;
use App\Subscription\Service\SubscriptionService;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
@@ -30,6 +33,9 @@ class SecretaryController extends BaseController
private readonly UserRepository $userRepo,
private readonly UserPasswordHasherInterface $hasher,
private readonly SubscriptionService $subscriptionService,
private readonly SmsService $smsService,
private readonly SmsTextResolver $smsText,
private readonly string $appUrl,
) {}
#[Route('/api/v1/secretary', methods: ['POST'])]
@@ -110,9 +116,29 @@ class SecretaryController extends BaseController
$this->secretaryRepo->save($secretary);
$this->sendWelcomeSms($mobile, $doctor, $ownerClinic);
return $this->success(['data' => $secretary->toArray()], 201);
}
/** پیامک خوش‌آمد به منشی تازه‌تعریف‌شده — متن از template تگ TAG_SECRETARY */
private function sendWelcomeSms(string $mobile, $doctor, $ownerClinic): void
{
$ownerName = $ownerClinic !== null
? ($ownerClinic->getName() ?? 'کلینیک')
: ($doctor->getUser()->getRealName() ?? 'پزشک');
$link = rtrim($this->appUrl, '/') . '/login';
$message = $this->smsText->resolve(SmsLog::TAG_SECRETARY, [
'owner' => $ownerName,
'username' => $mobile,
'link' => $link,
]);
$this->smsService->dispatchAsync($mobile, $message, tag: SmsLog::TAG_SECRETARY);
}
#[Route('/api/v1/secretary/{uuid}', methods: ['GET'])]
public function show(string $uuid, #[CurrentUser] User $currentUser): JsonResponse
{