# Local UAT Installation Package — v0.39.4-dev Consolidated

Project: `HRPAY-BMD-20260911-01`

## Modes
- **Quick Local UAT (SQLite):** fastest route for business-flow testing on a Windows PC.
- **PostgreSQL Local UAT:** production-like database path; the PostgreSQL database/user must exist before the setup script runs migrations.

## Windows first run
1. Extract the ZIP to a normal local folder. Avoid OneDrive/network folders for the first test.
2. Run `01-SETUP-LOCAL-UAT-WINDOWS.bat`.
3. Before first setup, freeze/review the migration snapshot using `00-FREEZE-MIGRATIONS-WINDOWS.bat`. The setup script creates `.venv`, installs `requirements.txt`, generates `.env.local`, verifies frozen migrations and drift, migrates a fresh database, creates roles/master data/sample data, and prompts for the first Super Admin.
4. Run `02-START-LOCAL-UAT-WINDOWS.bat`.
5. Sign in at `http://127.0.0.1:8000/login/`.
6. Run `03-CHECK-LOCAL-UAT-WINDOWS.bat` when support asks for a readiness check.

## Migration policy
This project is still before the final `v1.0.0` schema freeze, but v0.39.4-dev Consolidated uses a controlled migration snapshot. Migration files are generated only by the explicit freeze step, reviewed, hashed and then consumed by setup. Local UAT setup and production must never rely on ad-hoc schema creation.

## Sample data
`first_run_setup --with-demo-data` creates clearly marked UAT data only:
- Shohoj Shop Clothing Ltd.
- Head Office and core departments/designations
- General Shift
- Leave types and salary components
- ZKTeco FO-M1 device profile
- Four sample employees with salaries, leave balances and device IDs 101–104

Do not import real production data into the same disposable sample database until the UAT flow is accepted.

## Dependency note
The first setup normally needs internet access to install Python packages unless a developer supplies an offline `wheelhouse` folder.
