Moving accounting commands into an Intuit/ namespace, updates to intuit module

This commit is contained in:
2024-07-14 13:49:00 +10:00
parent 28aa1f9dc8
commit b486a0eac4
15 changed files with 220 additions and 316 deletions

View File

@@ -16,9 +16,8 @@ class ProviderTokenRefresh extends Command
* @var string
*/
protected $signature = 'provider:token:refresh'
.' {siteid : Site ID}'
.' {provider : Supplier Name}'
.' {user : User Email}';
.' {user? : User Email}';
/**
* The console command description.
@@ -34,15 +33,14 @@ class ProviderTokenRefresh extends Command
*/
public function handle()
{
$site = Site::findOrFail($this->argument('siteid'));
Config::set('site',$site);
$uo = User::where('email',$this->argument('user') ?: config('osb.admin'))->singleOrFail();
$so = ProviderOauth::where('name',$this->argument('provider'))->singleOrFail();
$uo = User::where('email',$this->argument('user'))->singleOrFail();
if (($x=$so->tokens->where('user_id',$uo->id))->count() !== 1)
abort(500,sprintf('Unknown Tokens for [%s]',$uo->email));
Job::dispatchSync($x->pop());
return self::SUCCESS;
}
}