feat: add Weeztix OAuth, coupon codes, and Mailwizz mapping
Implement Weeztix integration per documentation: database config and subscriber coupon_code, OAuth redirect/callback, admin setup UI with company/coupon selection via AJAX, synchronous coupon creation on public subscribe with duplicate and rate-limit handling, Mailwizz field mapping for coupon codes, subscriber table and CSV export, and connection hint on the pages list. Made-with: Cursor
This commit is contained in:
@@ -42,6 +42,7 @@ class UpdateMailwizzConfigRequest extends FormRequest
|
||||
'field_first_name' => ['required', 'string', 'max:255'],
|
||||
'field_last_name' => ['required', 'string', 'max:255'],
|
||||
'field_phone' => ['nullable', 'string', 'max:255'],
|
||||
'field_coupon_code' => ['nullable', 'string', 'max:255'],
|
||||
'tag_field' => ['required', 'string', 'max:255'],
|
||||
'tag_value' => ['required', 'string', 'max:255'],
|
||||
];
|
||||
|
||||
55
app/Http/Requests/Admin/UpdateWeeztixConfigRequest.php
Normal file
55
app/Http/Requests/Admin/UpdateWeeztixConfigRequest.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Http\Requests\Admin;
|
||||
|
||||
use App\Models\PreregistrationPage;
|
||||
use Illuminate\Contracts\Validation\ValidationRule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateWeeztixConfigRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
$page = $this->route('page');
|
||||
if (! $page instanceof PreregistrationPage) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $this->user()?->can('update', $page) ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, array<int, ValidationRule|string>>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
/** @var PreregistrationPage $page */
|
||||
$page = $this->route('page');
|
||||
|
||||
return [
|
||||
'client_id' => [
|
||||
'sometimes',
|
||||
Rule::requiredIf(fn (): bool => $page->weeztixConfig === null),
|
||||
'nullable',
|
||||
'string',
|
||||
'max:2048',
|
||||
],
|
||||
'client_secret' => [
|
||||
'sometimes',
|
||||
Rule::requiredIf(fn (): bool => $page->weeztixConfig === null),
|
||||
'nullable',
|
||||
'string',
|
||||
'max:2048',
|
||||
],
|
||||
'company_guid' => ['nullable', 'string', 'max:255'],
|
||||
'company_name' => ['nullable', 'string', 'max:255'],
|
||||
'coupon_guid' => ['nullable', 'string', 'max:255'],
|
||||
'coupon_name' => ['nullable', 'string', 'max:255'],
|
||||
'code_prefix' => ['nullable', 'string', 'max:32'],
|
||||
'usage_count' => ['nullable', 'integer', 'min:1', 'max:99999'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user