<?php

namespace App\Models;
use Illuminate\Database\Eloquent\Model;
/*
| Field                  | Purpose                                |
| ---------------------- | -------------------------------------- |
| `company_id`           | Which company this profile belongs to  |
| `provider`             | e.g., `stripe`, `ach`, `paypal`        |
| `provider_customer_id` | Stripe Customer ID or ACH token        |
| `provider_account_id`  | Stripe Connected Account ID (optional) |
| `metadata`             | JSON field for extra details           |

*/

use Illuminate\Database\Eloquent\Factories\HasFactory;

class PaymentProfile extends Model
{
    protected $fillable = [
        'company_id',
        'provider',
        'provider_customer_id',
        'provider_account_id',
        'metadata',
    ];
    
    protected $casts = [
        'metadata' => 'array',
    ];

    public function company()
    {
        return $this->belongsTo(Company::class);
    }
}
