additional logging

This commit is contained in:
David Bomba 2023-02-05 08:41:28 +11:00
parent ac3a7f00b9
commit cbf8735d23
4 changed files with 7 additions and 10 deletions

View File

@ -494,7 +494,7 @@ class CompanyController extends BaseController
$account->delete();
if (Ninja::isHosted()) {
\Modules\Admin\Jobs\Account\NinjaDeletedAccount::dispatch($account_key, $request->all());
\Modules\Admin\Jobs\Account\NinjaDeletedAccount::dispatch($account_key, $request->all(), auth()->user()->email);
}
LightLogs::create(new AccountDeleted())

View File

@ -38,6 +38,8 @@ class AppStoreRenewSubscription implements ShouldQueue
$inapp_transaction_id = $event->getSubscriptionId(); //$subscription_id
nlog("inapp upgrade processing for = {$inapp_transaction_id}");
MultiDB::findAndSetDbByInappTransactionId($inapp_transaction_id);
$account = Account::where('inapp_transaction_id', $inapp_transaction_id)->first();

View File

@ -30,13 +30,7 @@ class ClientAccountNotFound extends Notification
* @return void
*/
protected string $account_key;
public function __construct(string $account_key)
{
$this->account_key = $account_key;
}
public function __construct(protected string $account_key, protected string $email){}
/**
* Get the notification's delivery channels.
@ -77,6 +71,7 @@ class ClientAccountNotFound extends Notification
$content = "Client not found, unable to remove account\n";
$content .= "Account: {$this->account_key }\n";
$content .= "Email: {$this->email}\n";
return (new SlackMessage)
->success()

View File

@ -39,10 +39,10 @@ class UserObserver
public function updated(User $user)
{
if (Ninja::isHosted() && $user->isDirty('email')) {
if (Ninja::isHosted() && $user->isDirty('email') && $user->company_users()->where('is_owner', true)->exists()) {
//ensure they are owner user and update email on file.
if(class_exists(\Modules\Admin\Jobs\Account\UpdateOwnerUser::class))
\Modules\Admin\Jobs\Account\UpdateOwnerUser::dispatch($user->account->account_key, $user, $user->getOriginal('email'));
\Modules\Admin\Jobs\Account\UpdateOwnerUser::dispatch($user->account->key, $user, $user->getOriginal('email'));
}