mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 23:04:36 -04:00
Clean up for the scheduler
This commit is contained in:
parent
35fde4a73e
commit
b0f8e10430
@ -59,59 +59,9 @@ class TaskScheduler implements ShouldQueue
|
|||||||
|
|
||||||
private function doJob(Scheduler $scheduler)
|
private function doJob(Scheduler $scheduler)
|
||||||
{
|
{
|
||||||
nlog("Doing job {$scheduler->action_name}");
|
nlog("Doing job {$scheduler->name}");
|
||||||
|
//
|
||||||
|
//
|
||||||
|
|
||||||
$company = $scheduler->company;
|
|
||||||
|
|
||||||
// $parameters = $scheduler->parameters;
|
|
||||||
|
|
||||||
// switch ($scheduler->action_name) {
|
|
||||||
// case Scheduler::CREATE_CLIENT_REPORT:
|
|
||||||
// SendToAdmin::dispatch($company, $parameters, $scheduler->action_class, 'contacts.csv');
|
|
||||||
// break;
|
|
||||||
// case Scheduler::CREATE_CLIENT_CONTACT_REPORT:
|
|
||||||
// SendToAdmin::dispatch($company, $parameters, $scheduler->action_class, 'clients.csv');
|
|
||||||
// break;
|
|
||||||
// case Scheduler::CREATE_CREDIT_REPORT:
|
|
||||||
// SendToAdmin::dispatch($company, $parameters, $scheduler->action_class, 'credits.csv');
|
|
||||||
// break;
|
|
||||||
// case Scheduler::CREATE_DOCUMENT_REPORT:
|
|
||||||
// SendToAdmin::dispatch($company, $parameters, $scheduler->action_class, 'documents.csv');
|
|
||||||
// break;
|
|
||||||
// case Scheduler::CREATE_EXPENSE_REPORT:
|
|
||||||
// SendToAdmin::dispatch($company, $parameters, $scheduler->action_class, 'expense.csv');
|
|
||||||
// break;
|
|
||||||
// case Scheduler::CREATE_INVOICE_ITEM_REPORT:
|
|
||||||
// SendToAdmin::dispatch($company, $parameters, $scheduler->action_class, 'invoice_items.csv');
|
|
||||||
// break;
|
|
||||||
// case Scheduler::CREATE_INVOICE_REPORT:
|
|
||||||
// SendToAdmin::dispatch($company, $parameters, $scheduler->action_class, 'invoices.csv');
|
|
||||||
// break;
|
|
||||||
// case Scheduler::CREATE_PAYMENT_REPORT:
|
|
||||||
// SendToAdmin::dispatch($company, $parameters, $scheduler->action_class, 'payments.csv');
|
|
||||||
// break;
|
|
||||||
// case Scheduler::CREATE_PRODUCT_REPORT:
|
|
||||||
// SendToAdmin::dispatch($company, $parameters, $scheduler->action_class, 'products.csv');
|
|
||||||
// break;
|
|
||||||
// case Scheduler::CREATE_PROFIT_AND_LOSS_REPORT:
|
|
||||||
// SendToAdmin::dispatch($company, $parameters, $scheduler->action_class, 'profit_and_loss.csv');
|
|
||||||
// break;
|
|
||||||
// case Scheduler::CREATE_QUOTE_ITEM_REPORT:
|
|
||||||
// SendToAdmin::dispatch($company, $parameters, $scheduler->action_class, 'quote_items.csv');
|
|
||||||
// break;
|
|
||||||
// case Scheduler::CREATE_QUOTE_REPORT:
|
|
||||||
// SendToAdmin::dispatch($company, $parameters, $scheduler->action_class, 'quotes.csv');
|
|
||||||
// break;
|
|
||||||
// case Scheduler::CREATE_RECURRING_INVOICE_REPORT:
|
|
||||||
// SendToAdmin::dispatch($company, $parameters, $scheduler->action_class, 'recurring_invoices.csv');
|
|
||||||
// break;
|
|
||||||
// case Scheduler::CREATE_TASK_REPORT:
|
|
||||||
// SendToAdmin::dispatch($company, $parameters, $scheduler->action_class, 'tasks.csv');
|
|
||||||
// break;
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
// $scheduler->scheduled_run = $scheduler->nextScheduledDate();
|
|
||||||
// $scheduler->save();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use App\Services\Scheduler\SchedulerService;
|
use App\Services\Scheduler\SchedulerService;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
@ -58,46 +57,6 @@ class Scheduler extends BaseModel
|
|||||||
protected $appends = [
|
protected $appends = [
|
||||||
'hashed_id',
|
'hashed_id',
|
||||||
];
|
];
|
||||||
|
|
||||||
const DAILY = 'DAY';
|
|
||||||
|
|
||||||
const WEEKLY = 'WEEK';
|
|
||||||
|
|
||||||
const BIWEEKLY = 'BIWEEKLY';
|
|
||||||
|
|
||||||
const MONTHLY = 'MONTH';
|
|
||||||
|
|
||||||
const QUARTERLY = '3MONTHS';
|
|
||||||
|
|
||||||
const ANNUALLY = 'YEAR';
|
|
||||||
|
|
||||||
const CREATE_CLIENT_REPORT = 'create_client_report';
|
|
||||||
|
|
||||||
const CREATE_CLIENT_CONTACT_REPORT = 'create_client_contact_report';
|
|
||||||
|
|
||||||
const CREATE_CREDIT_REPORT = 'create_credit_report';
|
|
||||||
|
|
||||||
const CREATE_DOCUMENT_REPORT = 'create_document_report';
|
|
||||||
|
|
||||||
const CREATE_EXPENSE_REPORT = 'create_expense_report';
|
|
||||||
|
|
||||||
const CREATE_INVOICE_ITEM_REPORT = 'create_invoice_item_report';
|
|
||||||
|
|
||||||
const CREATE_INVOICE_REPORT = 'create_invoice_report';
|
|
||||||
|
|
||||||
const CREATE_PAYMENT_REPORT = 'create_payment_report';
|
|
||||||
|
|
||||||
const CREATE_PRODUCT_REPORT = 'create_product_report';
|
|
||||||
|
|
||||||
const CREATE_PROFIT_AND_LOSS_REPORT = 'create_profit_and_loss_report';
|
|
||||||
|
|
||||||
const CREATE_QUOTE_ITEM_REPORT = 'create_quote_item_report';
|
|
||||||
|
|
||||||
const CREATE_QUOTE_REPORT = 'create_quote_report';
|
|
||||||
|
|
||||||
const CREATE_RECURRING_INVOICE_REPORT = 'create_recurring_invoice_report';
|
|
||||||
|
|
||||||
const CREATE_TASK_REPORT = 'create_task_report';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service entry points.
|
* Service entry points.
|
||||||
|
@ -13,7 +13,7 @@ namespace App\Services\Scheduler;
|
|||||||
|
|
||||||
use App\Models\Scheduler;
|
use App\Models\Scheduler;
|
||||||
|
|
||||||
class SchedulerServicer
|
class SchedulerService
|
||||||
{
|
{
|
||||||
|
|
||||||
public function __construct(public Scheduler $scheduler) {}
|
public function __construct(public Scheduler $scheduler) {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user