rental moon stuffs

This commit is contained in:
2020-06-03 22:26:48 -05:00
parent 7e248c7055
commit cde4f3b6c7
8 changed files with 136 additions and 57 deletions

View File

@@ -0,0 +1,63 @@
<?php
namespace App\Console\Commands\RentalMoons;
//Internal Library
use Illuminate\Console\Command;
use Log;
use Carbon\Carbon;
//Library
use Commands\Library\CommandHelper;
//Jobs
use App\Jobs\Commands\RentalMoons\SendMoonRentalPaymentReminderJob;
use App\Jobs\Commands\RentalMoons\UpdateMoonRentalPaidState;
class AllianceRentalMoonInvoiceCreationCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'services:RentalInvoices';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Send out rental invoice reminders';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
//Set the task as started
$task = new CommandHelper('AllianceRentalInvoice');
$task->SetStartStatus();
//Send the job for the invoice creation command
SendMoonRentalPaymentReminderJob::dispatch()->delay(Carbon::now()->addSeconds(10));
//Update the paid state for the moons
UpdateMoonRentalPaidState::dispatch()->delay(Carbon::now()->addSeconds(600));
//Set the task as stopped
$task->SetStopStatus();
}
}

View File

@@ -0,0 +1,56 @@
<?php
namespace App\Console\Commands;
//Internal Library
use Illuminate\Console\Command;
use Log;
//Library
use Commands\Library\CommandHelper;
//Job
use App\Jobs\Commands\RentalMoons\UpdateMoonRentalPrice;
class AllianceRentalMoonUpdatePricingCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'services:UpdateRentalPrice';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Update alliance rental moon prices.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
//Setup the task handler
$task = new CommandHelper('AllianceRentalMoonPriceUpdater');
$task->SetStartStatus();
UpdateMoonRentalPrice::dispatch();
$task->SetStopStatus();
}
}

View File

@@ -1,42 +0,0 @@
<?php
namespace App\Console\Commands\RentalMoons;
use Illuminate\Console\Command;
class AllianceRentalMoonsCommand extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'command:name';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
//
}
}

View File

@@ -29,6 +29,10 @@ class Kernel extends ConsoleKernel
Commands\Data\CleanStaleDataCommand::class,
Commands\Moons\MoonsUpdateCommand::class,
Commands\Data\PurgeCorpMoonLedgers::class,
/**
* Rental Moon Commands
*/
Commands\RentalMoons\AllianceRentalMoonInvoiceCreationCommand::class,
];
/**

View File

@@ -57,8 +57,6 @@ class CreateAllianceMoonRentalsTable extends Migration
$table->timestamps();
}
//Transfer the existing data into the table
//Drop the older tables
Schema::dropIfExists('moon_rents');
Schema::dropIfExists('RentalMoons');

View File

@@ -12,6 +12,6 @@ class DatabaseSeeder extends Seeder
*/
public function run()
{
$this->call(SolarSystemSeeder::class);
//$this->call(SolarSystemSeeder::class);
}
}

View File

