[WIP] Import Plans

This commit is contained in:
2022-07-07 10:17:46 +07:00
parent f18bb85b94
commit 574004d408
146 changed files with 28928 additions and 71 deletions

View File

@@ -15,7 +15,7 @@ return new class extends Migration
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
// $table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');

View File

@@ -15,14 +15,20 @@ return new class extends Migration
{
Schema::create('members', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('user_id')->nullable();
$table->unsignedBigInteger('corporate_id')->nullable();
$table->string('name_prefix');
$table->foreignId('user_id')->nullable();
$table->string('name_prefix')->nullable();
$table->string('name');
$table->string('name_suffix');
$table->date('birth_date');
$table->string('gender');
$table->boolean('active');
$table->string('name_suffix')->nullable();
// $table->string('nik');
$table->date('birth_date')->nullable();
$table->string('gender')->nullable();
$table->string('language')->nullable();
$table->string('race')->nullable();
$table->string('marital_status')->nullable();
$table->foreignId('principle_id')->nullable();
$table->string('relation_with_principle')->nullable();
$table->date('bpjs_class')->nullable();
$table->boolean('active')->default(true);
$table->timestamps();
$table->softDeletes();

View File

@@ -0,0 +1,42 @@
<?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('corporates', function (Blueprint $table) {
$table->id();
$table->string('code');
$table->string('name')->nullable();
$table->text('welcome_message')->nullable();
$table->text('help_text')->nullable();
$table->boolean('active')->default(true);
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('corporates');
}
};

View File

@@ -0,0 +1,40 @@
<?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('corporate_divisions', function (Blueprint $table) {
$table->id();
$table->foreignId('corporate_id')->nullable();
$table->string('code');
$table->string('name')->nullable();
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('corporate_divisions');
}
};

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.
*
* @return void
*/
public function up()
{
Schema::create('corporate_employees', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('corporate_employees');
}
};

View File

@@ -0,0 +1,49 @@
<?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('corporate_policies', function (Blueprint $table) {
$table->id();
$table->string('corporate_id');
$table->string('code')->unique();
$table->decimal('total_premi', 15, 2)->nullable();
$table->decimal('minimal_deposit_percentage', 15, 2)->nullable();
$table->decimal('minimal_deposit_net', 15, 2)->nullable();
$table->decimal('minimal_alert_percentage', 7, 4)->nullable();
$table->decimal('minimal_alert_net', 15, 2)->nullable();
$table->decimal('minimal_stop_service_percentage', 7, 4)->nullable();
$table->decimal('minimal_stop_service_net', 15, 2)->nullable();
$table->date('start')->nullable();
$table->date('end')->nullable();
$table->boolean('active')->default(false);
$table->timestamps();
$table->softDeletes();
$table->unsignedBigInteger('created_by')->nullable();
$table->unsignedBigInteger('updated_by')->nullable();
$table->unsignedBigInteger('deleted_by')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('corporate_policies');
}
};

View File

@@ -0,0 +1,40 @@
<?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('benefits', function (Blueprint $table) {
$table->id();
$table->string('code')->unique();
$table->string('name');
$table->text('description')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreignId('created_by')->nullable()->index();
$table->foreignId('updated_by')->nullable()->index();
$table->foreignId('deleted_by')->nullable()->index();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('benefits');
}
};

View File

@@ -0,0 +1,81 @@
<?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('plans', function (Blueprint $table) {
$table->id();
$table->string('service_code')->index();
$table->string('code')->index();
$table->string('type')->nullable();
$table->dateTime('start')->nullable();
$table->dateTime('end')->nullable();
$table->string('require_referral')->nullable();
$table->string('referral_source')->nullable();
$table->string('referral_duration')->nullable();
$table->string('family_plan')->nullable();
$table->string('family_plan_share_rules')->nullable();
$table->string('limit_rules')->nullable(); // Annual Limit
$table->string('layer')->nullable();
$table->string('layer_conditions')->nullable();
$table->string('budget_type')->nullable();
$table->string('budget_code')->nullable();
$table->string('budget_conditions')->nullable();
$table->decimal('surgery_limit', 15, 2)->nullable();
$table->decimal('non_surgery_limit', 15, 2)->nullable();
$table->decimal('max_claim_limit', 15, 2)->nullable();
$table->integer('max_claim_count')->nullable();
$table->boolean('area_limit')->nullable();
$table->string('limit_shared_plans')->nullable();
$table->string('limit_shared_plan_type')->nullable();
$table->tinyInteger('cashless_percentage')->default(100)->nullable();
$table->tinyInteger('reimbursement_percentage')->default(100)->nullable();
$table->tinyInteger('digital_percentage')->default(100)->nullable();
$table->tinyInteger('co_share_m_percentage')->default(100)->nullable();
$table->tinyInteger('co_share_s_percentage')->default(100)->nullable();
$table->tinyInteger('co_share_c_percentage')->default(100)->nullable();
$table->decimal('cashless_deductible', 15, 2)->nullable();
$table->decimal('reimbursement_deductible', 15, 2)->nullable();
$table->decimal('co_share_m_deductible', 15, 2)->nullable();
$table->decimal('co_share_s_eductible', 15, 2)->nullable();
$table->decimal('co_share_c_eductible', 15, 2)->nullable();
$table->string('co_share_deductible_condition')->nullable();
$table->string('msc')->nullable();
$table->string('genders')->nullable();
$table->string('min_age')->nullable();
$table->string('max_age')->nullable();
$table->string('rule_of_excess')->nullable();
$table->string('max_excess_covered')->nullable();
$table->string('prorate_type')->nullable();
$table->string('prorate_lookup')->nullable();
$table->string('currency')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreignId('created_by')->nullable()->index();
$table->foreignId('updated_by')->nullable()->index();
$table->foreignId('deleted_by')->nullable()->index();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('plans');
}
};

View File

@@ -0,0 +1,40 @@
<?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('services', function (Blueprint $table) {
$table->id();
$table->string('code')->index();
$table->string('name');
$table->text('description')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreignId('created_by')->nullable()->index();
$table->foreignId('updated_by')->nullable()->index();
$table->foreignId('deleted_by')->nullable()->index();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('services');
}
};

View File

@@ -0,0 +1,89 @@
<?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_benefits', function (Blueprint $table) {
$table->id();
$table->string('service_code')->index()->nullable();
$table->string('plan_code')->index()->nullable();
$table->string('benefit_code')->index()->nullable();
$table->text('description')->nullable();
$table->string('budget')->nullable();
$table->string('budget_conditions')->nullable();
$table->string('budget_code')->nullable();
$table->string('primary_benefit_code')->index()->nullable();
$table->string('room_class_coverage')->nullable();
$table->string('max_bed_coverage')->nullable();
$table->string('tolerance_parameter')->nullable();
$table->string('max_room_class')->nullable();
$table->decimal('limit_amount', 15, 2)->nullable();
$table->boolean('area_limit')->default(false)->nullable();
$table->string('shared_benefit')->nullable();
$table->string('msc')->nullable();
$table->string('genders')->nullable();
$table->string('min_age')->nullable();
$table->string('max_age')->nullable();
$table->string('max_frequency_period')->nullable();
$table->string('daily_frequency')->nullable();
$table->string('weekly_frequency')->nullable();
$table->string('monthly_frequency')->nullable();
$table->string('custom_frequency_days')->nullable();
$table->string('custom_duration_value')->nullable();
$table->string('allowed_transaction_types')->nullable();
$table->string('high_plan_factor')->nullable();
$table->boolean('pre_post_treatment')->nullable();
$table->string('pre_treatment_days')->nullable();
$table->string('post_treatment_days')->nullable();
$table->string('layer_type_1')->nullable();
$table->string('layer_value_1')->nullable();
$table->string('layer_type_2')->nullable();
$table->string('layer_value_2')->nullable();
$table->tinyInteger('cashless_percentage')->default(100)->nullable();
$table->tinyInteger('reimbursement_percentage')->default(100)->nullable();
$table->tinyInteger('digital_percentage')->default(100)->nullable();
$table->tinyInteger('co_share_m_percentage')->default(100)->nullable();
$table->tinyInteger('co_share_s_percentage')->default(100)->nullable();
$table->tinyInteger('co_share_c_percentage')->default(100)->nullable();
$table->decimal('cashless_deductible', 15, 2)->nullable();
$table->decimal('reimbursement_deductible', 15, 2)->nullable();
$table->decimal('co_share_m_deductible', 15, 2)->nullable();
$table->decimal('co_share_s_deductible', 15, 2)->nullable();
$table->decimal('co_share_c_deductible', 15, 2)->nullable();
$table->string('prorate_type')->nullable();
$table->string('prorate_lookup')->nullable();
$table->string('max_days_for_disability')->nullable();
$table->string('max_period_for_disability')->nullable();
$table->string('currency')->nullable();
$table->string('show_benefit_item')->nullable();
$table->string('show_benefit_value')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreignId('created_by')->nullable()->index();
$table->foreignId('updated_by')->nullable()->index();
$table->foreignId('deleted_by')->nullable()->index();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('member_benefits');
}
};

