Rework service, removed redundant code, service invoicing improvements

This commit is contained in:
2024-07-29 23:12:53 +10:00
parent 5f10175b35
commit 0b5bc9e012
29 changed files with 474 additions and 523 deletions

View File

@@ -3,25 +3,23 @@
namespace App\Models\Usage;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use App\Models\Service\Broadband as ServiceBroadband;
use Illuminate\Support\Facades\Log;
class Broadband extends Model
class Broadband extends Type
{
protected $casts = [
'date'=>'datetime:Y-m-d',
];
protected $table = 'usage_broadband';
public $timestamps = FALSE;
private $traffic_end = 14;
/* RELATIONS */
/* @todo rename to service() and put in parent */
/* @deprecated */
public function broadband()
{
Log::alert('deprecated function '.__METHOD__);
return $this->belongsTo(ServiceBroadband::class);
}

14
app/Models/Usage/Type.php Normal file
View File

@@ -0,0 +1,14 @@
<?php
namespace App\Models\Usage;
use Illuminate\Database\Eloquent\Model;
abstract class Type extends Model
{
protected $casts = [
'date'=>'datetime:Y-m-d',
];
public $timestamps = FALSE;
}