feat: update user roles and passwords in QA driver, enhance documentation with error codes, and improve trial activation error handling

This commit is contained in:
hamed
2026-07-19 15:19:03 +03:30
parent 3e841b5e57
commit 7761c37a3e
10 changed files with 326 additions and 109 deletions
@@ -219,6 +219,14 @@ class ClinicServiceController extends BaseController
{
[$entityType, $entityId] = $this->resolveEntity($user);
// A user with neither a doctor profile nor a clinic (admin, secretary,
// representation, plain patient) resolves to EntityContext::unknown(),
// whose id is null — findByEntity() declares int and fataled with a 500.
// Same condition, same answer as assertServicesGate(): forbidden.
if ($entityId === null) {
throw new AppException(ErrorCodes::ERR_FORBIDDEN_001, null, 403);
}
return $this->success($this->serializeItems(
$this->itemRepo->findByEntity($entityType, $entityId)
));