databases and models

This commit is contained in:
2026-03-10 02:10:28 -05:00
parent 2fabed958d
commit 31b825a5d5
31 changed files with 2653 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
namespace App\Models\Contracts;
use Illuminate\Database\Eloquent\Model;
class BattleContract extends Model
{
// Table Name
protected $table = 'battle_contracts';
//Primary Key
public $primaryKey = 'id';
// Timestamps
public $timestamps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'creator_id',
'creator_name',
'party_id',
'party_name',
'length',
'price',
'terms_conditions',
'stipulations',
'deliverables',
'validity',
];
}

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Models\Eve;
use Illuminate\Database\Eloquent\Model;
class WormholeType extends Model
{
// Table Name
protected $table = 'wormhole_types';
//Primary Key
public $primaryKey = 'id';
// Timestamps
public $timestamps = false;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'type',
'leads_to',
'mass_allowed',
'individual_mass',
'regeneration',
'max_stable_time',
];
}

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Models\Eve;
use Illuminate\Database\Eloquent\Model;
class WormholeTypes extends Model
{
// Table Name
protected $table = 'wormhole_types';
//Primary Key
public $primaryKey = 'id';
// Timestamps
public $timestamps = false;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'type',
'leads_to',
'mass_allowed',
'individual_mass',
'regeneration',
'max_stable_time',
];
}

View File

@@ -0,0 +1,38 @@
<?php
namespace App\Models\Eve;
use Illuminate\Database\Eloquent\Model;
class Wormholes extends Model
{
// Table Name
protected $table = 'wormholes';
//Primary Key
public $primaryKey = 'id';
// Timestamps
public $timestamps = false;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'system',
'sig_id',
'duration_left',
'dateTime',
'class',
'type',
'hole_size',
'stability',
'link',
'mass_allowed',
'individual_mass',
'regeneration',
'stable_time',
];
}

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Models\Finance;
use Illuminate\Database\Eloquent\Model;
class CharacterWallet extends Model
{
// Table Name
protected $table = '';
//Primary Key
public $primaryKey = '';
// Timestamps
public $timestamps = false;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
];
}

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Models\Finance;
use Illuminate\Database\Eloquent\Model;
class Contract extends Model
{
// Table Name
protected $table = '';
//Primary Key
public $primaryKey = '';
// Timestamps
public $timestamps = false;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
];
}

View File

@@ -0,0 +1,26 @@
<?php
namespace App\Models\Finance;
use Illuminate\Database\Eloquent\Model;
class CorporationWallet extends Model
{
// Table Name
protected $table = '';
//Primary Key
public $primaryKey = '';
// Timestamps
public $timestamps = false;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
];
}

View File

@@ -0,0 +1,29 @@
<?php
namespace App\Models\Finance;
use Illuminate\Database\Eloquent\Model;
class MiningTax extends Model
{
// Table Name
protected $table = 'mining_tax';
//Primary Key
public $primaryKey = 'id';
// Timestamps
public $timestamps = false;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'character_id',
'character_name',
'month_end',
'amount',
];
}

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Models\Finance;
use Illuminate\Database\Eloquent\Model;
class MoonMiningTax extends Model
{
// Table Name
protected $table = 'moon_mining_tax';
//Primary Key
public $primaryKey = 'id';
// Timestamps
public $timestamps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'moon_id',
'name',
'worth',
'tax_bracket',
'tax_amount',
'rental_end',
];
}

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Models\Lookup;
use Illuminate\Database\Eloquent\Model;
class AllianceLookup extends Model
{
// Table Name
protected $table = 'alliance_lookup';
//Primary Key
public $primaryKey = 'alliance_id';
// Timestamps
public $timestamps = false;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'alliance_id',
'creator_corporation_id',
'creator_id',
'date_founded',
'executor_corporation_id',
'faction_id',
'name',
'ticker',
];
}

View File

