* SimBrief integration #405 * Add briefing as API response; add acars_xml field #405
This commit is contained in:
21
app/Database/factories/SimbriefFactory.php
Normal file
21
app/Database/factories/SimbriefFactory.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Factory $factory */
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\SimBrief::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => $faker->unique()->numberBetween(10, 10000000),
|
||||
'user_id' => null,
|
||||
'flight_id' => null,
|
||||
'pirep_id' => null,
|
||||
'acars_xml' => '',
|
||||
'ofp_xml' => '',
|
||||
'created_at' => Carbon::now('UTC')->toDateTimeString(),
|
||||
'updated_at' => function (array $sb) {
|
||||
return $sb['created_at'];
|
||||
},
|
||||
];
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* Add a table to store the Simbrief data
|
||||
*/
|
||||
class AddSimbriefTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('simbrief', function (Blueprint $table) {
|
||||
$table->string('id', 36); // The OFP ID
|
||||
$table->unsignedInteger('user_id');
|
||||
$table->string('flight_id', 36)->nullable();
|
||||
$table->string('pirep_id', 36)->nullable();
|
||||
$table->mediumText('acars_xml');
|
||||
$table->mediumText('ofp_xml');
|
||||
$table->timestamps();
|
||||
|
||||
$table->primary('id');
|
||||
$table->index(['user_id', 'flight_id']);
|
||||
$table->index('pirep_id');
|
||||
$table->unique('pirep_id'); // Can only belong to a single PIREP
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::drop('simbrief');
|
||||
}
|
||||
}
|
||||
1
app/Database/seeds/dev/.gitignore
vendored
Normal file
1
app/Database/seeds/dev/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
local.yml
|
||||
@@ -152,6 +152,20 @@
|
||||
options: ''
|
||||
type: number
|
||||
description: 'How much the load factor can vary per-flight'
|
||||
- key: simbrief.api_key
|
||||
name: 'SimBrief API Key'
|
||||
group: simbrief
|
||||
value: ''
|
||||
options: ''
|
||||
type: string
|
||||
description: 'Your SimBrief API key'
|
||||
- key: simbrief.expire_days
|
||||
name: 'SimBrief Expire Time'
|
||||
group: simbrief
|
||||
value: 5
|
||||
options: ''
|
||||
type: number
|
||||
description: 'Days after how long to remove unused briefs'
|
||||
- key: pireps.duplicate_check_time
|
||||
name: 'PIREP duplicate time check'
|
||||
group: pireps
|
||||
|
||||
Reference in New Issue
Block a user