fix(orm): declare repositoryClass on all entities with a custom repository

On prod (opcache.preload + prod container), getRepository(Entity::class)
returned Doctrine's default repository instead of the custom one when the
entity's #[ORM\Entity] had no repositoryClass — so custom finders like
DoctorSecretaryRepository::findAllActiveBySecretary threw BadMethodCallException,
making /oauth/userinfo return 500 after login. Declare repositoryClass explicitly
on all 25 affected entities.

Also add app:create-admin command (create/promote a ROLE_ADMIN user by mobile).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
hamed
2026-06-28 16:19:07 +03:30
co-authored by Claude Opus 4.8
parent 5bcc97ceb6
commit 05fde81320
25 changed files with 50 additions and 25 deletions
+2 -1
View File
@@ -4,11 +4,12 @@ namespace App\Sms\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Sms\Repository\SmsMessageTemplateRepository;
/**
* متن ویرایش‌پذیرِ پیامک‌های سیستمی، کلیددار با تگ (SmsLog::TAG_*).
* body شامل placeholderهای {key} است که هنگام ارسال جایگزین می‌شوند.
*/
#[ORM\Entity]
#[ORM\Entity(repositoryClass: SmsMessageTemplateRepository::class)]
#[ORM\Table(name: 'sms_message_templates')]
class SmsMessageTemplate
{