add konto und konto optionen

This commit is contained in:
salam committed 2025-09-06 17:56:57 +02:00
1 parent 81370e9706
commit b005c7677e
89 files changed
+4406 -7

No files matched your search

@@ -0,0 +1,37 @@
<?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('kontos', function (Blueprint $table) {
$table->id();
$table->string('title')->nullable();
$table->string('gender')->nullable();
$table->string('first_name');
$table->string('last_name');
$table->string('company');
$table->string('address')->nullable();
$table->string('place')->nullable();
$table->string('code')->nullable();
$table->string('phone')->nullable();
$table->string('uid_number')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('kontos');
}
};
@@ -13,10 +13,13 @@ return new class extends Migration
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->foreignId('konto_id')->constrained()->cascadeOnDelete();
$table->string('gender')->nullable();
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->boolean('super_admin')->default(0);
$table->rememberToken();
$table->timestamp('app_verified_at')->nullable();
$table->timestamp('deleted_at')->nullable();
@@ -0,0 +1,34 @@
<?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('gutachters', function (Blueprint $table) {
$table->id();
$table->string('name')->nullable();
$table->string('logo')->nullable();
$table->string('address')->nullable();
$table->string('place')->nullable();
$table->string('code')->nullable();
$table->string('phone')->nullable();
$table->timestamp('deleted_at')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('gutachters');
}
};
@@ -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('kontooptionens', function (Blueprint $table) {
$table->id();
$table->string('name')->nullable();
$table->string('description')->nullable();
$table->integer('number_user')->default(1);
$table->integer('number_gutachter')->default(1);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('kontooptionens');
}
};
+2
View File
@@ -12,7 +12,9 @@ class DatabaseSeeder extends Seeder
public function run(): void
{
$this->call([
KontoSeeder::class,
RolesAndPermissionsSeeder::class,
KontooptionenSeeder::class,
]);
}
}
+21
View File
@@ -0,0 +1,21 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class KontoSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$sql = "INSERT INTO `kontos` (`id`, `title`, `gender`, `first_name`, `last_name`, `company`, `address`, `place`, `code`, `phone`, `uid_number`)
VALUES
('1', 'Architekt', 'Herr','Bruno','Kunz','Architekt Kunz','Pradlerstraße 11','Innbsruck', '6020', '0512 457328', 'ATU 234578');
";
DB::unprepared($sql);
}
}
+22
View File
@@ -0,0 +1,22 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class KontooptionenSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$sql = "INSERT INTO `kontooptionens` (`id`, `name`, `description`, `number_user`, `number_gutachter`)
VALUES
('1', 'Basic', 'Basis Version mit einem Benutzer und einem Gutacher.',1,1),
('2', 'Premium', 'Premium Version mit fünf Benutzer und fünf Gutacher.',5,5);
";
DB::unprepared($sql);
}
}
@@ -15,12 +15,14 @@ class RolesAndPermissionsSeeder extends Seeder
[
['name' => 'gutachter', 'guard_name' => 'web'],
['name' => 'super_admin', 'guard_name' => 'web'],
['name' => 'tenancy_switch', 'guard_name' => 'web'],
['name' => 'gutachter_switch', 'guard_name' => 'web'],
],
['name']
);
$user = User::factory()->create([
'konto_id' => '1',
'gender' => 'Herr',
'name' => 'Hermann Telser',
'email' => 'ht@webwerkstatt.tirol',
'password' => Hash::make('salam'),
@@ -28,12 +30,16 @@ class RolesAndPermissionsSeeder extends Seeder
'email_verified_at' => now(),
]);
$user->assignRole('super_admin');
$user->assignRole('tenancy_switch');
$user->assignRole('gutachter_switch');
$user = User::factory()->create([
'konto_id' => '1',
'gender' => 'Frau',
'name' => 'Yvonne Bormes',
'email' => 'yvonne.bormes@ztkammer.at',
'password' => Hash::make('yvonne'),
'app_verified_at' => now(),
'email_verified_at' => now(),
]);
$user->assignRole('gutachter');
}