feat: add Snipe-IT asset synchronization
This commit is contained in:
@@ -21,6 +21,7 @@ class SnipeAsset extends Model
|
||||
'category_id', 'category_name', 'manufacturer', 'status_id', 'status_name',
|
||||
'location_id', 'location_name', 'requestable', 'assigned_type', 'assigned_id',
|
||||
'image_url', 'source_updated_at', 'synced_at', 'content_hash', 'active',
|
||||
'last_seen_sync_run_id',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
|
||||
45
app/Domain/Inventory/Models/SyncRun.php
Normal file
45
app/Domain/Inventory/Models/SyncRun.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Inventory\Models;
|
||||
|
||||
use App\Domain\Inventory\Enums\SyncRunStatus;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property string $type
|
||||
* @property CarbonImmutable $started_at
|
||||
* @property CarbonImmutable|null $finished_at
|
||||
* @property SyncRunStatus $status
|
||||
* @property int $records_processed
|
||||
* @property int $records_created
|
||||
* @property int $records_updated
|
||||
* @property int $records_disabled
|
||||
* @property string|null $error_message
|
||||
*/
|
||||
class SyncRun extends Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'type',
|
||||
'started_at',
|
||||
'finished_at',
|
||||
'status',
|
||||
'records_processed',
|
||||
'records_created',
|
||||
'records_updated',
|
||||
'records_disabled',
|
||||
'error_message',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'started_at' => 'datetime',
|
||||
'finished_at' => 'datetime',
|
||||
'status' => SyncRunStatus::class,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user