- Replace "BetZoo CRM" with "MoneyFlix" in Advertising module description - Replace "Betzoo" option with "MoneyFlix" in ErrorMonitoring project filter - Update GoogleSheetsService to use environment variable for credentials path - Update CDN config from betzoo.app to moneyflix.com - Remove WDMI-specific checks in layouts (topbar, sidebar, main, public-blank) - Update database profile examples from wdmi_importer to moneyflix_importer - Keep BitReport references (company/product name)
95 lines
3.4 KiB
PHP
95 lines
3.4 KiB
PHP
<?php
|
|
namespace App\Modules\Advertising;
|
|
|
|
use App\Core\MenuManager;
|
|
use App\Core\View;
|
|
|
|
class Module
|
|
{
|
|
public static function getConfig(): array
|
|
{
|
|
return [
|
|
'name' => 'Advertising',
|
|
'version' => '1.0.0',
|
|
'description' => 'Sistema completo de publicidade e tracking para MoneyFlix',
|
|
'author' => 'BitReport Unip. LDA',
|
|
'enabled' => true,
|
|
'dependencies' => ['Core', 'Analytics', 'GeoAnalytics'],
|
|
'features' => [
|
|
'campaign_management' => true,
|
|
'tracking_system' => true,
|
|
'creative_management' => true,
|
|
'fraud_detection' => true,
|
|
'geo_targeting' => true,
|
|
'script_builder' => true,
|
|
'cdn_integration' => true,
|
|
'google_sheets_sync' => true
|
|
]
|
|
];
|
|
}
|
|
|
|
public static function registerRoutes($router): void
|
|
{
|
|
require __DIR__ . '/Routes/web.php';
|
|
require __DIR__ . '/Routes/api.php';
|
|
}
|
|
|
|
public static function registerServices(): void
|
|
{
|
|
// Registar namespace das views do módulo
|
|
View::addNamespace('advertising', __DIR__ . '/Views');
|
|
|
|
// Registar serviços do módulo no ServiceContainer
|
|
$container = \App\Core\ServiceContainer::getInstance();
|
|
|
|
// Registar modelos
|
|
$container->registerModuleService('Advertising', 'model.CampaignModel', function() {
|
|
return new \App\Modules\Advertising\Models\CampaignModel();
|
|
}, true);
|
|
|
|
$container->registerModuleService('Advertising', 'model.CreativeModel', function() {
|
|
return new \App\Modules\Advertising\Models\CreativeModel();
|
|
}, true);
|
|
|
|
$container->registerModuleService('Advertising', 'model.TrackingModel', function() {
|
|
return new \App\Modules\Advertising\Models\TrackingModel();
|
|
}, true);
|
|
|
|
$container->registerModuleService('Advertising', 'model.BrandModel', function() {
|
|
return new \App\Modules\Advertising\Models\BrandModel();
|
|
}, true);
|
|
|
|
$container->registerModuleService('Advertising', 'model.LandingTypeModel', function() {
|
|
return new \App\Modules\Advertising\Models\LandingTypeModel();
|
|
}, true);
|
|
|
|
// Registar serviços existentes
|
|
if (file_exists(__DIR__ . '/Services/TrackingService.php')) {
|
|
require_once __DIR__ . '/Services/TrackingService.php';
|
|
$container->registerModuleService('Advertising', 'TrackingService', function() {
|
|
return new \App\Modules\Advertising\Services\TrackingService();
|
|
}, true);
|
|
}
|
|
|
|
// ScriptBuilderService removed from MoneyFlix
|
|
|
|
if (file_exists(__DIR__ . '/Services/AdvertisingActivityLogger.php')) {
|
|
require_once __DIR__ . '/Services/AdvertisingActivityLogger.php';
|
|
$container->registerModuleService('Advertising', 'service.AdvertisingActivityLogger', function() {
|
|
return new \App\Modules\Advertising\Services\AdvertisingActivityLogger();
|
|
}, true);
|
|
}
|
|
}
|
|
|
|
public static function boot(): void
|
|
{
|
|
// Register all module services
|
|
self::registerServices();
|
|
}
|
|
|
|
public static function registerMenu(): void
|
|
{
|
|
// Compatibilidade: não faz nada, menu já registado via menu.php
|
|
}
|
|
}
|