<?php

namespace App\Models;

use App\Traits\HashIdTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Transfer extends Model
{
    use HasFactory, HashIdTrait;

    protected $guarded = [];
    protected $casts = [
        'response_data' => 'array',
        'last_status_check_at' => 'datetime',
    ];

    public $appends = ['hash_id'];


    const STATUS_PENDING = 'pending';
    const STATUS_SUCCESS = 'success';
    const STATUS_FAILED = 'failed';

    const DOT_TRANSFER_STATUS_RUNNING = 'RUNNING';
    const DOT_TRANSFER_STATUS_SUCCEEDED = 'SUCCEEDED';
    const DOT_TRANSFER_STATUS_FAILED = 'FAILED';

    const TYPE_BANK = 'bank';

    public function user()
    {
        return $this->belongsTo(User::class);
    }
}
