mirror of
https://gitlab.com/uldvstar/exchange-2.0.git
synced 2026-08-19 04:24:16 +00:00
List Currency Rate Logic Class
Fetch Currency Rate Logic Class Create Currency Rate Logic Class Update Currency Rate Logic Class Currency Rate Converter Rate
This commit is contained in:
@@ -20,7 +20,6 @@ class CreateCurrenciesTable extends Migration
|
||||
$table->string('name')->nullable();
|
||||
$table->string('short_code')->nullable();
|
||||
$table->string('symbol')->nullable();
|
||||
$table->decimal('selling', 20, 5)->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Classes\ValueObjects\Constants\CurrencyType;
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
@@ -19,7 +19,7 @@ class CreateCurrencyRatesTable extends Migration
|
||||
$table->bigInteger('currency_id')->unsigned()->nullable();
|
||||
$table->foreign('currency_id')->references('id')->on('currencies')->onDelete('cascade');
|
||||
$table->decimal('selling', 20, 5)->nullable();
|
||||
$table->integer('currency_type')->default(CurrencyType::CASH);
|
||||
$table->integer('payment_method_type')->default(PaymentMethodType::CASH);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
|
||||
@@ -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 currency_rate', 'guard_name' => 'web']);
|
||||
Permission::create(['name' => 'add currency_rate', 'guard_name' => 'web']);
|
||||
Permission::create(['name' => 'edit currency_rate', 'guard_name' => 'web']);
|
||||
Permission::create(['name' => 'delete currency_rate', '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']);
|
||||
|
||||
@@ -19,7 +19,6 @@ class CurrenciesTableSeeder extends Seeder
|
||||
'name' => 'Ringgit',
|
||||
'short_code' => 'MYR',
|
||||
'symbol' => 'RM',
|
||||
'selling' => 1,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
@@ -29,7 +28,6 @@ class CurrenciesTableSeeder extends Seeder
|
||||
'name' => 'Renminbi',
|
||||
'short_code' => 'RMB',
|
||||
'symbol' => '¥',
|
||||
'selling' => 0.62,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
use App\Classes\ValueObjects\Constants\PaymentMethodType;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class CurrencyRatesTableSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
DB::table('currency_rates')->insert([
|
||||
[
|
||||
'currency_id' => 1,
|
||||
'selling' => 1,
|
||||
'payment_method_type' => PaymentMethodType::CASH,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'currency_id' => 1,
|
||||
'selling' => 1.1,
|
||||
'payment_method_type' => PaymentMethodType::CHEQUE,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'currency_id' => 2,
|
||||
'selling' => 0.62,
|
||||
'payment_method_type' => PaymentMethodType::CASH,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
],
|
||||
[
|
||||
'currency_id' => 2,
|
||||
'selling' => 0.70,
|
||||
'payment_method_type' => PaymentMethodType::CHEQUE,
|
||||
'created_at' => date('Y-m-d H:i:s'),
|
||||
'updated_at' => date('Y-m-d H:i:s')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,8 @@ class DatabaseSeeder extends Seeder
|
||||
//General
|
||||
$this->call(CountriesTableSeeder::class);
|
||||
$this->call(CurrenciesTableSeeder::class);
|
||||
$this->call(CurrencyRatesTableSeeder::class);
|
||||
|
||||
$this->call(StatesTableSeeder::class);
|
||||
$this->call(DistrictsTableSeeder::class);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user