# app/models

Empty by design in Phase 1. Every future model extends
`App\Core\BaseModel`, which already provides `find`, `all`, `paginate`,
`insert`, `update`, `delete` (soft or hard, table-dependent), `restore`,
and `count` — see that class's docblock for the full contract.

## Convention every future model follows

```php
<?php

declare(strict_types=1);

namespace App\Models;

use App\Core\BaseModel;

final class LeadModel extends BaseModel
{
    protected string $table = 'leads';

    protected array $fillable = [
        'business_line_id', 'lead_source_id', 'lead_stage_id', 'company_id',
        'owner_id', 'first_name', 'last_name', 'email', 'phone',
        'estimated_value', 'currency', 'notes', 'lost_reason',
    ];

    protected bool $softDeletes = true; // leads.deleted_at
    protected bool $auditStamps = true; // leads.created_by / updated_by

    // Domain-specific queries live here, not in the controller.
    public function findByStage(int $stageId, int $businessLineId): array
    {
        $stmt = $this->db->prepare(
            'SELECT * FROM leads WHERE lead_stage_id = :stage AND business_line_id = :bl AND deleted_at IS NULL'
        );
        $stmt->execute(['stage' => $stageId, 'bl' => $businessLineId]);

        return $stmt->fetchAll();
    }
}
```

Every table's exact column list, keys, and constraints are documented
in `database/schema.sql` and `docs/DATABASE.md` — a model's `$fillable`
array should always be a subset of that table's real columns, never
more.
