# Source-to-target mapping and acceptance example

**Purpose.** Demonstrate how a business analyst could specify and validate a small analytical integration using public portfolio data. This is not an employer specification, a confidential client artifact, or proof of a production interface.

**System boundary.** The input is `financial-metrics.csv`, a manually prepared extract from the independent Pfizer financial case. The loader `build_model.py` writes a local SQLite database using `model.sql`. The consumer is the two SQL decision views. No automated SEC ingestion, scheduled refresh, authentication, client application, or production handoff is claimed.

| Input field | Target field | Mapping and acceptance rule |
| --- | --- | --- |
| `Metric` | `source_metric.metric` | Copy the six approved metric names. Reject an unexpected or duplicate metric. |
| `FY2024_USD_millions` | `source_metric.amount_usd_millions`, `fiscal_year=2024` | Parse a number in USD millions; map an empty cell to SQL NULL. Never substitute zero. |
| `FY2025_USD_millions` | `source_metric.amount_usd_millions`, `fiscal_year=2025` | Parse a number in USD millions; map an empty cell to SQL NULL. |
| `Basis` | `source_metric.source_basis` | Preserve the stated source/calculation basis; reject a blank basis. |
| One metric row per CSV record | Two rows in `source_metric` | Expand by fiscal year. The `(metric, fiscal_year)` primary key prevents duplication. |
| `Operating cash flow` and `Capital expenditures` for 2025 | `cash_bridge_2025.calculated_free_cash_flow` | Subtract CapEx from OCF; compare with the supplied `Free cash flow` model row. |
| 2025 OCF and `Cash dividends paid` | `cash_decision_metrics_2025` | Calculate OCF/dividends and free cash flow less dividends; protect division by zero with `NULLIF`. |

## Acceptance cases and observed results

| Case | Expected result | Observed when running `python build_model.py` |
| --- | --- | --- |
| Approved field set and grain | Six named metrics; two fiscal years; 12 unique metric-year rows | Pass |
| Source lineage | Nonblank basis on each input metric | Pass |
| Missing-value semantics | Blank FY2024 CapEx remains NULL | Pass |
| Cash reconciliation | 11,704 - 2,629 = 9,075 USD millions, matching the model row | Pass |
| Decision measures | OCF/dividend coverage 1.20; FCF less dividends -696 USD millions | Pass |

**Exception handling.** The runner stops with an assertion error if the approved metric set, source basis, missing-value rule, reconciliation, or decision values change. A real production integration would also require agreed data ownership, monitored refresh, access control, failure routing, release approval, and signed user acceptance criteria. Those are outside this portfolio sample.
