Add SmsServiceLookupOnlyTest AST and migration for template_code in sms_logs

- Created a new AST JSON file for SmsServiceLookupOnlyTest.php, detailing nodes, edges, and raw calls for better code analysis.
- Added a new migration (Version20260707202553) to alter the sms_logs table by adding a nullable template_code column.
This commit is contained in:
hamed
2026-07-08 00:03:33 +03:30
parent 2982eaa7e3
commit a2c809b7de
21 changed files with 1092 additions and 840 deletions
+2 -1
View File
@@ -1466,7 +1466,7 @@ class AdminApiController extends BaseController
$tag = trim((string) $request->query->get('tag', ''));
$qb = $this->em->createQueryBuilder()
->select('s.uuid, s.mobile, s.message, s.provider, s.success, s.tag, s.createdAt')
->select('s.uuid, s.mobile, s.message, s.provider, s.success, s.tag, s.templateCode, s.createdAt')
->from(SmsLog::class, 's')
->orderBy('s.createdAt', 'DESC');
@@ -1486,6 +1486,7 @@ class AdminApiController extends BaseController
'status' => $l['success'] ? 'sent' : 'failed',
'provider' => $l['provider'],
'tag' => $l['tag'],
'template' => $l['templateCode'],
'sent_at' => date('c', (int) $l['createdAt']),
'created_at' => date('c', (int) $l['createdAt']),
], $rows);
+7
View File
@@ -58,6 +58,10 @@ class SmsLog
#[ORM\Column(name: 'template_uuid', type: 'string', length: 36, nullable: true)]
private ?string $templateUuid = null;
// نام تمپلت VerifyLookup کاوه‌نگار که این پیامک با آن ارسال شده (مثلاً clinicpro-otp)؛ null اگر ارسال نشده.
#[ORM\Column(name: 'template_code', type: 'string', length: 100, nullable: true)]
private ?string $templateCode = null;
#[ORM\Column(type: 'string', length: 30, options: ['default' => self::TAG_GLOBAL])]
private string $tag = self::TAG_GLOBAL;
@@ -76,6 +80,8 @@ class SmsLog
}
public function setTemplateUuid(?string $v): self { $this->templateUuid = $v; return $this; }
public function setTemplateCode(?string $v): self { $this->templateCode = $v; return $this; }
public function getTemplateCode(): ?string { return $this->templateCode; }
public function getTag(): string { return $this->tag; }
public function setTag(string $v): self { $this->tag = $v; return $this; }
@@ -88,6 +94,7 @@ class SmsLog
'provider' => $this->provider,
'success' => $this->success,
'template_uuid' => $this->templateUuid,
'template_code' => $this->templateCode,
'tag' => $this->tag,
'created_at' => $this->createdAt,
];
+1
View File
@@ -97,6 +97,7 @@ class SmsService
$log = new SmsLog($msg->mobile, $msg->message, $provider->getName(), $success, $msg->tag);
if ($msg->templateUuid) $log->setTemplateUuid($msg->templateUuid);
if ($msg->templateCode) $log->setTemplateCode($msg->templateCode);
$this->logRepo->save($log);
return $success;