assessment-model/src/app/utils
Khalim Conn-Kowlessar 71f746984a refactor(epc): single source of truth for the SAP↔EPC band threshold ladder
The 92/81/69/55/39/21 band floors were defined in five places across TS and
SQL — @/app/utils.sapToEpc, a hand-copied sapToEpcLetter in actions, the
EPC_TO_SAP_MIN/MAX ranges, and the BAND_BUCKETS_SQL/EPC_MIN_SAP in both
scenario-metrics routes. "What SAP score is band C" now lives once in
@/lib/epc/thresholds (BAND_MIN_SAP), with a SQL twin in thresholdsSql.

- lib/epc/thresholds.ts: BAND_MIN_SAP, sapToBand, EPC_TO_SAP_MIN/MAX (derived)
- lib/epc/thresholdsSql.ts: sapBandBucketsSql() built from the same ladder
- @/app/utils.sapToEpc + @/app/utils/epc now delegate to the canonical ladder
- deleted the hand-copied sapToEpcLetter in actions/recommendations.ts
- both metrics routes use sapBandBucketsSql / BAND_MIN_SAP

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 13:26:08 +01:00
..
epc.ts refactor(epc): single source of truth for the SAP↔EPC band threshold ladder 2026-07-20 13:26:08 +01:00
propertyFilters.ts Merge remote-tracking branch 'origin/main' into feature/portfolio-tagging 2026-07-13 19:49:47 +00:00
s3.ts refactored with improve-code-archievture and grill-with-docs 2026-05-06 15:49:34 +00:00
sqs.ts added trigger of sqs 2026-04-18 18:55:19 +00:00