feat(billing): renewals, coupons, VAT numbering, billing cycles and invoice payment tracking

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
baodev0
2026-10-19 16:37:56 +07:00
co-authored by Claude Sonnet 5.5
parent ea9a53f742
commit 25f23d541e
134 changed files with 4926 additions and 185 deletions
+7
View File
@@ -3,6 +3,7 @@
namespace App\Models;
use App\Models\Concerns\Markable;
use App\Support\ServiceExpirySync;
use App\Traits\LogsActivity;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
@@ -25,6 +26,12 @@ class Service extends Model
$service->type = Product::query()->where('id', $service->product_id)->value('product_type');
}
});
static::saved(function (Service $service) {
if ($service->wasRecentlyCreated || $service->wasChanged(['expires_at', 'vm_id'])) {
ServiceExpirySync::toVmware($service);
}
});
}
protected $table = 'services';