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
@@ -71,9 +71,12 @@ class SubscriptionService
throw new AppException(ErrorCodes::ERR_NOT_FOUND_001, null, 500);
}
// Deactivating the trial period is a normal admin configuration, not a
// broken install — surface it as "trial disabled", the same 422 the
// trial_enabled flag produces, rather than a 500.
$trialPeriod = $this->periodRepo->findTrialPeriodForPlan($basicPlan);
if ($trialPeriod === null) {
throw new AppException(ErrorCodes::ERR_NOT_FOUND_001, null, 500);
throw new AppException(ErrorCodes::ERR_TRIAL_DISABLED, null, 422);
}
$expiresAt = $this->calculateExpiresAt(null, $trialPeriod->getDurationMonths());