ICPI Contract And Validation Surface
Status: ACTIVE
Sprint: Extraction Prep Sprint 45
Purpose
This document records the ICPI-owned contract and validation surface after the first code-boundary hardening pass.
Resolving locale, route permissions, and workspace projection.
Current scope: Guest
Category: 10_normative | Version: v1.0.0
Owner: DOCUMENT_CUSTODIAN | Review cycle: 90 days
Approval authority: GOVERNANCE_ADMIN
Documentation portal is read-only. Editing and mutation endpoints are disabled.
Kvary platform is originally created in Georgian. Where a Georgian version exists, Georgian is authoritative for platform UI, documentation, and legal interpretation.
Translations into other languages are provided for convenience. Some records may originate in other languages and carry their own source or legal locale for a specific flow, but where a Georgian version is available, the Georgian version prevails for platform-level wording and interpretation.
Metadata incomplete: Document ID, Version, Owner Role, Last Review Date, Next Review Date, Change Log
Status: ACTIVE
Sprint: Extraction Prep Sprint 45
This document records the ICPI-owned contract and validation surface after the first code-boundary hardening pass.
It distinguishes:
Primary file:
services/svc-tenders/src/icpi/contracts.ts| Contract | Purpose | Notes |
| --- | --- | --- |
| IcpiPriceListResponse | GET /icpi/prices success payload | canonical read/list response shape inside svc-tenders ICPI code |
| IcpiSuggestionResponse | GET /icpi/suggest success payload | canonical suggestion response shape |
| IcpiLatestPricePointResponse | GET /icpi/latest/:itemCode success payload | canonical latest lookup response |
| IcpiEstimateResponse | GET /icpi/estimate success payload | canonical estimate response |
| IcpiUpsertResponse | POST /icpi/upsert success payload | canonical write result shape |
| IcpiUpsertResponseMeta | upsert metadata sub-shape | accepted/received/duplicates counters |
| IcpiRouteSupport | shell-to-route support contract | still shell-dependent, but now ICPI-owned as a contract surface |
| Contract | Purpose | Notes |
| --- | --- | --- |
| UpsertIcpiPriceRequestRow | incoming ICPI upsert row shape | pre-normalization request row |
| UpsertIcpiPriceRequest | incoming upsert request body | optional source metadata plus rows |
| IcpiListFilters | read-only filter surface without pagination internals | useful for count/read filter distinction |
| IcpiListOptions | repository read options including pagination | current list/read repository input |
| Contract | Purpose | Notes |
| --- | --- | --- |
| IcpiQuarter | quarter enum-like scalar | reused across request, persistence, and response |
| IcpiPricePoint | canonical ICPI stored/read row shape | shared by repository and route responses |
| IcpiSuggestion | canonical suggestion/read shape | suggestion/latest-related read surface |
| UpsertIcpiPriceInput | normalized write input for repository | post-parse, post-normalization write shape |
| IcpiRepositoryPort | route -> repository dependency contract | narrows route dependency to ICPI-owned surface |
| IcpiEstimate | estimate payload sub-shape | route-facing but derived from repository read result |
| IcpiPriceListMeta | list response metadata | route-facing support shape |
Primary file:
services/svc-tenders/src/icpi/validation.ts| Validation | Purpose | Previous host | Current verdict |
| --- | --- | --- | --- |
| icpiQuarterSchema | quarter scalar validation | mixed services/svc-tenders/src/validation.ts | now ICPI-owned |
| upsertIcpiPriceSchema | upsert request validation | mixed services/svc-tenders/src/validation.ts | now ICPI-owned |
This is the truthful split today. ICPI still has one route file and one repository file, but the contract surface is no longer rooted in mixed non-ICPI files.
VERIFIED
services/svc-tenders/src/repository.ts still:
src/icpi/contracts.tsIcpiRepositoryThis is transitional compatibility, not primary contract ownership.
VERIFIED
IcpiRouteSupport is now ICPI-owned as a contract, but its runtime implementation still comes from shell-owned helpers in services/svc-tenders/src/server.ts.
VERIFIED
apps/web/src/portal/api.ts still defines local ICPI client-side shapes such as:
IcpiLatestPricePointIcpiSuggestionOptionIcpiPriceListFiltersIcpiPriceListMetaIcpiPriceListResponseThat duplication was not rewritten in this sprint.
After Sprint 45:
That is the right state for the next extraction-prep sprint.