feat(Membership, FAQ, Relance): update membership form (member type radio,retzien email field, calendar-year pricing), create FAQ page with accordion, wire renewal reminder notification
All checks were successful
Deploy Roxane to Preprod / deploy (push) Successful in 1m23s

This commit is contained in:
2026-07-27 16:30:48 +02:00
parent 87e23ea50f
commit 6d300ac79c
27 changed files with 1517 additions and 396 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Forms;
use App\Http\Controllers\Controller;
use App\Http\Requests\Forms\MembershipRequest;
use App\Models\MemberType;
use App\Models\Package;
use App\Models\Service;
use App\Services\MemberService;
@@ -18,23 +19,39 @@ class MembershipFormController extends Controller
public function create(): Response
{
$remainingMonths = 13 - now()->month;
$currentYear = now()->year;
$plans = Package::query()
->where('is_active', true)
->select('id', 'identifier', 'name', 'price', 'description')
->get()
->map(fn (Package $p) => [
'id' => $p->id,
'identifier' => $p->identifier,
'name' => $p->name,
'description' => $p->description,
'price' => $p->identifier === 'custom' ? $remainingMonths : (float) $p->price,
'months' => $p->identifier === 'custom' ? $remainingMonths : null,
]);
->map(function (Package $p) use ($remainingMonths, $currentYear) {
$months = match ($p->identifier) {
'custom' => $remainingMonths,
'one-year' => $remainingMonths + 12,
'two-years' => $remainingMonths + 24,
default => null,
};
return [
'id' => $p->id,
'identifier' => $p->identifier,
'name' => $p->name,
'description' => $p->description,
'price' => $months ?? (float) $p->price,
'months' => $months,
];
});
$memberTypes = MemberType::query()
->select('id', 'identifier', 'name')
->get();
return Inertia::render('forms/membership', [
'plans' => $plans,
'services' => Service::query()->select('name', 'description')->get(),
'member_types' => $memberTypes,
'current_year' => $currentYear,
'captcha_question' => $this->generateCaptcha(),
]);
}

View File

@@ -29,10 +29,12 @@ class MembershipRequest extends FormRequest
public function rules(): array
{
return [
'member_type' => 'required|string|exists:member_types,identifier',
'lastname' => 'required|string|max:255',
'firstname' => 'required|string|max:255',
'email' => 'required|email|max:255',
'company' => 'nullable|string|max:255',
'desired_retzien_email' => ['nullable', 'string', 'max:64', 'regex:/^[a-z0-9._-]+$/'],
'address' => 'required|string|max:255',
'zipcode' => ['required', 'digits:5'],
'city' => 'required|string|max:255',