View File

@@ -0,0 +1,45 @@
<?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('import_logs', function (Blueprint $table) {
$table->uuid();
$table->morphs('importable');
$table->string('type')->nullable();
$table->string('file_path')->nullable();
$table->string('status')->nullable();
$table->string('progress')->nullable()->default(0);
$table->timestamps();
$table->softDeletes();
$table->foreignId('created_by')->nullable()->index();
$table->foreignId('updated_by')->nullable()->index();
$table->foreignId('deleted_by')->nullable()->index();
$table->index(['importable_id', 'importable_type']);
$table->index(['importable_id', 'importable_type', 'type']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('import_logs');
}
};

View File

@@ -0,0 +1,46 @@
<?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('files', function (Blueprint $table) {
$table->id();
$table->morphs('fileable');
$table->string('type')->nullable();
$table->string('name')->nullable();
$table->string('extension')->nullable();
$table->string('path')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreignId('created_by')->nullable()->index();
$table->foreignId('updated_by')->nullable()->index();
$table->foreignId('deleted_by')->nullable()->index();
$table->index(['fileable_id', 'fileable_type']);
$table->index(['fileable_id', 'fileable_type', 'type']);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('files');
}
};

View File

@@ -0,0 +1,50 @@
<?php
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class BenefitSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$listOfBenefit = [
[
"service_code" => 'OP',
"code" => "GP",
"name" => "General Practitioner",
"description" => "Consultation With General Practitioner"
],
[
"service_code" => 'OP',
"code" => "GP",
"name" => "General Practitioner",
"description" => "Consultation With General Practitioner"
],
[
"service_code" => 'OP',
"code" => "GP",
"name" => "General Practitioner",
"description" => "Consultation With General Practitioner"
],
[
"service_code" => 'OP',
"code" => "GP",
"name" => "General Practitioner",
"description" => "Consultation With General Practitioner"
],
[
"service_code" => 'OP',
"code" => "GP",
"name" => "General Practitioner",
"description" => "Consultation With General Practitioner"
],
];
}
}

View File

@@ -2,6 +2,8 @@
namespace Database\Seeders;
use App\Models\User;
use Hash;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
@@ -14,6 +16,9 @@ class DummyMemberSeeder extends Seeder
*/
public function run()
{
//
User::create([
'email' => 'admin@linksehat.dev',
'password' => Hash::make('password')
]);
}
}