Skip to content

Commit e7b2f14

Browse files
Fix/missing character info maintenance (#666)
* feat: Add GetMissingCharacterInfos job to handle missing character information It could happen that refresh_tokens were present but the character was not. This may cause errors This addresses #665 * fix: Update database port configuration in phpunit.xml and tests.yml * lint * refactor: Improve type handling and data retrieval in asset and transaction finders * refactor: Improve formatting of callback function in ThroughWalletTransactionsFinder
1 parent 8a42bc3 commit e7b2f14

55 files changed

Lines changed: 188 additions & 129 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
coverage: xdebug #optional
2222
- uses: getong/mariadb-action@v1.1
2323
with:
24-
host port: 3308 # Optional, default value is 3306. The port of host
24+
host port: 3306 # Optional, default value is 3306. The port of host
2525
#container port: 3307 # Optional, default value is 3306. The port of container
2626
#character set server: 'utf8' # Optional, default value is 'utf8mb4'. The '--character-set-server' option for mysqld
2727
#collation server: 'utf8_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld

database/factories/AssetFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class AssetFactory extends Factory
3838
public function definition()
3939
{
4040
return [
41-
'assetable_id' => $this->faker->numberBetween(), //factory(CharacterInfo::class),
42-
'assetable_type' => CharacterInfo::class, //$this->faker->randomElement([CharacterInfo::class, CorporationInfo::class]),
41+
'assetable_id' => $this->faker->numberBetween(), // factory(CharacterInfo::class),
42+
'assetable_type' => CharacterInfo::class, // $this->faker->randomElement([CharacterInfo::class, CorporationInfo::class]),
4343
'item_id' => $this->faker->unique()->randomNumber(),
4444
'is_blueprint_copy' => false,
4545
'is_singleton' => $this->faker->boolean,

database/factories/CharacterInfoFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function definition()
5757
return [
5858
'character_id' => $this->faker->unique()->numberBetween(9000000, 98000000),
5959
'name' => $this->faker->name,
60-
//'corporation_id' => $this->faker->numberBetween(98000000, 99000000),
60+
// 'corporation_id' => $this->faker->numberBetween(98000000, 99000000),
6161
'birthday' => $this->faker->iso8601('now'),
6262
'gender' => $this->faker->randomElement(['male', 'female']),
6363
'race_id' => $this->faker->randomDigitNotNull,

database/factories/ContractFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function definition()
5050
'status' => $this->faker->randomElement(['outstanding', 'in_progress', 'finished_issuer', 'finished_contractor', 'finished', 'cancelled', 'rejected', 'failed', 'deleted', 'reversed']),
5151
'type' => $this->faker->randomElement(['unknown', 'item_exchange', 'auction', 'courier', 'loan']),
5252

53-
//optionals
53+
// optionals
5454
'buyout' => $this->faker->randomFloat(),
5555
'collateral' => $this->faker->randomFloat(),
5656
'date_accepted' => carbon()->addHour(),

database/migrations/2019_09_18_185641_create_corporation_infosTable.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
public function up()
3939
{
4040
Schema::create('corporation_infos', function (Blueprint $table) {
41-
$table->bigIncrements('corporation_id'); //req
42-
$table->string('ticker'); //req
43-
$table->string('name'); //req
44-
$table->bigInteger('member_count'); //req
45-
$table->bigInteger('ceo_id'); //req
46-
$table->bigInteger('creator_id'); //req
47-
$table->float('tax_rate', 10, 2); //req
41+
$table->bigIncrements('corporation_id'); // req
42+
$table->string('ticker'); // req
43+
$table->string('name'); // req
44+
$table->bigInteger('member_count'); // req
45+
$table->bigInteger('ceo_id'); // req
46+
$table->bigInteger('creator_id'); // req
47+
$table->float('tax_rate', 10, 2); // req
4848

4949
$table->bigInteger('alliance_id')->nullable();
5050
$table->dateTime('date_founded')->nullable();

database/migrations/2025_01_02_185356_fix_killmail_items_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
use Illuminate\Database\Migrations\Migration;
44
use Illuminate\Database\Schema\Blueprint;
5-
use Illuminate\Support\Facades\Schema;
65
use Illuminate\Support\Facades\DB;
6+
use Illuminate\Support\Facades\Schema;
77

88
return new class extends Migration
99
{

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<env name="REDIS_PASSWORD" value="null"/>
1818
<env name="REDIS_PORT" value="6379"/>
1919
<env name="DB_HOST" value="127.0.0.1"/>
20-
<env name="DB_PORT" value="3308"/>
20+
<env name="DB_PORT" value="3306"/>
2121
<env name="DB_DATABASE" value="testbench"/>
2222
<env name="DB_USERNAME" value="default"/>
2323
<env name="DB_PASSWORD" value="secret"/>

src/Commands/CheckJobsCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function handle(): int
8787
->each(function (array $job) {
8888
// check if any assertion failed
8989
if ($job['status'] === 'error') {
90-
//$this->writeAssertionOutput(get_class($job), 'px-2', '<span class="px-2 bg-red text-gray-400 uppercase">error</span>');
90+
// $this->writeAssertionOutput(get_class($job), 'px-2', '<span class="px-2 bg-red text-gray-400 uppercase">error</span>');
9191
$this->writeAssertionHeader($job['class'], 'px-2 bg-red text-gray-400 uppercase', 'error');
9292
} elseif ($job['status'] === 'warning') {
9393
$this->writeAssertionHeader($job['class'], 'px-2 bg-yellow text-gray-400 uppercase', 'warning');

src/EveapiServiceProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class EveapiServiceProvider extends ServiceProvider
7171

7272
public function boot(): void
7373
{
74-
//Add Migrations
74+
// Add Migrations
7575
$this->loadMigrationsFrom(__DIR__.'/../database/migrations/');
7676

7777
// Configure the queue dashboard
@@ -149,7 +149,7 @@ public function configureHorizon(): void
149149
'processes' => (int) env(self::QUEUE_BALANCING_WORKERS, 4),
150150
'block_for' => 5,
151151
'timeout' => 120, // 2 minutes
152-
'nice' => 10, //Allowed values are between 0 and 19
152+
'nice' => 10, // Allowed values are between 0 and 19
153153
'maxTime' => 3600,
154154
'maxJobs' => 1000,
155155
],
@@ -162,7 +162,7 @@ public function configureHorizon(): void
162162
'minProcesses' => 1,
163163
'maxProcesses' => (int) env(self::QUEUE_BALANCING_WORKERS, 4),
164164
'tries' => 1,
165-
'nice' => 10, //Allowed values are between 0 and 19
165+
'nice' => 10, // Allowed values are between 0 and 19
166166
'timeout' => 900, // 15 minutes
167167
'maxTime' => 3600,
168168
'maxJobs' => 1000,
@@ -204,7 +204,7 @@ private function addEventListeners(): void
204204
Type::observe(TypeObserver::class);
205205
Group::observe(GroupObserver::class);
206206

207-
//Character Observers
207+
// Character Observers
208208
CharacterInfo::observe(CharacterInfoObserver::class);
209209
}
210210

@@ -237,7 +237,7 @@ private function addSchedules(): void
237237
});
238238

239239
// Run Character Affiliation Job every five minutes to updated outdated affiliations.
240-
//$schedule->job(new CharacterAffiliationJob)->everyFiveMinutes();
240+
// $schedule->job(new CharacterAffiliationJob)->everyFiveMinutes();
241241
$schedule->call(new RefreshCharacterAffiliationsService)->everyFiveMinutes();
242242

243243
// Cleanup Batches Table

src/Jobs/Contracts/CharacterContractsJob.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function executeJob(): void
105105
'status' => $contract->status,
106106
'type' => $contract->type,
107107

108-
//optionals
108+
// optionals
109109
'buyout' => optional($contract)->buyout,
110110
'collateral' => optional($contract)->collateral,
111111
'date_accepted' => optional($contract)->date_accepted ? carbon(optional($contract)->date_accepted) : null,

0 commit comments

Comments
 (0)