2026-04-18 11:22:27 +00:00
|
|
|
<?php
|
|
|
|
|
|
2026-04-25 20:59:38 +01:00
|
|
|
// SPDX-License-Identifier: EUPL-1.2
|
|
|
|
|
|
2026-04-18 11:22:27 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace Core\Mod\Agentic\Models;
|
|
|
|
|
|
|
|
|
|
use Core\Tenant\Concerns\BelongsToWorkspace;
|
|
|
|
|
use Core\Tenant\Models\Workspace;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
|
|
|
|
|
|
class CreditEntry extends Model
|
|
|
|
|
{
|
|
|
|
|
use BelongsToWorkspace;
|
|
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'workspace_id',
|
|
|
|
|
'fleet_node_id',
|
2026-04-25 20:59:38 +01:00
|
|
|
'fleet_task_id',
|
|
|
|
|
'agent_id',
|
2026-04-18 11:22:27 +00:00
|
|
|
'task_type',
|
|
|
|
|
'amount',
|
|
|
|
|
'balance_after',
|
|
|
|
|
'description',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected $casts = [
|
2026-04-25 20:59:38 +01:00
|
|
|
'fleet_task_id' => 'integer',
|
2026-04-18 11:22:27 +00:00
|
|
|
'amount' => 'integer',
|
|
|
|
|
'balance_after' => 'integer',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
public function workspace(): BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Workspace::class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function fleetNode(): BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(FleetNode::class);
|
|
|
|
|
}
|
2026-04-25 20:59:38 +01:00
|
|
|
|
|
|
|
|
public function fleetTask(): BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(FleetTask::class);
|
|
|
|
|
}
|
2026-04-18 11:22:27 +00:00
|
|
|
}
|