* закончил окно редактирования карты с назначением номера в архиве

* добавил окно для редактирования выдачи / возврата карты
* раздробил логику хранения карты
This commit is contained in:
brusnitsyn
2025-12-05 18:04:02 +09:00
parent 2dfa45707c
commit 2e1b5a3d0e
17 changed files with 431 additions and 13 deletions

View File

@@ -0,0 +1,28 @@
<?php
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('orgs', function (Blueprint $table) {
$table->string('code')->after('id');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('orgs', function (Blueprint $table) {
$table->dropColumn('code');
});
}
};

View File

@@ -0,0 +1,29 @@
<?php
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::create('archive_statuses', function (Blueprint $table) {
$table->id();
$table->string('text');
$table->string('variant');
$table->boolean('has_user_set')->default(false);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('archive_statuses');
}
};

View File

@@ -0,0 +1,31 @@
<?php
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::create('archive_infos', function (Blueprint $table) {
$table->id();
$table->morphs('historyable');
$table->string('num');
$table->date('post_in');
$table->foreignIdFor(\App\Models\ArchiveStatus::class, 'status_id')->default(1);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('archive_infos');
}
};

View File

@@ -0,0 +1,31 @@
<?php
namespace Database\Seeders;
use App\Models\ArchiveStatus;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class ArchiveStatusSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
ArchiveStatus::create([
'text' => 'Не определен',
'variant' => 'default'
]);
ArchiveStatus::create([
'text' => 'В архиве',
'variant' => 'success'
]);
ArchiveStatus::create([
'text' => 'Выдана',
'variant' => 'warning'
]);
}
}

View File

@@ -15,11 +15,8 @@ class DatabaseSeeder extends Seeder
*/
public function run(): void
{
// User::factory(10)->create();
User::factory()->create([
'name' => 'Test User',
'email' => 'test@example.com',
$this->call([
ArchiveStatusSeeder::class,
]);
}
}