mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-08 08:12:17 +01:00
Updated invitation flow, Moved jetstream function to REST endpoints; Lower case email
This commit is contained in:
committed by
Constantin Graf
parent
d732064f31
commit
a30d192ea2
@@ -25,9 +25,24 @@ class OrganizationInvitationFactory extends Factory
|
||||
'email' => $this->faker->unique()->safeEmail(),
|
||||
'role' => Role::Employee->value,
|
||||
'organization_id' => Organization::factory(),
|
||||
'accepted_at' => null,
|
||||
];
|
||||
}
|
||||
|
||||
public function role(Role $role): self
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'role' => $role->value,
|
||||
]);
|
||||
}
|
||||
|
||||
public function accepted(): self
|
||||
{
|
||||
return $this->state(fn (array $attributes): array => [
|
||||
'accepted_at' => $this->faker->dateTime(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function forOrganization(Organization $organization): self
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('organization_invitations', function (Blueprint $table): void {
|
||||
$table->timestamp('accepted_at')->nullable()->after('email');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('organization_invitations', function (Blueprint $table): void {
|
||||
$table->dropColumn('accepted_at');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user