Compare commits

...
Author SHA1 Message Date
snyk-bot 5ef02d03b5 fix: package.json & package-lock.json to reduce vulnerabilities
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-JS-MOMENT-2944238
2022-07-07 18:00:57 +00:00
Nabeel Shahzad ca1cd01f3d Style fixes 2022-03-28 13:55:42 -04:00
Nabeel Shahzad e2226b7400 Make sure fare is set to active 2022-03-28 13:23:27 -04:00
Nabeel Shahzad 991f661144 Don't map local env to dev so dev seeds won't run 2022-03-24 16:55:21 -04:00
14 changed files with 37 additions and 35 deletions
+3 -3
View File
@@ -33,8 +33,8 @@ class AircraftFactory extends Factory
{
return [
'id' => null,
'subfleet_id' => fn () => Subfleet::factory()->create()->id,
'airport_id' => fn () => Airport::factory()->create()->id,
'subfleet_id' => fn () => Subfleet::factory()->create()->id,
'airport_id' => fn () => Airport::factory()->create()->id,
'iata' => $this->faker->unique()->text(5),
'icao' => $this->faker->unique()->text(5),
'name' => $this->faker->text(50),
@@ -45,7 +45,7 @@ class AircraftFactory extends Factory
'status' => AircraftStatus::ACTIVE,
'state' => AircraftState::PARKED,
'created_at' => $this->faker->dateTimeBetween('-1 week')->format(DateTime::ATOM),
'updated_at' => fn (array $pirep) => $pirep['created_at'],
'updated_at' => fn (array $pirep) => $pirep['created_at'],
];
}
}
+1 -1
View File
@@ -32,7 +32,7 @@ class AirlineFactory extends Factory
return $hashids->encode($mt);
},
'iata' => fn (array $apt) => $apt['icao'],
'iata' => fn (array $apt) => $apt['icao'],
'name' => $this->faker->sentence(3),
'country' => $this->faker->country,
'active' => 1,
+2 -2
View File
@@ -55,8 +55,8 @@ class AirportFactory extends Factory
return $airport;
},
'icao' => fn (array $apt) => $apt['id'],
'iata' => fn (array $apt) => $apt['id'],
'icao' => fn (array $apt) => $apt['id'],
'iata' => fn (array $apt) => $apt['id'],
'name' => $this->faker->sentence(3),
'country' => $this->faker->country,
'timezone' => $this->faker->timezone,
+1 -1
View File
@@ -28,7 +28,7 @@ class FareFactory extends Factory
'code' => $this->faker->unique()->text(50),
'name' => $this->faker->text(50),
'price' => $this->faker->randomFloat(2, 100, 1000),
'cost' => fn (array $fare) => round($fare['price'] / 2),
'cost' => fn (array $fare) => round($fare['price'] / 2),
'capacity' => $this->faker->randomFloat(0, 20, 500),
];
}
+4 -4
View File
@@ -26,15 +26,15 @@ class FlightFactory extends Factory
{
return [
'id' => $this->faker->unique()->numberBetween(10, 10000000),
'airline_id' => fn () => \App\Models\Airline::factory()->create()->id,
'airline_id' => fn () => \App\Models\Airline::factory()->create()->id,
'flight_number' => $this->faker->unique()->numberBetween(10, 1000000),
'route_code' => $this->faker->randomElement(['', $this->faker->text(5)]),
'route_leg' => $this->faker->randomElement(
['', $this->faker->numberBetween(0, 1000)]
),
'dpt_airport_id' => static fn () => \App\Models\Airport::factory()->create()->id,
'arr_airport_id' => static fn () => \App\Models\Airport::factory()->create()->id,
'alt_airport_id' => static fn () => \App\Models\Airport::factory()->create()->id,
'dpt_airport_id' => static fn () => \App\Models\Airport::factory()->create()->id,
'arr_airport_id' => static fn () => \App\Models\Airport::factory()->create()->id,
'alt_airport_id' => static fn () => \App\Models\Airport::factory()->create()->id,
'distance' => $this->faker->numberBetween(1, 1000),
'route' => null,
'level' => 0,
@@ -28,7 +28,7 @@ class JournalTransactionsFactory extends Factory
{
return [
'transaction_group' => Uuid::uuid4()->toString(),
'journal_id' => fn () => Journal::factory()->create()->id,
'journal_id' => fn () => Journal::factory()->create()->id,
'credit' => $this->faker->numberBetween(100, 10000),
'debit' => $this->faker->numberBetween(100, 10000),
'currency' => 'USD',
+10 -10
View File
@@ -37,15 +37,15 @@ class PirepFactory extends Factory
return [
'id' => $this->faker->unique()->numberBetween(10, 10000000),
'airline_id' => fn () => $airline->id,
'user_id' => fn () => \App\Models\User::factory()->create()->id,
'aircraft_id' => fn () => \App\Models\Aircraft::factory()->create()->id,
'flight_id' => fn () => $flight->id,
'flight_number' => fn () => $flight->flight_number,
'airline_id' => fn () => $airline->id,
'user_id' => fn () => \App\Models\User::factory()->create()->id,
'aircraft_id' => fn () => \App\Models\Aircraft::factory()->create()->id,
'flight_id' => fn () => $flight->id,
'flight_number' => fn () => $flight->flight_number,
'route_code' => null,
'route_leg' => null,
'dpt_airport_id' => fn () => $flight->dpt_airport_id,
'arr_airport_id' => fn () => $flight->arr_airport_id,
'dpt_airport_id' => fn () => $flight->dpt_airport_id,
'arr_airport_id' => fn () => $flight->arr_airport_id,
'level' => $this->faker->numberBetween(20, 400),
'distance' => $this->faker->randomFloat(2, 0, 6000),
'planned_distance' => $this->faker->randomFloat(2, 0, 6000),
@@ -53,9 +53,9 @@ class PirepFactory extends Factory
'planned_flight_time' => $this->faker->numberBetween(60, 360),
'zfw' => $this->faker->randomFloat(2),
'block_fuel' => $this->faker->randomFloat(2, 0, 1000),
'fuel_used' => fn (array $pirep) => round($pirep['block_fuel'] * .9, 2),
'fuel_used' => fn (array $pirep) => round($pirep['block_fuel'] * .9, 2),
'block_on_time' => Carbon::now('UTC'),
'block_off_time' => fn (array $pirep) => $pirep['block_on_time']->subMinutes(
'block_off_time' => fn (array $pirep) => $pirep['block_on_time']->subMinutes(
$pirep['flight_time']
),
'route' => $this->faker->text(200),
@@ -68,7 +68,7 @@ class PirepFactory extends Factory
'status' => PirepStatus::SCHEDULED,
'submitted_at' => Carbon::now('UTC')->toDateTimeString(),
'created_at' => Carbon::now('UTC')->toDateTimeString(),
'updated_at' => fn (array $pirep) => $pirep['created_at'],
'updated_at' => fn (array $pirep) => $pirep['created_at'],
];
}
}
+1 -1
View File
@@ -25,7 +25,7 @@ class SubfleetFactory extends Factory
{
return [
'id' => null,
'airline_id' => fn () => \App\Models\Airline::factory()->create()->id,
'airline_id' => fn () => \App\Models\Airline::factory()->create()->id,
'name' => $this->faker->unique()->text(50),
'type' => $this->faker->unique()->text(7),
'ground_handling_multiplier' => $this->faker->numberBetween(50, 200),
+1 -1
View File
@@ -42,7 +42,7 @@ class UserFactory extends Factory
'email' => $this->faker->safeEmail,
'password' => self::$password,
'api_key' => $this->faker->sha1,
'airline_id' => fn () => Airline::factory()->create()->id,
'airline_id' => fn () => Airline::factory()->create()->id,
'rank_id' => 1,
'flights' => $this->faker->numberBetween(0, 1000),
'flight_time' => $this->faker->numberBetween(0, 10000),
+1 -1
View File
@@ -92,7 +92,7 @@ class Airport extends Model
{
return Attribute::make(
set: fn ($icao) => [
'id' => strtoupper($icao),
'id' => strtoupper($icao),
'icao' => strtoupper($icao),
]
);
+3
View File
@@ -169,6 +169,9 @@ class FareService extends Service
}
}
$fare->notes = '';
$fare->active = true;
return $fare;
}
-1
View File
@@ -22,7 +22,6 @@ class SeederService extends Service
// Map an environment to a seeder directory, if we want to share
public static $seed_mapper = [
'local' => 'dev',
'production' => 'prod',
];
+8 -8
View File
@@ -1,5 +1,5 @@
{
"name": "phpvms",
"name": "npm-proj-1657216851405-0.012261156466591983eHj4UH",
"lockfileVersion": 2,
"requires": true,
"packages": {
@@ -31,7 +31,7 @@
"lodash": ">=4.17.19",
"marked": "^2.1.3",
"minimist": "^1.2.2",
"moment": "^2.29.1",
"moment": "^2.29.4",
"paper-dashboard": "^1.1.0",
"pe7-icon": "^1.0.4",
"pikaday": "^1.8.2",
@@ -8914,9 +8914,9 @@
}
},
"node_modules/moment": {
"version": "2.29.1",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
"integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==",
"version": "2.29.4",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
"integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==",
"engines": {
"node": "*"
}
@@ -20904,9 +20904,9 @@
}
},
"moment": {
"version": "2.29.1",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz",
"integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ=="
"version": "2.29.4",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
"integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w=="
},
"moment-timezone": {
"version": "0.4.1",
+1 -1
View File
@@ -36,7 +36,7 @@
"lodash": ">=4.17.19",
"marked": "^2.1.3",
"minimist": "^1.2.2",
"moment": "^2.29.1",
"moment": "^2.29.4",
"paper-dashboard": "^1.1.0",
"pe7-icon": "^1.0.4",
"pikaday": "^1.8.2",