<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class AFARegistration extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'afa_orders';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'fullname',
        'phone',
        'ghana_card',
        'occupation',
        'dob',
        'cost',
        'price',
        'profit',
        'user_id',
        'status',
        'payment_status',
        'is_customer'
    ];

    /**
     * Get the user that owns the AFA registration.
     */
    public function user()
    {
        return $this->belongsTo(User::class);
    }

    public function payment()
    {
        return $this->hasOne(AFAOrderPayment::class, 'afa_order_id');
    }
}