@@ -0,0 +1,38 @@
<?php
namespace App\Models\Lookup;
use Illuminate\Database\Eloquent\Model;
class CharacterLookup extends Model
{
// Table Name
protected $table = 'character_lookup';
//Primary Key
public $primaryKey = 'character_id';
// Timestamps
public $timestamps = false;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'character_id',
'alliance_id',
'ancestry_id',
'birthday',
'bloodline_id',
'corporation_id',
'description',
'faction_id',
'gender',
'name',
'race_id',
'security_status',
'title',
];
}

View File

@@ -0,0 +1,40 @@
<?php
namespace App\Models\Lookup;
use Illuminate\Database\Eloquent\Model;
class CorporationLookup extends Model
{
// Table Name
protected $table = 'corporation_lookup';
//Primary Key
public $primaryKey = 'corporation_id';
// Timestamps
public $timestamps = false;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'corporation_id',
'alliance_id',
'ceo_id',
'creator_id',
'date_founded',
'description',
'faction_id',
'home_station_id',
'member_count',
'name',
'shares',
'tax_rate',
'ticker',
'url',
'war_eligible',
];
}

View File

@@ -0,0 +1,40 @@
<?php
namespace App\Models\Lookup;
use Illuminate\Database\Eloquent\Model;
class ItemLookup extends Model
{
// Table Name
protected $table = 'item_lookup';
//Primary Key
public $primaryKey = 'item_id';
// Timestamps
public $timestamps = false;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'item_id',
'capacity',
'description',
'graphic_id',
'group_id',
'icon_id',
'market_group_id',
'mass',
'name',
'packaged_volume',
'portion_size',
'published',
'radius',
'type_id',
'volume',
];
}

View File

@@ -0,0 +1,42 @@
<?php
namespace App\Models\Lookup;
use Illuminate\Database\Eloquent\Model;
class MoonLookup extends Model
{
// Table Name
protected $table = 'moon_lookup';
//Primary Key
public $primaryKey = 'id';
// Timestamps
public $timestamps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'moon_id',
'moon_name',
'position_x',
'position_y',
'position_z',
'system_id',
'owned',
'sov_owner_id',
'sov_owner_name',
'system_id',
'system_name',
'moon_type',
'worth',
'owned',
'owner_id',
'owner_name',
'rental_amount',
];
}

View File

@@ -0,0 +1,30 @@
<?php
namespace App\Models\Mail;
use Illuminate\Database\Eloquent\Model;
class EveMail extends Model
{
// Table Name
protected $table = 'eve_mails';
//Primary Key
public $primaryKey = 'id';
// Timestamps
public $timestamps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'sender',
'recipient',
'recipient_type',
'subject',
'body',
];
}

View File

@@ -0,0 +1,30 @@
<?php
namespace App\Models\Mail;
use Illuminate\Database\Eloquent\Model;
class SentMail extends Model
{
// Table Name
protected $table = 'sent_mails';
//Primary Key
public $primaryKey = 'id';
// Timestamps
public $timestamps = false;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'sender',
'subject',
'body',
'recipient',
'recipient_type',
];
}

View File

@@ -0,0 +1,36 @@
<?php
namespace App\Models\Reports;
use Illuminate\Database\Eloquent\Model;
class AfterActionReport extends Model
{
// Table Name
protected $table = 'after_action_reports';
//Primary Key
public $primaryKey = 'id';
// Timestamps
public $timestamps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'fc_id',
'fc_name',
'formup_time',
'formup_location',
'doctrine',
'objective',
'result',
'summary',
'improvements',
'worked_well',
'additional_comments',
];
}

View File

@@ -0,0 +1,35 @@
<?php
namespace App\Models\Reports;
use Illuminate\Database\Eloquent\Model;
class Blacklist extends Model
{
// Table Name
protected $table = 'blacklist';
//Primary Key
public $primaryKey = 'id';
// Timestamps
public $timestamps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'entity_id',
'entity_name',
'entity_type',
'reason',
'lister_id',
'lister_name',
'state',
'removed_by_id',
'removed_by_name',
'removed_notes',
];
}

View File

@@ -0,0 +1,27 @@
<?php
namespace App\Models\SRP;
use Illuminate\Database\Eloquent\Model;
class Payouts extends Model
{
// Table Name
protected $table = 'srp_payouts';
//Primary Key
public $primaryKey = 'id';
// Timestamps
public $timestamps = false;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'code',
'payout',
];
}

