job status for database

This commit is contained in:
2019-05-05 01:51:21 -05:00
parent a0c4c619b0
commit 4b2a1758e2
8 changed files with 53 additions and 37 deletions
+5 -1
View File
@@ -14,7 +14,6 @@ use App\Library\Finances\Helper\FinanceHelper;
//App Models
use App\Models\Jobs\JobProcessWalletJournal;
use App\Models\Jobs\JobError;
use App\Models\Jobs\JobStatus;
class ProcessWalletJournalJob implements ShouldQueue
@@ -65,6 +64,11 @@ class ProcessWalletJournalJob implements ShouldQueue
//After the job is completed, delete the job
$this->delete();
$status = new JobStatus;
$status->job_name = 'Process Wallet Journal';
$status->complete = true;
$status->save();
}
/**
+5
View File
@@ -60,6 +60,11 @@ class ProcessWalletTransactionJob implements ShouldQueue
//After the job is completed, delete the job
$this->delete();
$status = new JobStatus;
$status->job_name = 'Process Wallet Transaction';
$status->complete = true;
$status->save();
}
/**
+5
View File
@@ -101,6 +101,11 @@ class SendEveMailJob implements ShouldQueue
}
$this->delete();
$status = new JobStatus;
$status->job_name = 'Send Eve Mail';
$status->complete = true;
$status->save();
}
/**
-29
View File
@@ -1,29 +0,0 @@
<?php
namespace App\Models\Jobs;
use Illuminate\Database\Eloquent\Model;
class JobError extends Model
{
//Table Name
public $table = 'job_statuses';
//Timestamps
public $timestaps = true;
/**
* The attributes that are mass assignable
*
* @var array
*/
protected $fillable = [
'job_id',
'job_name',
'error',
];
public function JobStatus() {
$this->belongsTo('\App\Models\Jobs\JobStatus');
}
}
-5
View File
@@ -18,12 +18,7 @@ class JobStatus extends Model
* @var array
*/
protected $fillable = [
'id',
'job_name',
'complete',
];
public function Error() {
$this->hasOne('\App\Models\Jobs\JobError', 'job_id', 'id');
}
}