it_accept_team_folder_invite

This commit is contained in:
Peter Papp
2021-08-24 13:29:45 +02:00
parent ca1d037975
commit d53a4964ae
9 changed files with 165 additions and 12 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace Database\Factories;
use Domain\Teams\Models\TeamFoldersInvitation;
use Illuminate\Database\Eloquent\Factories\Factory;
class TeamFoldersInvitationFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = TeamFoldersInvitation::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'id' => $this->faker->uuid,
'folder_id' => $this->faker->uuid,
'email' => $this->faker->email,
'permission' => $this->faker->randomElement(['can-edit', 'can-view', 'can-view-and-download']),
'status' => $this->faker->randomElement(['pending', 'accepted', 'rejected']),
];
}
}

View File

@@ -17,8 +17,11 @@ class CreateTeamFoldersInvitationsTable extends Migration
$table->uuid('id')->primary();
$table->uuid('folder_id');
$table->text('email');
$table->enum('permission', ['can-edit', 'can-view', 'can-view-and-download']);
$table->enum('status', ['pending', 'accepted', 'rejected'])->default('pending');
$table->timestamps();
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTeamFolderMembersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('team_folder_members', function (Blueprint $table) {
$table->uuid('folder_id');
$table->uuid('member_id');
$table->string('permission');
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('team_folder_members');
}
}