Updates to charges table

This commit is contained in:
Deon George
2022-06-11 17:39:25 +10:00
parent b9ec64fd4f
commit b8f85960aa
3 changed files with 451 additions and 4 deletions

View File

@@ -5,6 +5,8 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Arr;
use App\Traits\SiteID;
/**
* CLEANUP NOTES:
* + Charge Date should not be null
@@ -13,11 +15,15 @@ use Illuminate\Support\Arr;
*/
class Charge extends Model
{
const CREATED_AT = 'date_orig';
const UPDATED_AT = 'date_last';
use SiteID;
protected $dates = ['charge_date'];
public $dateFormat = 'U';
protected $casts = [
'attributes' => 'json',
];
protected $dates = [
'charged_at',
];
public const sweep = [
// 0 => 'Daily',
@@ -36,6 +42,11 @@ class Charge extends Model
return $this->belongsTo(Account::class);
}
public function product()
{
return $this->belongsTo(Product::class);
}
public function service()
{
return $this->belongsTo(Service::class);