feat(portal): lead module, WHMCS sync report/contacts/mapping, service lifecycle email templates
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
3c7710f1de
commit
a443ec3bf6
@@ -7,8 +7,15 @@ use Illuminate\Support\LazyCollection;
|
||||
|
||||
class ClientExtractor
|
||||
{
|
||||
public function extract(): LazyCollection
|
||||
public function extract(bool $missingOnly = false): LazyCollection
|
||||
{
|
||||
return DB::connection('whmcs')->table('tblclients')->orderBy('id')->cursor();
|
||||
$rows = DB::connection('whmcs')->table('tblclients')->orderBy('id')->cursor();
|
||||
if (! $missingOnly) {
|
||||
return $rows;
|
||||
}
|
||||
|
||||
$uuids = DB::table('customers')->pluck('uuid')->flip()->all();
|
||||
|
||||
return $rows->reject(fn ($row) => isset($uuids[$row->uuid]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,13 +2,21 @@
|
||||
|
||||
namespace App\Integrations\Whmcs\Extractors;
|
||||
|
||||
use App\Integrations\Whmcs\Support\SyncedLegacyIds;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\LazyCollection;
|
||||
|
||||
class CustomerDomainExtractor
|
||||
{
|
||||
public function extract(): LazyCollection
|
||||
public function extract(bool $missingOnly = false): LazyCollection
|
||||
{
|
||||
return DB::connection('whmcs')->table('tbldomains')->orderBy('id')->cursor();
|
||||
$rows = DB::connection('whmcs')->table('tbldomains')->orderBy('id')->cursor();
|
||||
if (! $missingOnly) {
|
||||
return $rows;
|
||||
}
|
||||
|
||||
$synced = SyncedLegacyIds::of('module_domain');
|
||||
|
||||
return $rows->reject(fn ($row) => isset($synced[$row->id]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,22 @@
|
||||
|
||||
namespace App\Integrations\Whmcs\Extractors;
|
||||
|
||||
use App\Integrations\Whmcs\Support\SyncedLegacyIds;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\LazyCollection;
|
||||
|
||||
class InvoiceExtractor
|
||||
{
|
||||
public function extract(): LazyCollection
|
||||
public function extract(bool $missingOnly = false): LazyCollection
|
||||
{
|
||||
return DB::connection('whmcs')->table('tblinvoices')->orderBy('id')->cursor();
|
||||
$rows = DB::connection('whmcs')->table('tblinvoices')->orderBy('id')->cursor();
|
||||
if (! $missingOnly) {
|
||||
return $rows;
|
||||
}
|
||||
|
||||
$synced = SyncedLegacyIds::of('invoices');
|
||||
|
||||
return $rows->reject(fn ($row) => isset($synced[$row->id]));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,13 +2,21 @@
|
||||
|
||||
namespace App\Integrations\Whmcs\Extractors;
|
||||
|
||||
use App\Integrations\Whmcs\Support\SyncedLegacyIds;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\LazyCollection;
|
||||
|
||||
class OrderExtractor
|
||||
{
|
||||
public function extract(): LazyCollection
|
||||
public function extract(bool $missingOnly = false): LazyCollection
|
||||
{
|
||||
return DB::connection('whmcs')->table('tblorders')->orderBy('id')->cursor();
|
||||
$rows = DB::connection('whmcs')->table('tblorders')->orderBy('id')->cursor();
|
||||
if (! $missingOnly) {
|
||||
return $rows;
|
||||
}
|
||||
|
||||
$synced = SyncedLegacyIds::of('orders', true);
|
||||
|
||||
return $rows->reject(fn ($row) => isset($synced[$row->id]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Integrations\Whmcs\Extractors;
|
||||
|
||||
use App\Integrations\Whmcs\Support\SyncedLegacyIds;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\LazyCollection;
|
||||
|
||||
@@ -11,8 +12,15 @@ class OrderItemExtractor
|
||||
* Each `tblhosting` row (a provisioned service instance) is the closest WHMCS equivalent
|
||||
* of an order line item — WHMCS orders have no real line-item table of their own.
|
||||
*/
|
||||
public function extract(): LazyCollection
|
||||
public function extract(bool $missingOnly = false): LazyCollection
|
||||
{
|
||||
return DB::connection('whmcs')->table('tblhosting')->orderBy('id')->cursor();
|
||||
$rows = DB::connection('whmcs')->table('tblhosting')->orderBy('id')->cursor();
|
||||
if (! $missingOnly) {
|
||||
return $rows;
|
||||
}
|
||||
|
||||
$synced = SyncedLegacyIds::of('order_items');
|
||||
|
||||
return $rows->reject(fn ($row) => isset($synced[$row->id]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,13 +2,21 @@
|
||||
|
||||
namespace App\Integrations\Whmcs\Extractors;
|
||||
|
||||
use App\Integrations\Whmcs\Support\SyncedLegacyIds;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\LazyCollection;
|
||||
|
||||
class ServiceExtractor
|
||||
{
|
||||
public function extract(): LazyCollection
|
||||
public function extract(bool $missingOnly = false): LazyCollection
|
||||
{
|
||||
return DB::connection('whmcs')->table('tblhosting')->orderBy('id')->cursor();
|
||||
$rows = DB::connection('whmcs')->table('tblhosting')->orderBy('id')->cursor();
|
||||
if (! $missingOnly) {
|
||||
return $rows;
|
||||
}
|
||||
|
||||
$synced = SyncedLegacyIds::of('services');
|
||||
|
||||
return $rows->reject(fn ($row) => isset($synced[$row->id]));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user