# HIGHRA CRM — Single Tenant V3 Consolidated Build

This is the consolidated single-company CRM build. It includes the CRM foundation plus Meta Lead Ads integration.

## Modules
- Dashboard
- Leads / pipeline foundation
- Customers
- Follow-ups
- Products
- Quotations
- Analytics
- Meta integration
- Meta webhook event logging

## Meta integration flow
Meta OAuth -> Pages -> Page access token -> leadgen subscription -> webhook -> lead retrieval -> duplicate-safe lead creation.

## Install
```bash
composer install
cp .env.example .env
php artisan key:generate
php artisan migrate --seed
php artisan storage:link
php artisan serve
```

Set these values in `.env`:
```env
META_APP_ID=
META_APP_SECRET=
META_VERIFY_TOKEN=
META_API_VERSION=v25.0
```

Webhook: `/api/webhooks/meta`
OAuth callback: `/meta/callback`

## Important
`vendor/` is intentionally generated with `composer install`; it is not bundled. For production use HTTPS, secure secrets, queues, backups, and the required Meta permissions/App Review.

## V4 additions
- Session authentication with admin/sales roles
- Lead assignment to users
- Pipeline/Kanban-style stage view
- Follow-up creation/completion endpoints
- Protected CRM routes
- Seeded admin and sales accounts

Seeded credentials (change immediately):
- admin@highratech.com / ChangeMe@123
- sales@highratech.com / ChangeMe@123

## V6 — Customer & Quotation
- Lead-to-customer conversion
- Customer directory
- Quotation header and line items
- Product-linked quotation items
- Tax, discount and totals
- Quotation status workflow
- Print / browser Save as PDF quotation output
