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:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('weeztix_configs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('preregistration_page_id')->constrained()->cascadeOnDelete();
|
||||
|
||||
$table->text('client_id');
|
||||
$table->text('client_secret');
|
||||
$table->string('redirect_uri');
|
||||
|
||||
$table->text('access_token')->nullable();
|
||||
$table->text('refresh_token')->nullable();
|
||||
$table->timestamp('token_expires_at')->nullable();
|
||||
$table->timestamp('refresh_token_expires_at')->nullable();
|
||||
|
||||
$table->string('company_guid')->nullable();
|
||||
$table->string('company_name')->nullable();
|
||||
|
||||
$table->string('coupon_guid')->nullable();
|
||||
$table->string('coupon_name')->nullable();
|
||||
|
||||
$table->string('code_prefix')->default('PREREG');
|
||||
$table->integer('usage_count')->default(1);
|
||||
|
||||
$table->boolean('is_connected')->default(false);
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('weeztix_configs');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('subscribers', function (Blueprint $table) {
|
||||
$table->string('coupon_code')->nullable()->after('synced_at');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('subscribers', function (Blueprint $table) {
|
||||
$table->dropColumn('coupon_code');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('mailwizz_configs', function (Blueprint $table) {
|
||||
$table->string('field_coupon_code')->nullable()->after('field_phone');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('mailwizz_configs', function (Blueprint $table) {
|
||||
$table->dropColumn('field_coupon_code');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user