# Repository Guidelines

## Project Structure & Module Organization
This is a Yii 2 PHP ERP. HTTP actions live in `controllers/`; ActiveRecord models and search models live in `models/`. Shared model helpers are in `base/`, and PHP templates are grouped by feature under `views/`. Keep related changes together, for example `AreaController.php`, `Area.php`, `AreaSearch.php`, and `views/area/`.

`config/` contains web, console, database, and test configuration. `commands/` holds console controllers. Asset bundles live in `assets/`; browser scripts, styles, and images live in `web/js/`, `web/css/`, and `web/img/`. `web/` is the document root. Treat `vendor/` and bundled libraries such as `PHPExcel/` as third-party code. Avoid editing generated files in `runtime/` and `web/assets/`.

## Build, Test, and Development Commands
Run from root:

- `php -S 127.0.0.1:8080 -t web`: start a local PHP server after configuring an isolated development database.
- `php -l controllers/AreaController.php`: check PHP syntax; repeat for each changed PHP file.
- `php vendor/bin/codecept run unit`: run unit tests once the test configuration is restored.
- `php vendor/bin/codecept run functional`: run application request tests under the same prerequisite.
- `php vendor/bin/codecept build`: regenerate tester helpers after changing suite modules.

This snapshot includes dependencies but lacks a root Composer manifest and root Codeception configuration. Restore the matching project configuration before dependency installation or suite execution. No application build script is provided.

## Coding Style & Naming Conventions
Follow surrounding PHP conventions: four-space indentation, `app\` namespaces, PascalCase class names matching filenames, camelCase methods, and Yii action names such as `actionCreate`. Preserve existing Spanish domain names and database attribute names. Use `*Controller.php` and `*Search.php` suffixes consistently. No project-wide formatter or linter configuration is present; avoid unrelated reformatting.

## Testing Guidelines
Tests use Codeception with PHPUnit-style `*Test.php` files in `tests/unit/` and `*Cest.php` scenarios in `tests/functional/` and `tests/acceptance/`. Acceptance configuration is supplied only as an example and requires WebDriver. Use `config/test.php` and an isolated database configured through `config/test_db.php`. Add regression coverage for changed behavior; no coverage threshold is defined.

## Commit & Pull Request Guidelines
This snapshot has no Git metadata, so historical commit conventions cannot be verified. Use concise, imperative commit subjects. Pull requests should explain the affected workflow, link relevant issues, list validation results and configuration prerequisites, and include screenshots for UI changes.

## Security & Configuration
Keep credentials, database dumps, uploads, and logs out of new changes. Review local settings in `web/index.php` and `config/` before running the application; never use production credentials for development or tests.
