Create Booking Logic Class

Update Booking Logic Class
 Delete Booking Logic Class
This commit is contained in:
CheeSiong
2020-12-04 09:49:47 +08:00
parent a0e2632b54
commit c3f153fe4b
26 changed files with 1019 additions and 1 deletions
@@ -0,0 +1,46 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBookingsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('bookings', function (Blueprint $table) {
$table->id();
$table->bigInteger('company_id')->unsigned()->nullable();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->bigInteger('transferable_bank_id')->unsigned()->nullable();
$table->foreign('transferable_bank_id')->references('id')->on('company_banks')->onDelete('cascade');
$table->string('marking');
$table->string('reference');
$table->float('fix_amount', 20, 5)->nullable();
$table->bigInteger('fix_currency_id')->unsigned()->nullable();
$table->foreign('fix_currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->bigInteger('convertible_currency_id')->unsigned()->nullable();
$table->foreign('convertible_currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->bigInteger('conversion_currency_id')->unsigned()->nullable();
$table->foreign('conversion_currency_id')->references('id')->on('currencies')->onDelete('cascade');
$table->integer('status')->default(1);
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('bookings');
}
}
@@ -54,6 +54,11 @@ class AdminUserPermissionsTableSeeder extends Seeder
Permission::create(['name' => 'edit currency', 'guard_name' => 'web']);
Permission::create(['name' => 'delete currency', 'guard_name' => 'web']);
Permission::create(['name' => 'view booking', 'guard_name' => 'web']);
Permission::create(['name' => 'add booking', 'guard_name' => 'web']);
Permission::create(['name' => 'edit booking', 'guard_name' => 'web']);
Permission::create(['name' => 'delete booking', 'guard_name' => 'web']);
///////////////////////////////////////////////////////////////////////
$shadow_admin_role = Role::create([
@@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Seeder;
use Illuminate\Support\Str;
class CompanyBanksTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
DB::table('company_banks')->insert([
[
'id' => 1,
'country_id' => 1,
'bank_name' => '12345678',
'holder_name' => '12345678',
'account_no' => '12345678',
'type' => 1,
'default' => 1,
'status' => 1,
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s')
]
]);
}
}
+1
View File
@@ -23,6 +23,7 @@ class DatabaseSeeder extends Seeder
$this->call(SegmentConstantsTableSeeder::class);
$this->call(CompaniesTableSeeder::class);
$this->call(CompanyBanksTableSeeder::class);
// Admin
$this->call(AdminUserTableSeeder::class);