# Sivakasi Crackers — Final QA Report

**Project:** Laravel 12.68.0 / PHP 8.2 target  
**QA build:** V27 Final QA  
**Scope:** customer shop, product pages, cart/checkout, mobile OTP, admin, offline orders, categories/trash, media/popup, product PDF and invoice/estimation PDF.

## Executive Result

**Code/static QA: PASS.** All PHP source files in `app`, `routes`, `config`, `database`, and `bootstrap` pass `php -l`, and the Laravel route table loads successfully.

**Live integration QA: BLOCKED in this test environment** because the supplied local environment here does not have MySQL/PDO drivers and does not have the PHP `mbstring` extension enabled. The project itself targets PHP 8.2 and requires a normal Laravel PHP environment with the required extensions.

## QA Matrix

| Module | Test scope | Result | Notes |
|---|---|---|---|
| Functionality | Routes, controllers, validation, order flow, stock rules | PASS (static) | Live DB execution still required |
| Compatibility | PHP 8.2/Laravel 12 source compatibility | PASS | PHP syntax clean |
| Responsive Design | Mobile/tablet CSS and responsive layout rules | PASS (code review) | Browser/device run required |
| Performance | Queries, popup DB query scope, lazy images, stock locking | PASS / IMPROVED | Full Lighthouse/load test requires running site |
| Security | CSRF, auth middleware, admin-only routes, upload validation, OTP throttling | PASS (static) | Production config must disable debug |
| Accessibility & SEO | Labels, alt text, ARIA, headings/meta description | PASS (baseline) | Full automated accessibility audit requires browser |
| Interface & Usability | Shop controls, product rows, admin order entry | PASS (code review) | Visual browser QA recommended |
| Cart & Checkout | Stock validation, current DB price, checkout order creation | PASS (static) | Requires MySQL integration test |
| Product Pages | Product visibility, price/MRP/discount, out-of-stock | PASS (static) | Browser QA required |
| Search & Navigation | Product search, suggestions, category navigation | PASS (static) | Browser QA required |
| User Accounts / OTP | WhatsApp OTP, expiry, attempts, session regeneration | PASS (static) | Real WhatsApp API delivery must be tested with Meta credentials |
| Admin Orders | Pick Items, text search/add, quantity, save/confirmation | PASS (static) | Requires browser + DB test |
| PDF / Printing | Product list PDF and order/estimation PDF | PASS (code) | PDF rendering should be visually checked on Windows after DB setup |

## Corrections Applied in This QA Build

1. Added a backward-compatible guard in `InvoicePdfService::textRight()` so the historical `Argument #6 ($bold) ... array given` error cannot recur when an old call passes the RGB array in the sixth position.
2. Kept invoice discount values as **MRP minus discount amount**, not a percentage, and kept the final calculation as **Subtotal − Discount + GST + Shipping = Total Due**.
3. Corrected invoice PDF product serial numbering to follow its actual 22-row page size.
4. Corrected product-list PDF serial numbering when category headings consume page rows.
5. Added checkout-side database revalidation and `lockForUpdate()` stock locking so stale cart prices/stock cannot be trusted and simultaneous orders cannot oversell the same stock.
6. Added OTP request/verification rate limiting.
7. Removed plaintext OTP values from application logs.
8. Limited promotional poster database lookup to the **Shop** page, reducing unnecessary queries on other customer pages.
9. Confirmed promotional poster behavior: active poster on Shop page, automatic close after 10 seconds, manual close, and 24-hour local-storage suppression.
10. Restored categories are automatically reactivated so a restored category does not remain invisible because its status was set inactive when moved to trash.
11. Strengthened company phone and Google Maps URL validation.
12. Confirmed out-of-stock products remain visible on the frontend but cannot be added to the cart; admin order creation also excludes them.
13. Confirmed admin New Order has both **Pick Items** and direct product-name search/add in the Item column, and the saved confirmation screen is reached only after successful order creation.
14. Confirmed the home image row is limited to three equal responsive tiles with white borders.
15. Confirmed homepage category discount badges are positioned at the top-right.

## Required Local QA Before Production

Run on the Windows/XAMPP machine:

```text
php -m
php artisan migrate
php artisan storage:link
php artisan optimize:clear
php artisan route:list
php artisan serve
```

Required PHP extensions include at least the normal Laravel extensions plus **mbstring**, **PDO/MySQL**, and **fileinfo**. The ZIP import feature also needs **ZipArchive**.

For production:

```text
APP_ENV=production
APP_DEBUG=false
```

Then test the real MySQL database, uploaded images, WhatsApp Cloud API OTP, PDF download/print, and responsive layouts in Chrome/Edge on desktop and mobile widths.