@@ -6,6 +6,7 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'AllianceRentalMoonSeed' => $baseDir . '/database/seeds/AllianceRentalMoonSeed.php',
'App\\Console\\Commands\\Assets\\GetAssetsCommand' => $baseDir . '/app/Console/Commands/Assets/GetAssets.php',
'App\\Console\\Commands\\Corps\\GetCorpsCommand' => $baseDir . '/app/Console/Commands/Corps/GetCorps.php',
'App\\Console\\Commands\\Data\\CleanStaleDataCommand' => $baseDir . '/app/Console/Commands/Data/CleanStaleDataCommand.php',
@@ -17,12 +18,10 @@ return array(
'App\\Console\\Commands\\Finances\\SovBillsCommand' => $baseDir . '/app/Console/Commands/Finances/SovBills.php',
'App\\Console\\Commands\\Flex\\FlexStructureCommand' => $baseDir . '/app/Console/Commands/Flex/FlexStructureCommand.php',
'App\\Console\\Commands\\GetMarketDataCommand' => $baseDir . '/app/Console/Commands/Market/GetMarketDataCommand.php',
'App\\Console\\Commands\\Moons\\MoonMailerCommand' => $baseDir . '/app/Console/Commands/Moons/MoonMailer.php',
'App\\Console\\Commands\\Moons\\MoonsUpdateCommand' => $baseDir . '/app/Console/Commands/Moons/MoonsUpdateCommand.php',
'App\\Console\\Commands\\Moons\\RentalMoonCommand' => $baseDir . '/app/Console/Commands/Moons/RentalMoonCommand.php',
'App\\Console\\Commands\\Moons\\UpdateMoonPriceCommand' => $baseDir . '/app/Console/Commands/Moons/UpdateMoonPricing.php',
'App\\Console\\Commands\\PublicContractsCommand' => $baseDir . '/app/Console/Commands/PublicContracts/PublicContractsCommand.php',
'App\\Console\\Commands\\PurgeMarketDataCommand' => $baseDir . '/app/Console/Commands/Market/PurgeMarketDataCommand.php',
'App\\Console\\Commands\\RentalMoons\\AllianceRentalMoonInvoiceCreationCommand' => $baseDir . '/app/Console/Commands/RentalMoons/AllianceRentalMoonInvoiceCreationCommand.php',
'App\\Console\\Commands\\Structures\\GetStructuresCommand' => $baseDir . '/app/Console/Commands/Structures/GetStructures.php',
'App\\Console\\Commands\\Users\\PurgeUsers' => $baseDir . '/app/Console/Commands/Users/PurgeUsers.php',
'App\\Console\\Commands\\Wormholes\\PurgeWormholes' => $baseDir . '/app/Console/Commands/Wormholes/PurgeWormholes.php',
@@ -70,13 +69,13 @@ return array(
'App\\Jobs\\Commands\\Market\\GetMarketRegionOrderJob' => $baseDir . '/app/Jobs/Commands/Market/GetMarketRegionOrderJob.php',
'App\\Jobs\\Commands\\Moons\\FetchMoonLedgerJob' => $baseDir . '/app/Jobs/Commands/Moons/FetchMoonLedgerJob.php',
'App\\Jobs\\Commands\\Moons\\FetchMoonObserverJob' => $baseDir . '/app/Jobs/Commands/Moons/FetchMoonObserverJob.php',
'App\\Jobs\\Commands\\Moons\\MoonRentalInvoiceCreate' => $baseDir . '/app/Jobs/Commands/Moons/MoonRentalInvoiceCreate.php',
'App\\Jobs\\Commands\\Moons\\MoonRentalInvoiceVerify' => $baseDir . '/app/Jobs/Commands/Moons/MoonRentalInvoiceVerify.php',
'App\\Jobs\\Commands\\Moons\\PurgeMoonLedgerJob' => $baseDir . '/app/Jobs/Commands/Moons/PurgeMoonLedgerJob.php',
'App\\Jobs\\Commands\\PublicContracts\\GetPublicContractItemsJob' => $baseDir . '/app/Jobs/Commands/PublicContracts/GetPublicContractItemsJob.php',
'App\\Jobs\\Commands\\PublicContracts\\GetPublicContractsJob' => $baseDir . '/app/Jobs/Commands/PublicContracts/GetPublicContractsJob.php',
'App\\Jobs\\Commands\\PublicContracts\\PurgePublicContracts' => $baseDir . '/app/Jobs/Commands/PublicContracts/PurgePublicContracts.php',
'App\\Jobs\\MoonRentalUpdate' => $baseDir . '/app/Jobs/Commands/Moons/MoonRentalUpdate.php',
'App\\Jobs\\Commands\\RentalMoons\\SendMoonRentalPaymentReminderJob' => $baseDir . '/app/Jobs/Commands/RentalMoons/SendMoonRentalPaymentReminderJob.php',
'App\\Jobs\\Commands\\RentalMoons\\UpdateMoonRentalPaidState' => $baseDir . '/app/Jobs/Commands/RentalMoons/UpdateMoonRentalPaidState.php',
'App\\Jobs\\Commands\\RentalMoons\\UpdateMoonRentalPrice' => $baseDir . '/app/Jobs/Commands/RentalMoons/UpdateMoonRentalPrice.php',
'App\\Jobs\\ProcessAssetsJob' => $baseDir . '/app/Jobs/ProcessAssetsJob.php',
'App\\Jobs\\ProcessSendEveMailJob' => $baseDir . '/app/Jobs/ProcessSendEveMailJob.php',
'App\\Jobs\\ProcessStructureJob' => $baseDir . '/app/Jobs/ProcessStructureJob.php',
@@ -142,6 +141,7 @@ return array(
'App\\Models\\MoonRent\\MoonRental' => $baseDir . '/app/Models/MoonRentals/MoonRental.php',
'App\\Models\\MoonRent\\MoonRentalInvoice' => $baseDir . '/app/Models/MoonRentals/MoonRentalInvoice.php',
'App\\Models\\MoonRent\\MoonRentalPayment' => $baseDir . '/app/Models/MoonRentals/MoonRentalPayment.php',
'App\\Models\\MoonRentals\\AllianceRentalMoon' => $baseDir . '/app/Models/MoonRentals/AllianceRentalMoon.php',
'App\\Models\\Moon\\AllianceMoon' => $baseDir . '/app/Models/Moon/AllianceMoon.php',
'App\\Models\\Moon\\AllianceMoonRequest' => $baseDir . '/app/Models/Moon/AllianceMoonRequest.php',
'App\\Models\\Moon\\Config' => $baseDir . '/app/Models/Moon/Config.php',

View File

@@ -475,6 +475,7 @@ class ComposerStaticInitc3f953f8a7291d41a76e1664339777c9
);
public static $classMap = array (
'AllianceRentalMoonSeed' => __DIR__ . '/../..' . '/database/seeds/AllianceRentalMoonSeed.php',
'App\\Console\\Commands\\Assets\\GetAssetsCommand' => __DIR__ . '/../..' . '/app/Console/Commands/Assets/GetAssets.php',
'App\\Console\\Commands\\Corps\\GetCorpsCommand' => __DIR__ . '/../..' . '/app/Console/Commands/Corps/GetCorps.php',
'App\\Console\\Commands\\Data\\CleanStaleDataCommand' => __DIR__ . '/../..' . '/app/Console/Commands/Data/CleanStaleDataCommand.php',
@@ -486,12 +487,10 @@ class ComposerStaticInitc3f953f8a7291d41a76e1664339777c9
'App\\Console\\Commands\\Finances\\SovBillsCommand' => __DIR__ . '/../..' . '/app/Console/Commands/Finances/SovBills.php',
'App\\Console\\Commands\\Flex\\FlexStructureCommand' => __DIR__ . '/../..' . '/app/Console/Commands/Flex/FlexStructureCommand.php',
'App\\Console\\Commands\\GetMarketDataCommand' => __DIR__ . '/../..' . '/app/Console/Commands/Market/GetMarketDataCommand.php',
'App\\Console\\Commands\\Moons\\MoonMailerCommand' => __DIR__ . '/../..' . '/app/Console/Commands/Moons/MoonMailer.php',
'App\\Console\\Commands\\Moons\\MoonsUpdateCommand' => __DIR__ . '/../..' . '/app/Console/Commands/Moons/MoonsUpdateCommand.php',
'App\\Console\\Commands\\Moons\\RentalMoonCommand' => __DIR__ . '/../..' . '/app/Console/Commands/Moons/RentalMoonCommand.php',
'App\\Console\\Commands\\Moons\\UpdateMoonPriceCommand' => __DIR__ . '/../..' . '/app/Console/Commands/Moons/UpdateMoonPricing.php',
'App\\Console\\Commands\\PublicContractsCommand' => __DIR__ . '/../..' . '/app/Console/Commands/PublicContracts/PublicContractsCommand.php',
'App\\Console\\Commands\\PurgeMarketDataCommand' => __DIR__ . '/../..' . '/app/Console/Commands/Market/PurgeMarketDataCommand.php',
'App\\Console\\Commands\\RentalMoons\\AllianceRentalMoonInvoiceCreationCommand' => __DIR__ . '/../..' . '/app/Console/Commands/RentalMoons/AllianceRentalMoonInvoiceCreationCommand.php',
'App\\Console\\Commands\\Structures\\GetStructuresCommand' => __DIR__ . '/../..' . '/app/Console/Commands/Structures/GetStructures.php',
'App\\Console\\Commands\\Users\\PurgeUsers' => __DIR__ . '/../..' . '/app/Console/Commands/Users/PurgeUsers.php',
'App\\Console\\Commands\\Wormholes\\PurgeWormholes' => __DIR__ . '/../..' . '/app/Console/Commands/Wormholes/PurgeWormholes.php',
@@ -539,13 +538,13 @@ class ComposerStaticInitc3f953f8a7291d41a76e1664339777c9
'App\\Jobs\\Commands\\Market\\GetMarketRegionOrderJob' => __DIR__ . '/../..' . '/app/Jobs/Commands/Market/GetMarketRegionOrderJob.php',
'App\\Jobs\\Commands\\Moons\\FetchMoonLedgerJob' => __DIR__ . '/../..' . '/app/Jobs/Commands/Moons/FetchMoonLedgerJob.php',
'App\\Jobs\\Commands\\Moons\\FetchMoonObserverJob' => __DIR__ . '/../..' . '/app/Jobs/Commands/Moons/FetchMoonObserverJob.php',
'App\\Jobs\\Commands\\Moons\\MoonRentalInvoiceCreate' => __DIR__ . '/../..' . '/app/Jobs/Commands/Moons/MoonRentalInvoiceCreate.php',
'App\\Jobs\\Commands\\Moons\\MoonRentalInvoiceVerify' => __DIR__ . '/../..' . '/app/Jobs/Commands/Moons/MoonRentalInvoiceVerify.php',
'App\\Jobs\\Commands\\Moons\\PurgeMoonLedgerJob' => __DIR__ . '/../..' . '/app/Jobs/Commands/Moons/PurgeMoonLedgerJob.php',
'App\\Jobs\\Commands\\PublicContracts\\GetPublicContractItemsJob' => __DIR__ . '/../..' . '/app/Jobs/Commands/PublicContracts/GetPublicContractItemsJob.php',
'App\\Jobs\\Commands\\PublicContracts\\GetPublicContractsJob' => __DIR__ . '/../..' . '/app/Jobs/Commands/PublicContracts/GetPublicContractsJob.php',
'App\\Jobs\\Commands\\PublicContracts\\PurgePublicContracts' => __DIR__ . '/../..' . '/app/Jobs/Commands/PublicContracts/PurgePublicContracts.php',
'App\\Jobs\\MoonRentalUpdate' => __DIR__ . '/../..' . '/app/Jobs/Commands/Moons/MoonRentalUpdate.php',
'App\\Jobs\\Commands\\RentalMoons\\SendMoonRentalPaymentReminderJob' => __DIR__ . '/../..' . '/app/Jobs/Commands/RentalMoons/SendMoonRentalPaymentReminderJob.php',
'App\\Jobs\\Commands\\RentalMoons\\UpdateMoonRentalPaidState' => __DIR__ . '/../..' . '/app/Jobs/Commands/RentalMoons/UpdateMoonRentalPaidState.php',
'App\\Jobs\\Commands\\RentalMoons\\UpdateMoonRentalPrice' => __DIR__ . '/../..' . '/app/Jobs/Commands/RentalMoons/UpdateMoonRentalPrice.php',
'App\\Jobs\\ProcessAssetsJob' => __DIR__ . '/../..' . '/app/Jobs/ProcessAssetsJob.php',
'App\\Jobs\\ProcessSendEveMailJob' => __DIR__ . '/../..' . '/app/Jobs/ProcessSendEveMailJob.php',
'App\\Jobs\\ProcessStructureJob' => __DIR__ . '/../..' . '/app/Jobs/ProcessStructureJob.php',
@@ -611,6 +610,7 @@ class ComposerStaticInitc3f953f8a7291d41a76e1664339777c9
'App\\Models\\MoonRent\\MoonRental' => __DIR__ . '/../..' . '/app/Models/MoonRentals/MoonRental.php',
'App\\Models\\MoonRent\\MoonRentalInvoice' => __DIR__ . '/../..' . '/app/Models/MoonRentals/MoonRentalInvoice.php',
'App\\Models\\MoonRent\\MoonRentalPayment' => __DIR__ . '/../..' . '/app/Models/MoonRentals/MoonRentalPayment.php',
'App\\Models\\MoonRentals\\AllianceRentalMoon' => __DIR__ . '/../..' . '/app/Models/MoonRentals/AllianceRentalMoon.php',
'App\\Models\\Moon\\AllianceMoon' => __DIR__ . '/../..' . '/app/Models/Moon/AllianceMoon.php',
'App\\Models\\Moon\\AllianceMoonRequest' => __DIR__ . '/../..' . '/app/Models/Moon/AllianceMoonRequest.php',
'App\\Models\\Moon\\Config' => __DIR__ . '/../..' . '/app/Models/Moon/Config.php',