mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-13 18:52:14 +01:00
Added telescope, basic project endpoint, basic filament resources, GitHub actions
This commit is contained in:
@@ -26,4 +26,11 @@ class OrganizationFactory extends Factory
|
||||
'personal_team' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function withOwner(): self
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'user_id' => User::factory(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('teams');
|
||||
Schema::dropIfExists('organizations');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -29,6 +29,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('team_user');
|
||||
Schema::dropIfExists('organization_user');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -31,6 +31,6 @@ return new class extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('team_invitations');
|
||||
Schema::dropIfExists('organization_invitations');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -22,23 +22,32 @@ class DatabaseSeeder extends Seeder
|
||||
public function run(): void
|
||||
{
|
||||
$this->deleteAll();
|
||||
$organization = Organization::factory()->create([
|
||||
$organization1 = Organization::factory()->create([
|
||||
'name' => 'ACME Corp',
|
||||
]);
|
||||
$user1 = User::factory()->withPersonalOrganization()->create([
|
||||
'name' => 'Test User',
|
||||
'email' => 'test@example.com',
|
||||
]);
|
||||
$employee1 = User::factory()->withPersonalOrganization()->create([
|
||||
'name' => 'Test User',
|
||||
'email' => 'employee@example.com',
|
||||
]);
|
||||
$userAcmeAdmin = User::factory()->create([
|
||||
'name' => 'ACME Admin',
|
||||
'email' => 'admin@acme.test',
|
||||
]);
|
||||
$user1->organizations()->attach($organization, [
|
||||
'role' => 'editor',
|
||||
$user1->organizations()->attach($organization1, [
|
||||
'role' => 'manager',
|
||||
]);
|
||||
$userAcmeAdmin->organizations()->attach($organization, [
|
||||
$userAcmeAdmin->organizations()->attach($organization1, [
|
||||
'role' => 'admin',
|
||||
]);
|
||||
$timeEntriesEmployees = TimeEntry::factory()
|
||||
->count(10)
|
||||
->forUser($employee1)
|
||||
->forOrganization($organization1)
|
||||
->create();
|
||||
$client = Client::factory()->create([
|
||||
'name' => 'Big Company',
|
||||
]);
|
||||
@@ -50,6 +59,24 @@ class DatabaseSeeder extends Seeder
|
||||
$internalProject = Project::factory()->create([
|
||||
'name' => 'Internal Project',
|
||||
]);
|
||||
|
||||
$organization2 = Organization::factory()->create([
|
||||
'name' => 'Rival Corp',
|
||||
]);
|
||||
$user1 = User::factory()->withPersonalOrganization()->create([
|
||||
'name' => 'Other User',
|
||||
'email' => 'test@rival-company.test',
|
||||
]);
|
||||
$user1->organizations()->attach($organization2, [
|
||||
'role' => 'admin',
|
||||
]);
|
||||
$otherCompanyProject = Project::factory()->forClient($client)->create([
|
||||
'name' => 'Scale Company',
|
||||
]);
|
||||
|
||||
User::factory()->withPersonalOrganization()->create([
|
||||
'email' => 'admin@example.com',
|
||||
]);
|
||||
}
|
||||
|
||||
private function deleteAll(): void
|
||||
|
||||
Reference in New Issue
Block a user