## 1. Access control

- [x] 1.1 Call `$this->checkCompanyAccess(request()->company_mode)` at the start of `EmployeeController::import`
- [x] 1.2 Call `$this->checkCompanyAccess(request()->company_mode)` at the start of `EmployeeController::updateMulti`

## 2. Import reading and row numbers

- [x] 2.1 Add `App\Imports\EmployeeImport` (WithHeadingRow, WithCalculatedFormulas, without SkipsEmptyRows) and use it in `import`
- [x] 2.2 Compute the Excel row number as index + 2, and skip rows where every cell is blank without reporting them
- [x] 2.3 Read the new `phong_ban` and `cong_ty` heading keys (trimmed, blank when the column is missing) and verify the slugs Maatwebsite generates

## 3. Position / company resolution

- [x] 3.1 Preload the positions with their department and company once per request, and the companies as a name → list map
- [x] 3.2 Implement company scope resolution per D2 (`company_mismatch`, `company_not_found`, `company_ambiguous`)
- [x] 3.3 Implement position resolution: name + company scope + optional department name → `position_required`, `position_not_found`, `position_ambiguous`, or exactly one Position
- [x] 3.4 Remove the `Position::getDefault()` ("Unknown") fallback from the import
- [x] 3.5 Use the resolved position's company for `Helper::workdayToMinute` and as the `contract_position` default

## 4. createAccount

- [x] 4.1 Let `Account::createAccount` accept `$account['position']` as a `Position` instance, and keep the name lookup for string values
- [x] 4.2 Pass the resolved Position model from the import, and confirm that the leader default uses that position's department

## 5. Row validation and error collection

- [x] 5.1 Add required-field checks (`ho`, `ten`, `email`, `sdt`) → `required_field_missing`, instead of the silent `continue`
- [x] 5.2 Check duplicate email, code and phone against the DB and within the file → `email_duplicated`, `code_duplicated`, `phone_duplicated`. Add the values to the in-memory sets after a successful insert
- [x] 5.3 Add max-length checks with `mb_strlen` (191 for the varchar columns, including "Vị trí HĐ") → `value_too_long` with the column heading
- [x] 5.4 Collect all the reasons for a row before deciding, and skip the insert when there are any
- [x] 5.5 Fix the transaction flow: commit on success, roll back on an exception and record `unknown_error` (no commit after rollback)

## 6. Response

- [x] 6.1 Build the `errors[]` array (`row`, `code`, `email`, `reasons[{code, column, message}]`) ordered by row, with Vietnamese messages
- [x] 6.2 Keep the existing count fields and map the reason codes to them (position/company reasons → `position_error_count`)
- [x] 6.3 Update the OpenAPI annotation of `import` (the `company_mode` parameter, the new columns, the response shape)

## 7. Template

- [x] 7.1 Add "Phòng ban" and "Công ty" columns after "Vị trí" in `public/excels/hrm_employee_seeding.xlsx`
- [x] 7.2 Remove the stale "Vị trí" reference sheet and re-target the dropdown validations to the correct columns

## 8. Tests

- [x] 8.1 Feature test: same position name in two departments or companies resolves correctly with "Phòng ban"/"Công ty"
- [x] 8.2 Feature test: ambiguous, not found, blank position and company mismatch rows are reported, and the valid rows are still created
- [x] 8.3 Feature test: duplicate code against the DB, duplicate email or phone within the file, "Vị trí HĐ" of 192 characters, and multiple reasons in one row
- [x] 8.4 Feature test: correct Excel row number when the file contains an empty row
- [x] 8.5 Feature test: 403 for `import`/`update-multi` with an inaccessible or `all` company_mode for a restricted admin
- [x] 8.6 Cover the import contract-position default (blank "Vị trí HĐ" → resolved position name, filled → trimmed value) and the leader default from the resolved department in `tests/Feature/EmployeeImportTest.php` (`EmployeeContractPositionTest.php` has no import tests to update)
- [x] 8.7 Feature test: `company_not_found` / `company_ambiguous` in `all` mode, a file without "Phòng ban"/"Công ty" columns, and email duplicates that differ only in letter case
