Update Member Import
This commit is contained in:
@@ -16,6 +16,8 @@ return new class extends Migration
|
||||
Schema::create('members', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('user_id')->nullable()->index();
|
||||
$table->string('member_id')->nullable()->unique();
|
||||
$table->string('payor_id')->nullable();
|
||||
$table->string('name_prefix')->nullable();
|
||||
$table->string('name');
|
||||
$table->string('name_suffix')->nullable();
|
||||
@@ -25,9 +27,10 @@ return new class extends Migration
|
||||
$table->string('language')->nullable();
|
||||
$table->string('race')->nullable();
|
||||
$table->string('marital_status')->nullable();
|
||||
$table->foreignId('principle_id')->nullable()->index();
|
||||
$table->string('relation_with_principle')->nullable();
|
||||
$table->date('bpjs_class')->nullable();
|
||||
$table->string('record_type', 1)->nullable();
|
||||
$table->string('principal_id')->nullable()->index();
|
||||
$table->string('relation_with_principal')->nullable();
|
||||
$table->string('bpjs_class')->nullable();
|
||||
$table->boolean('active')->default(true);
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
@@ -15,7 +15,19 @@ return new class extends Migration
|
||||
{
|
||||
Schema::create('corporate_employees', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('corporate_id')->index();
|
||||
$table->foreignId('member_id')->index();
|
||||
$table->string('branch_code')->nullable()->index();
|
||||
$table->foreignId('division_id')->nullable()->index();
|
||||
$table->string('nik')->nullable()->index();
|
||||
$table->string('status')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ return new class extends Migration
|
||||
Schema::create('corporate_policies', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('corporate_id');
|
||||
$table->string('code')->unique();
|
||||
$table->string('policy_id')->unique();
|
||||
$table->decimal('total_premi', 15, 2)->nullable();
|
||||
$table->decimal('minimal_deposit_percentage', 15, 2)->nullable();
|
||||
$table->decimal('minimal_deposit_net', 15, 2)->nullable();
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('member_policies', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('policy_id');
|
||||
$table->string('member_id');
|
||||
$table->string('status')->default('active');
|
||||
$table->dateTime('start')->nullable();
|
||||
$table->dateTime('end')->nullalbe();
|
||||
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
||||
$table->unsignedBigInteger('created_by')->nullable();
|
||||
$table->unsignedBigInteger('updated_by')->nullable();
|
||||
$table->unsignedBigInteger('deleted_by')->nullable();
|
||||
|
||||
$table->index(['policy_id', 'member_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('member_policies');
|
||||
}
|
||||
};
|
||||
@@ -15,5 +15,10 @@ class DatabaseSeeder extends Seeder
|
||||
public function run()
|
||||
{
|
||||
// \App\Models\User::factory(10)->create();
|
||||
|
||||
$this->call([
|
||||
DummyMemberSeeder::class,
|
||||
DummyCorprateSeeder::class
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
49
database/seeders/DummyCorporateSeeder.php
Normal file
49
database/seeders/DummyCorporateSeeder.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\Corporate;
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class DummyCorporateSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
Corporate::truncate();
|
||||
|
||||
$corporate = Corporate::create([
|
||||
'code' => 'UNTR0001',
|
||||
'name' => 'United Tractor',
|
||||
'welcome_message' => 'Welcome to United Tractor',
|
||||
'help_text' => 'You can blah blah blah blah',
|
||||
'active' => true
|
||||
]);
|
||||
|
||||
$corporate->corporatePlans()->create([
|
||||
'code' => 'PLAN001',
|
||||
'name' => 'PLAN Name',
|
||||
'description' => 'Description of PLAN Name',
|
||||
'active' => true,
|
||||
]);
|
||||
|
||||
$corporate->corporateBenefits()->create([
|
||||
'code' => 'BENEFIT001',
|
||||
'name' => 'BENEFIT Name',
|
||||
'description' => 'Description of BENEFIT Name',
|
||||
'active' => true,
|
||||
]);
|
||||
|
||||
$corporate->corporateDivisions()->create([
|
||||
'code' => 'DIVISION001',
|
||||
'name' => 'DIVISION Name',
|
||||
'description' => 'Description of DIVISION Name',
|
||||
'active' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user