View File

@@ -0,0 +1,27 @@
<?php
namespace App\Models\SRP;
use Illuminate\Database\Eloquent\Model;
class ShipTypes extends Model
{
// Table Name
protected $table = 'srp_ship_types';
//Primary Key
public $primaryKey = 'id';
// Timestamps
public $timestamps = false;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'code',
'description',
];
}

38
app/Models/SRP/Ships.php Normal file
View File

@@ -0,0 +1,38 @@
<?php
namespace App\Models\SRP;
use Illuminate\Database\Eloquent\Model;
class Ships extends Model
{
// Table Name
protected $table = 'srp_ships';
//Primary Key
public $primaryKey = 'id';
// Timestamps
public $timestamps = false;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'character_id',
'character_name',
'fleet_commander_id',
'floot_commander_name',
'zkillboard',
'ship_type',
'fleet_type',
'loss_value',
'approval',
'paid_value',
'notes',
'paid_by_id',
'paid_by_name',
];
}

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Models\Structures;
use Illuminate\Database\Eloquent\Model;
class Assets extends Model
{
// Table Name
protected $table = 'assets';
//Primary Key
public $primaryKey = 'id';
// Timestamps
public $timestamps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'is_blueprint_copy',
'is_singleton',
'item_id',
'location_flag',
'location_id',
'location_type',
'quantity',
'type_id',
];
}

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Models\Structures;
use Illuminate\Database\Eloquent\Model;
class CitadelServices extends Model
{
// Table Name
protected $table = 'citadel_services';
//Primary Key
public $primaryKey = 'id';
// Timestamps
public $timestamps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'structure_id',
'name',
'state',
];
}

View File

@@ -0,0 +1,46 @@
<?php
namespace App\Models\Structures;
use Illuminate\Database\Eloquent\Model;
class Citadels extends Model
{
// Table Name
protected $table = 'citadels';
//Primary Key
public $primaryKey = 'structure_id';
// Timestamps
public $timestamps = false;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'structure_id',
'structure_name',
'solar_system_id',
'solar_system_name',
'type_id',
'corporation_id',
'services',
'state',
'state_timer_start',
'state_timer_end',
'fuel_expires',
'profile_id',
'position_x',
'position_y',
'position_z',
'next_reinforce_apply',
'next_reinforce_hour',
'next_reinforce_weekday',
'reinforce_hour',
'reinforce_weekday',
'unanchors_at',
];
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,166 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
if(!Schema::hasTable('srp_ships')) {
Schema::create('srp_ships', function (Blueprint $table) {
$table->increments('id');
$table->string('character_id')->default('N/A');
$table->string('character_name');
$table->string('fleeet_commander_id')->default('0');
$table->string('fleet_commander_name');
$table->string('zkillboard');
$table->string('ship_type');
$table->enum('fleet_type', [
'Home Defense',
'Fun Fleet',
'ADM Fleet',
'Casuals',
'Strat Op',
'CTA',
'None',
]);
$table->decimal('loss_value', 20, 2);
$table->enum('approval', [
'Under Review',
'Approved',
'Denied',
]);
$table->decimal('paid_value', 20, 2);
$table->text('notes')->nullable();
$table->string('paid_by_id')->nullable();
$table->string('paid_by_name')->nullable();
});
}
if(!Schema::hasTable('srp_ship_types')) {
Schema::create('srp_ship_types', function (Blueprint $table) {
$table->increments('id');
$table->string('code');
$table->string('description');
});
}
if(!Schema::hasTable('srp_payouts')) {
Schema::create('srp_payouts', function (Blueprint $table) {
$table->increments('id');
$table->string('code');
$table->decimal('payout', 5, 2);
});
}
DB::table('srp_ship_types')->insert([
'code' => 'None',
'description' => 'None',
]);
DB::table('srp_ship_types')->insert([
'code' => 'T1FDC',
'description' => 'T1 Frig / Dessie / Cruiser',
]);
DB::table('srp_ship_types')->insert([
'code' => 'T1BC',
'description' => 'T1 Battelcruiser',
]);
DB::table('srp_ship_types')->insert([
'code' => 'T2F',
'description' => 'T2 Frigate',
]);
DB::table('srp_ship_types')->insert([
'code' => 'T3D',
'description' => 'T3 Destroyer',
]);
DB::table('srp_ship_types')->insert([
'code' => 'T1T2Logi',
'description' => 'T1 & T2 Logistics',
]);
DB::table('srp_ship_types')->insert([
'code' => 'RI',
'description' => 'Recons / Interdictors',
]);
DB::table('srp_ship_types')->insert([
'code' => 'T2C',
'description' => 'T2 Cruiser',
]);
DB::table('srp_ship_types')->insert([
'code' => 'T3C',
'description' => 'T3 Cruiser',
]);
DB::table('srp_ship_types')->insert([
'code' => 'COM',
'description' => 'Command Ship',
]);
DB::table('srp_payouts')->insert([
'code' => 'T1FDC',
'payout' => 75.00,
]);
DB::table('srp_payouts')->insert([
'code' => 'T1BC',
'payout' => 60.00,
]);
DB::table('srp_payouts')->insert([
'code' => 'T2F',
'payout' => 60.00,
]);
DB::table('srp_payouts')->insert([
'code' => 'T3D',
'payout' => 60.00,
]);
DB::table('srp_payouts')->insert([
'code' => 'T1T2Logi',
'payout' => 100.00,
]);
DB::table('srp_payouts')->insert([
'code' => 'RI',
'payout' => 50.00,
]);
DB::table('srp_payouts')->insert([
'code' => 'T2C',
'payout' => 50.00,
]);
DB::table('srp_payouts')->insert([
'code' => 'T3C',
'payout' => 50.00,
]);
DB::table('srp_payouts')->insert([
'code' => 'COM',
'payout' => 100.00,
]);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('srp_payouts');
Schema::dropIfExists('srp_ships');
Schema::dropIfExists('srp_ship_types');
}
};

