feat(admin): Weeztix setup wizard, integration status badges
- Summary view when Weeztix is configured; edits only via 3-step wizard - Step 1: reuse or replace OAuth client ID/secret; callback URL shown - Step 2: OAuth connect (resume wizard after callback when started from wizard) - Step 3: coupon, prefix, usage; finishing exits wizard - PreregistrationPage: mailwizz/weeztix integration status helpers - Pages index: Integrations column with MW/WZ badges; edit page: status cards Made-with: Cursor
This commit is contained in:
@@ -204,4 +204,56 @@ class PreregistrationPage extends Model
|
||||
|
||||
return 'active';
|
||||
}
|
||||
|
||||
/**
|
||||
* Mailwizz setup depth for admin UI (API key + list + email field = ready to sync).
|
||||
*
|
||||
* @return 'none'|'partial'|'ready'
|
||||
*/
|
||||
public function mailwizzIntegrationStatus(): string
|
||||
{
|
||||
$c = $this->mailwizzConfig;
|
||||
if ($c === null) {
|
||||
return 'none';
|
||||
}
|
||||
|
||||
$key = $c->api_key;
|
||||
if (! is_string($key) || $key === '') {
|
||||
return 'partial';
|
||||
}
|
||||
|
||||
if (! is_string($c->list_uid) || $c->list_uid === '' || ! is_string($c->field_email) || $c->field_email === '') {
|
||||
return 'partial';
|
||||
}
|
||||
|
||||
return 'ready';
|
||||
}
|
||||
|
||||
/**
|
||||
* Weeztix setup depth for admin UI.
|
||||
*
|
||||
* @return 'none'|'credentials'|'connected'|'ready'
|
||||
*/
|
||||
public function weeztixIntegrationStatus(): string
|
||||
{
|
||||
$c = $this->weeztixConfig;
|
||||
if ($c === null) {
|
||||
return 'none';
|
||||
}
|
||||
|
||||
$hasClient = is_string($c->client_id) && $c->client_id !== '';
|
||||
if (! $hasClient) {
|
||||
return 'none';
|
||||
}
|
||||
|
||||
if (! $c->is_connected) {
|
||||
return 'credentials';
|
||||
}
|
||||
|
||||
if (! is_string($c->coupon_guid) || $c->coupon_guid === '') {
|
||||
return 'connected';
|
||||
}
|
||||
|
||||
return 'ready';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user