1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Move observers into rigth place

This commit is contained in:
Lars Kusch 2023-01-30 08:21:47 +01:00
parent 0f05065279
commit 6984aa35e3
7 changed files with 0 additions and 72 deletions

View File

@ -90,14 +90,4 @@ class ClientObserver
//
}
public function archived(Client $client)
{
$subscriptions = Webhook::where('company_id', $client->company->id)
->where('event_id', Webhook::EVENT_ARCHIVE_CLIENT)
->exists();
if ($subscriptions) {
WebhookHandler::dispatch(Webhook::EVENT_ARCHIVE_CLIENT, $client, $client->company)->delay(now()->addSeconds(2));
}
}
}

View File

@ -97,14 +97,4 @@ class CreditObserver
* @param Credit $credit
* @return void
*/
public function archived(Credit $credit)
{
$subscriptions = Webhook::where('company_id', $credit->company->id)
->where('event_id', Webhook::EVENT_ARCHIVE_CREDIT)
->exists();
if ($subscriptions) {
WebhookHandler::dispatch(Webhook::EVENT_ARCHIVE_CREDIT, $credit, $credit->company)->delay(now()->addSeconds(2));
}
}
}

View File

@ -95,14 +95,4 @@ class ExpenseObserver
* @param Expense $expense
* @return void
*/
public function archived(Expense $expense)
{
$subscriptions = Webhook::where('company_id', $expense->company->id)
->where('event_id', Webhook::EVENT_ARCHIVE_EXPENSE)
->exists();
if ($subscriptions) {
WebhookHandler::dispatch(Webhook::EVENT_ARCHIVE_EXPENSE, $expense, $expense->company)->delay(now()->addSeconds(2));
}
}
}

View File

@ -89,14 +89,4 @@ class PaymentObserver
{
//
}
public function archived(Payment $payment)
{
$subscriptions = Webhook::where('company_id', $payment->company->id)
->where('event_id', Webhook::EVENT_ARCHIVE_PAYMENT)
->exists();
if ($subscriptions) {
WebhookHandler::dispatch(Webhook::EVENT_ARCHIVE_PAYMENT, $payment, $payment->company, 'invoices,client')->delay(now()->addSeconds(20));
}
}
}

View File

@ -98,15 +98,4 @@ class ProjectObserver
* @param Project $project
* @return void
*/
public function archived(Project $project)
{
$subscriptions = Webhook::where('company_id', $project->company_id)
->where('event_id', Webhook::EVENT_ARCHIVE_PROJECT)
->exists();
if ($subscriptions) {
WebhookHandler::dispatch(Webhook::EVENT_ARCHIVE_PROJECT, $project, $project->company, 'client')->delay(now()->addSeconds(2));
}
}
}

View File

@ -93,15 +93,4 @@ class QuoteObserver
{
//
}
public function archived(Quote $quote)
{
$subscriptions = Webhook::where('company_id', $quote->company->id)
->where('event_id', Webhook::EVENT_ARCHIVE_QUOTE)
->exists();
if ($subscriptions) {
$quote->load('client');
WebhookHandler::dispatch(Webhook::EVENT_ARCHIVE_QUOTE, $quote, $quote->company, 'client')->delay(now()->addSeconds(2));
}
}
}

View File

@ -89,14 +89,4 @@ class TaskObserver
{
//
}
public function archived(Task $task)
{
$subscriptions = Webhook::where('company_id', $task->company->id)
->where('event_id', Webhook::EVENT_ARCHIVE_TASK)
->exists();
if ($subscriptions) {
WebhookHandler::dispatch(Webhook::EVENT_ARCHIVE_TASK, $task, $task->company)->delay(now()->addSeconds(2));
}
}
}