feat: add bylaw management features including documents, legal authorities, subject categories, and nodes

This commit is contained in:
2026-06-26 13:49:50 +03:30
parent 2e26bd229b
commit 9cf6957675
113 changed files with 1112 additions and 358 deletions

View File

@@ -31,37 +31,41 @@ class AddSubscriptionDays extends Command
if ($days <= 0) {
$this->error('Days must be a positive integer.');
return self::FAILURE;
}
if ($onlyWithoutSubscription && !$allUsers) {
if ($onlyWithoutSubscription && ! $allUsers) {
$this->error('The --only-without-subscription option can only be used with --all-users.');
return self::FAILURE;
}
if ($allUsers) {
$planId = $this->option('plan-id');
if (!$planId) {
if (! $planId) {
$this->error('When using --all-users you must provide --plan-id for users without a subscription.');
return self::FAILURE;
}
$plan = SubscribePlan::find($planId);
if (!$plan) {
if (! $plan) {
$this->error('Subscribe plan not found for the given --plan-id.');
return self::FAILURE;
}
}
if ($allUsers) {
if ($onlyWithoutSubscription) {
$this->info("Granting {$days} day(s) only to users without a subscription." . ($dryRun ? ' (dry-run)' : ''));
$this->info("Granting {$days} day(s) only to users without a subscription.".($dryRun ? ' (dry-run)' : ''));
} else {
$this->info("Granting {$days} day(s) to every user." . ($dryRun ? ' (dry-run)' : ''));
$this->info("Granting {$days} day(s) to every user.".($dryRun ? ' (dry-run)' : ''));
}
} else {
$scopeLabel = $includeExpired ? 'all' : 'active';
$this->info("Extending {$scopeLabel} subscriptions by {$days} day(s)." . ($dryRun ? ' (dry-run)' : ''));
$this->info("Extending {$scopeLabel} subscriptions by {$days} day(s).".($dryRun ? ' (dry-run)' : ''));
}
$touched = 0;
@@ -100,7 +104,7 @@ class AddSubscriptionDays extends Command
});
} else {
$query = UserSubscriber::query();
if (!$includeExpired) {
if (! $includeExpired) {
$query->where('expired_at', '>', now());
}