Style fixes
This commit is contained in:
@@ -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'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -92,7 +92,7 @@ class Airport extends Model
|
||||
{
|
||||
return Attribute::make(
|
||||
set: fn ($icao) => [
|
||||
'id' => strtoupper($icao),
|
||||
'id' => strtoupper($icao),
|
||||
'icao' => strtoupper($icao),
|
||||
]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user