View File

@@ -0,0 +1,50 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
if(!Schema::hasTable('blacklist')) {
Schema::create('blacklist', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('entity_id')->unique();
$table->string('entity_name')->default('');
$table->enum('entity_type', [
'character',
'corporation',
'alliance',
'coalition',
]);
$table->text('reason');
$table->string('lister_id');
$table->string('lister_name');
$table->enum('state', [
'Added',
'Removed',
'N/A',
])->default('Valid');
$table->string('removed_by_id')->nullable();
$table->string('removed_by_name')->nullable();
$table->text('removed_notes')->nullable();
$table->timestamps();
});
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('blacklist');
}
};

View File

@@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
if(!Schema::hasTable('after_action_reports')) {
Schema::create('after_action_reports', function (Blueprint $table) {
$table->id();
$table->string('fc_id');
$table->string('fc_name');
$table->dateTime('formup_time');
$table->string('formup_location');
$table->text('doctrine');
$table->text('objective');
$table->enum('result', [
'Win',
'Lose',
'Neither',
'Unknown',
]);
$table->text('summary');
$table->text('improvements')->nullable();
$table->text('worked_well')->nullable();
$table->text('additional_comments')->nullable();
$table->timestamps();
});
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('after_action_reports');
}
};

View File

@@ -0,0 +1,46 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
if(!Schema::hasTable('moon_mining_tax')) {
Schema::create('moon_mining_tax', function (Blueprint $table) {
$table->id();
$table->string('moon_id');
$table->string('name');
$table->decimal('worth', 20, 2);
$table->decimal('tax_bracket', 5, 2);
$table->decimal('tax_amount', 20, 2);
$table->dateTime('rental_end');
$table->timestamps();
});
}
if(!Schema::hasTable('mining_tax')) {
Schema::create('mining_tax', function (Blueprint $table) {
$table->id();
$table->string('character_id');
$table->string('character_name');
$table->dateTime('month_end');
$table->decimal('amount', 20, 2);
});
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('moon_mining_tax');
}
};

View File

