Handle different cases
This commit is contained in:
parent
95727d6ec2
commit
bb361f78dd
|
|
@ -174,8 +174,24 @@ class BaseRepository
|
||||||
->exists();
|
->exists();
|
||||||
|
|
||||||
if ($subscriptions) {
|
if ($subscriptions) {
|
||||||
|
switch(true){
|
||||||
|
case $webhookEvent == Webhook::EVENT_RESTORE_PAYMENT:
|
||||||
|
case $webhookEvent == Webhook::EVENT_ARCHIVE_PAYMENT:
|
||||||
|
WebhookHandler::dispatch($webhookEvent, $entity, $entity->company, 'invoices,client')->delay(now()->addSeconds(2));
|
||||||
|
break;
|
||||||
|
case $webhookEvent == Webhook::EVENT_RESTORE_EXPENSE:
|
||||||
|
case $webhookEvent == Webhook::EVENT_ARCHIVE_EXPENSE:
|
||||||
|
case $webhookEvent == Webhook::EVENT_ARCHIVE_CREDIT:
|
||||||
|
case $webhookEvent == Webhook::EVENT_RESTORE_CREDIT:
|
||||||
|
case $webhookEvent == Webhook::EVENT_RESTORE_CLIENT:
|
||||||
|
case $webhookEvent == Webhook::EVENT_ARCHIVE_CLIENT:
|
||||||
|
WebhookHandler::dispatch($webhookEvent, $entity, $entity->company)->delay(now()->addSeconds(2));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
WebhookHandler::dispatch($webhookEvent, $entity, $entity->company, 'client')->delay(now()->addSeconds(2));
|
WebhookHandler::dispatch($webhookEvent, $entity, $entity->company, 'client')->delay(now()->addSeconds(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue