modified public contracts to show the region the public contract is in.

This commit is contained in:
2020-05-14 22:15:35 -05:00
parent 2a08fd71a2
commit 5d12167324
3 changed files with 3 additions and 0 deletions

View File

@@ -58,6 +58,7 @@ class GetPublicContractsJob implements ShouldQueue
])->count();
if($count == 0) {
$pub = new PublicContract;
$pub->region_id = $this->region;
if(isset($resp->buyout)) {
$pub->buyout = $resp->buyout;
}

View File

@@ -18,6 +18,7 @@ class PublicContract extends Model
* @var array
*/
protected $fillable = [
'region_id',
'buyout',
'collateral',
'contract_id',

View File

@@ -16,6 +16,7 @@ class CreateBuyPublicContractsTable extends Migration
if(!Schema::hasTable('public_contracts')) {
Schema::create('public_contracts', function(Blueprint $table) {
$table->unsignedBigIncrements('id');
$table->unsignedBigInteger('region_id');
$table->decimal('buyout', 17,2 )->nullable();
$table->decimal('collateral', 17, 2)->nullable();
$table->unsignedInteger('contract_id');