@@ -0,0 +1,139 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
if(!Schema::hasTable('moon_lookup')) {
Schema::create('moon_lookup', function (Blueprint $table) {
$table->id();
$table->string('moon_id');
$table->string('moon_name');
$table->double('position_x');
$table->double('position_y');
$table->double('position_z');
$table->string('system_id');
$table->enum('owned', [
'Yes',
'No',
]);
$table->string('sov_owner_id')->nullable();
$table->string('sov_owner_name')->nullable();
$table->string('system_id');
$table->string('system_name');
$table->enum('moon_type', [
'Common',
'R4',
'R8',
'R16',
'R32',
'R64',
'None',
])->default('None');
$table->decimal('worth', 20, 2)->default(0.00);
$table->enum('owned', [
'alliance',
'corporation',
]);
$table->string('owner_id');
$table->string('owner_name');
$table->decimal('rental_amount')->default(0.00);
$table->timestamps();
});
}
if(!Schema::hasTable('item_lookup')) {
Schema::create('item_lookup', function (Blueprint $table) {
$table->string('item_id')->unique();
$table->double('capacity', 20, 2)->nullable();
$table->text('description');
$table->unsignedBigInteger('graphic_id')->nullable();
$table->unsignedBigInteger('group_id');
$table->unsignedBigInteger('icon_id')->nullable();
$table->unsignedBigInteger('market_group_id')->nullable();
$table->string('mass')->nullable();
$table->string('name');
$table->double('packaged_volume', 20, 2)->nullable();
$table->unsignedBigInteger('portion_size')->nullable();
$table->boolean('published');
$table->double('radius', 20, 2)->nullable();
$table->unsignedBigInteger('type_id')->unique();
$table->double('volume', 20, 2)->nullable();
});
}
if(!Schema::hasTable('character_lookup')) {
Schema::create('character_lookup', function (Blueprint $table) {
$table->string('character_id');
$table->string('alliance_id')->nullable();
$table->string('ancestry_id')->nullable();
$table->string('birthday');
$table->string('bloodline_id');
$table->string('corporation_id');
$table->string('description')->nullable();
$table->string('faction_id')->nullable();
$table->string('gender');
$table->string('name');
$table->string('race_id');
$table->float('security_status');
$table->string('title')->nullable();
});
}
if(!Schema::hasTable('corporation_lookup')) {
Schema::create('corporation_lookup', function (Blueprint $table) {
$table->string('corporation_id')->unique();
$table->string('alliance_id')->nullable();
$table->string('ceo_id');
$table->string('creator_id');
$table->string('date_founded')->nullable();
$table->string('description')->nullable();
$table->string('faction_id')->nullable();
$table->string('home_station_id')->nullable();
$table->string('member_count');
$table->string('name');
$table->string('shares')->nullable();
$table->decimal('tax_rate', 20, 2);
$table->string('ticker');
$table->string('url')->nullable();
$table->enum('war_eligible', [
'Yes',
'No',
])->default('No');
});
}
if(!Schema::hasTable('alliance_lookup')) {
Schema::create('alliance_lookup', function (Blueprint $table) {
$table->string('alliance_id')->unique();
$table->string('creator_corporation_id');
$table->string('creator_id');
$table->dateTime('date_founded');
$table->string('executor_corporation_id')->nullable();
$table->string('faction_id')->nullable();
$table->string('name');
$table->string('ticker');
});
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('moon_lookup');
Schema::dropIfExists('item_lookup');
Schema::dropIfExists('character_lookup');
Schema::dropIfExists('corporation_lookup');
Schema::dropIfExists('alliance_lookup');
}
};

View File

@@ -0,0 +1,43 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('battle_contracts', function (Blueprint $table) {
$table->id();
$table->string('creator_id');
$table->string('creator_name');
$table->string('party_id');
$table->string('party_name');
$table->string('length')->default('');
$table->decimal('price', 20, 2)->default(0.00);
$table->text('terms_conditions')->default('N/A');
$table->text('stipulations')->default('N/A');
$table->text('deliverables')->default('N/A');
$table->enum('validity', [
'Pending',
'Started',
'Finished, Paid',
'Paid In Full',
'Finished, Not Paid',
]);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('battle_contracts');
}
};