# Opening Balance Import Template Sign-off

**Task:** AST-1.8.1 — Opening Balance Import Template Design
**Workbook:** [`templates/asset-opening-balance-import-template-v1.0.0.xlsx`](./templates/asset-opening-balance-import-template-v1.0.0.xlsx)
**Version:** 1.0.0
**SHA-256:** `60fe8797316234a270af61abcdb1cb50defd92389208f61dcc541c3a5869b3ff`
**WBS STOP gate:** [Phase 1.8](./ASSET_MANAGEMENT_WBS.md#18--phase-8--opening-balance-import)

## Technical publication record

| Check | Result |
|---|---|
| Workbook sheets | `Serialized Assets`, `Quantity Assets`, `Optional Warranty` |
| Header contract | Published in [column dictionary](./OPENING_BALANCE_IMPORT_COLUMN_DICTIONARY.md) |
| Business rules | Duplicate codes rejected; existing assets never updated; explicit confirmation required |
| Schema mapping | Published in the column dictionary |
| Expected checksum supplied with the task | `03541472188e02fa6f7b0e40f6f081407bdfa16f1f1d3b4e50c7ff184feefbd4` |
| Published-workbook checksum | `60fe8797316234a270af61abcdb1cb50defd92389208f61dcc541c3a5869b3ff` |

The supplied expected checksum does not match this newly published workbook. No workbook existed at the requested path to preserve. The published checksum above is the authoritative integrity value for version 1.0.0 pending human review; replacing it requires a new checksum and renewed sign-off.

## Required approval path

Template approval is an application-authorized action, not a chat acknowledgement and not a hardcoded-role decision.

1. The designated capability is the existing canonical permission `asset.import.confirm`, registered in `backend/config/actions.php`. An application implementation must use the platform permission middleware/gate and effective permission resolution; it must not test a role name such as `admin`.
2. The requester submits the version, checksum, and template evidence through `App\Platform\Contracts\ApprovalGatewayContract::submit()` using the Asset module action slug `import.confirm` when approval is enabled for that action.
3. The platform approval workflow resolves the authorized reviewer and records its decision. Where template approval produces an application state, use the existing approval-executor registration mechanism (`Platform::registerApprovalExecutor()` and `ApprovalExecutorInterface`), not a new approval engine.
4. An attributable approval record must retain the reviewer identity, approval date/time, decision, and platform approval-request evidence together with the workbook version and checksum.

The current gateway uses the company/action approval setting. If approval is disabled, its documented immediate path is not evidence of a human template review. The STOP gate therefore requires an actual authorized approval record, regardless of an approval setting or a chat message.

## Actual sign-off record

| Field | Value |
|---|---|
| Status | **PENDING HUMAN SIGN-OFF** |
| Reviewer identity | Not recorded |
| Authorized permission verification | Not recorded |
| Decision | Not recorded |
| Approval date/time | Not recorded |
| Attributable approval evidence | Not recorded |

No approval record has been invented. AST-1.8.1 must not be marked complete until an authorized reviewer records approval through the applicable platform path.

## Attached dry-run results (AST-1.8.7)

Per the schema-based business rule (*"No production confirm until dry-run notes attached"*), the opening balance import dry-run was executed against a realistic copy of legacy enterprise data on a disposable database copy before production confirmation.

Detailed spike runbook & decision documentation: [OPENING_BALANCE_IMPORT_DRY_RUN_SPIKE.md](./OPENING_BALANCE_IMPORT_DRY_RUN_SPIKE.md)

| Check | Metric / Outcome |
|---|---|
| Target Environment | Disposable staging database copy |
| Validated Batch | Staged legacy register copy |
| Sheet Coverage | `Serialized Assets`, `Quantity Assets`, `Optional Warranty` |
| Error Report Generation | Verified (`error_report_path` generated via `AssetImportErrorReportExport`) |
| Confirmation Guard Status | **VERIFIED (0 domain records created)**: `serialized_assets`: +0, `inventory_transactions`: +0, `inventory_balances`: +0, `asset_warranties`: +0, `asset_finance_events`: +0, `employee_assets`: +0 |
| Automated Test Reference | `Modules/Asset/tests/Feature/OpeningImportDryRunTest.php` |
| CLI Verification Tool | `php artisan asset:import-dry-run {batch_id} --company={id}` |
| Production Confirm Rule | Production confirm remains blocked for unvalidated batches and batches containing uncorrected errors unless explicit valid-only confirmation is authorized. |

