<?php

namespace App\Models;

use CodeIgniter\Model;

class DealCommissionsModel extends Model
{
    protected $table      = 'bbt_qb_sales_receipts';
    protected $primaryKey = 'id';
    protected $allowedFields = [
        'inv_no',
        'pdf',
        'deal_id',
        'o_type',
        'createdat',
        'updatedat',
        'update_status',
        'qb_id',
        'is_sync',
        'sales_data',
        'customer_id',
        'total_price',
        'is_charge',
        'qb_customer_id',
        'qb_journal_id',
        'is_sync_journal',
        'cogs',
        'profit',   // This is our "Gross Profit" column
        'createdby',
        'is_web',
        'model_price',
        'model_cost',
        'model_cnt',
        'labor_total',
        'hours_billed',
        'parts_total',
        'parts_cost',
        'parts_profit',
        'hours_total',
        'hours_cnt',
        'revenue',
        'tax',
        'unit_tax',
        'parts_tax',
        'county_tax',
        'tire_tax',
        'reg_fee',
        'doc_fee',
        'lien_fee',
        'title_fee',
        'discount',
        'shipping',
        'amazon_fee',
        'labor_cost',
        'fee_total',
        'fee_cost',
        'custom_option_total',
        'custom_option_cost',
        'shop_supplies',
        'unit_duty',
        'unit_shipping',
        'is_update',
        'option_total',
        'parts_cnt',
        'promotion_total',
        'promotion_cost',

        // Ideally you’d also have columns for the 4 users:
        // 'deposit_user',
        // 'customer_care_user',
        // 'title_work_user',
        // 'checkout_completed_user',
    ];
}
