Bugfix/list clickup issue (#5)
Reviewed-on: #5 Co-authored-by: ISMAIL MASSERAN <ismail@koppkb.com> Co-committed-by: ISMAIL MASSERAN <ismail@koppkb.com>
This commit was merged in pull request #5.
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class JanaNotisExport extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'jana_notis_exports';
|
||||
|
||||
protected $fillable = [
|
||||
'user_id',
|
||||
'lelong_id',
|
||||
'kodcaw',
|
||||
'fasa',
|
||||
'status',
|
||||
'file_path',
|
||||
'file_name',
|
||||
'error_message',
|
||||
];
|
||||
|
||||
public const STATUS_PENDING = 'pending';
|
||||
|
||||
public const STATUS_PROCESSING = 'processing';
|
||||
|
||||
public const STATUS_COMPLETED = 'completed';
|
||||
|
||||
public const STATUS_FAILED = 'failed';
|
||||
|
||||
public function isReady()
|
||||
{
|
||||
return $this->status === self::STATUS_COMPLETED && ! empty($this->file_path);
|
||||
}
|
||||
|
||||
public function isInProgress()
|
||||
{
|
||||
return in_array($this->status, [self::STATUS_PENDING, self::STATUS_PROCESSING], true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user