<?php

namespace App\Models;

use App\Models\Account;
use App\Models\User;
use Illuminate\Database\Eloquent\Model;

class AccountMember extends Model
{
    const
        STATUS_PENDING = 'pending',
        STATUS_ACCEPTED = 'accepted',
        STATUS_DECLINED = 'declined';

    protected $casts = [
        'is_admin' => 'boolean',
        'accepted_at' => 'datetime',
    ];

    public function account()
    {
        return $this->belongsTo(Account::class);
    }

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