create/get upload request backend

This commit is contained in:
Čarodej
2022-02-17 10:11:43 +01:00
parent 394a7b6baf
commit 45a3b5415b
13 changed files with 354 additions and 29 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Domain\UploadRequest\Models\UploadRequest;
class UploadRequestFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = UploadRequest::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'id' => $this->faker->uuid,
'user_id' => $this->faker->uuid,
'folder_id' => $this->faker->uuid,
'email' => $this->faker->email,
'notes' => $this->faker->realText(80),
'status' => $this->faker->randomElement(
['active', 'filled', 'expired']
),
'created_at' => $this->faker->dateTimeBetween('-1 months'),
];
}
}

View File

@@ -17,6 +17,8 @@ class CreateUserLimitationsTable extends Migration
$table->uuid('user_id');
$table->text('max_storage_amount');
$table->text('max_team_members');
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUploadRequestsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('upload_requests', function (Blueprint $table) {
$table->uuid('id');
$table->uuid('user_id');
$table->uuid('folder_id');
$table->enum('status', ['active', 'filled', 'expired'])->default('active');
$table->string('email');
$table->longText('notes');
$table->timestamps();
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('upload_requests');
}
}