big commit

This commit is contained in:
omair saleh
2021-03-22 08:46:33 +08:00
parent 307aff1c3f
commit 9fe0757baf
75 changed files with 2587 additions and 425 deletions
@@ -1,6 +1,7 @@
<?php
use App\Classes\ValueObjects\Constants\AccountStatus;
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
@@ -20,7 +21,7 @@ class CreateCompaniesTable extends Migration
$table->bigInteger('reference_no')->unique();
$table->string('name');
$table->integer('type')->comment('business type eg. personal, company');
$table->integer('status')->default(AccountStatus::PENDING_VERIFICATION);
$table->integer('status')->default(ApprovalStatus::PENDING_SUBMISSION);
$table->timestamps();
$table->softDeletes();
});
@@ -0,0 +1,43 @@
<?php
use App\Classes\ValueObjects\Constants\ApprovalStatus;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateDocumentsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('documents', function (Blueprint $table) {
$table->id();
$table->morphs('owner');
$table->string('document_type');
$table->string('reference')->nullable();
$table->integer('status')->default(ApprovalStatus::PENDING_VERIFICATION);
$table->bigInteger('approved_by')->unsigned()->nullable();
$table->timestamp('issued_date')->nullable();
$table->timestamp('expired_date')->nullable();
$table->timestamp('approved_date')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreign('approved_by')->references('id')->on('users')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('documents');
}
}
@@ -0,0 +1,37 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFilesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('files', function (Blueprint $table) {
$table->id();
$table->bigInteger('document_id')->unsigned();
$table->text('file');
$table->timestamps();
$table->softDeletes();
$table->foreign('document_id')->references('id')->on('documents')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('files');
}
}