diff --git a/app/Booking.php b/app/Booking.php index cffe157c..59c2d830 100644 --- a/app/Booking.php +++ b/app/Booking.php @@ -24,7 +24,7 @@ class Booking extends Model "usd_book_bank_branch"); protected $fillable = ['term', 'rate_id', 'user_id', 'amount', 'account_name', 'account_num', 'bank_name', - 'bank_branch', 'company_name']; + 'bank_branch', 'company_name' , 'estimated_arrival_time']; public $timestamps = true; diff --git a/app/SettingCredit.php b/app/SettingCredit.php index 872fec8e..5d567ab3 100644 --- a/app/SettingCredit.php +++ b/app/SettingCredit.php @@ -6,5 +6,5 @@ use Illuminate\Database\Eloquent\Model; class SettingCredit extends Model { - protected $fillable = ['rmb_credit_limit','usd_credit_limit']; + protected $fillable = ['rmb_credit_limit','usd_credit_limit','time_limit']; } diff --git a/database/factories/SettingCreditFactory.php b/database/factories/SettingCreditFactory.php index 2eb3fafc..f1d4eeba 100644 --- a/database/factories/SettingCreditFactory.php +++ b/database/factories/SettingCreditFactory.php @@ -5,6 +5,7 @@ use Faker\Generator as Faker; $factory->define(App\SettingCredit::class, function (Faker $faker) { return [ 'rmb_credit_limit' => $faker->randomDigit, - 'usd_credit_limit' => $faker->randomDigit + 'usd_credit_limit' => $faker->randomDigit, + 'time_limit' => $faker->randomDigit ]; }); diff --git a/database/migrations/2018_06_25_101043_add_time_limit_setting_credit_table.php b/database/migrations/2018_06_25_101043_add_time_limit_setting_credit_table.php new file mode 100644 index 00000000..4e0aefef --- /dev/null +++ b/database/migrations/2018_06_25_101043_add_time_limit_setting_credit_table.php @@ -0,0 +1,32 @@ +integer('time_limit'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('setting_credits', function (Blueprint $table) { + // $table->dropColumn('time_limit'); + }); + } +} \ No newline at end of file diff --git a/database/migrations/2018_06_26_031229_add_eta_booking_table.php b/database/migrations/2018_06_26_031229_add_eta_booking_table.php new file mode 100644 index 00000000..460f269d --- /dev/null +++ b/database/migrations/2018_06_26_031229_add_eta_booking_table.php @@ -0,0 +1,32 @@ +integer('estimated_arrival_time'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('bookings', function (Blueprint $table) { + // $table->dropColumn('estimated_arrival_time'); + }); + } +} diff --git a/tests/Feature/BookingTest.php b/tests/Feature/BookingTest.php index c44ed4b5..9d278b54 100644 --- a/tests/Feature/BookingTest.php +++ b/tests/Feature/BookingTest.php @@ -69,7 +69,8 @@ class BookingTest extends TestCase 'usd_book_swift_code' => '2131rew', 'usd_book_cnap' => '2131rew', 'usd_book_bank_branch' => '2131rew', - 'verification_status' => '1' + 'verification_status' => '1', + 'estimated_arrival_time' => '123' ]); if(14000 > $this->setting_credit->rmb_credit_limit){