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:
@@ -4,9 +4,10 @@ namespace App\Appointment\Entity;
|
||||
|
||||
use App\Doctor\Entity\Doctor;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Appointment\Repository\WeeklyScheduleRepository;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\Entity(repositoryClass: WeeklyScheduleRepository::class)]
|
||||
#[ORM\Table(name: 'weekly_schedules')]
|
||||
#[ORM\UniqueConstraint(name: 'idx_weekly_schedules_doctor', columns: ['doctor_id'])]
|
||||
class WeeklySchedule
|
||||
|
||||
Reference in New Issue
Block a user