mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-16 04:02:15 +01:00
Added placeholder users; Better exception handling; Enhanced local setup
This commit is contained in:
@@ -6,6 +6,9 @@ namespace App\Service\Import\Importers;
|
||||
|
||||
class ImporterProvider
|
||||
{
|
||||
/**
|
||||
* @var array<string, class-string<ImporterContract>>
|
||||
*/
|
||||
private array $importers = [
|
||||
'toggl_time_entries' => TogglTimeEntriesImporter::class,
|
||||
];
|
||||
|
||||
23
app/Service/UserService.php
Normal file
23
app/Service/UserService.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Service;
|
||||
|
||||
use App\Models\Organization;
|
||||
use App\Models\TimeEntry;
|
||||
use App\Models\User;
|
||||
|
||||
class UserService
|
||||
{
|
||||
public function assignOrganizationEntitiesToDifferentUser(Organization $organization, User $fromUser, User $toUser): void
|
||||
{
|
||||
// Time entries
|
||||
dump(TimeEntry::query()
|
||||
->whereBelongsTo($organization, 'organization')
|
||||
->whereBelongsTo($fromUser, 'user')
|
||||
->update([
|
||||
'user_id' => $toUser->getKey(),
|
||||
]));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user