Commit 9146b013 authored by Sergio Gimenez's avatar Sergio Gimenez
Browse files

wip

parent 9ae03228
Loading
Loading
Loading
Loading
+4 −3
Changes for fm/persistence-model.md: 4 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -171,7 +171,7 @@ Indexes: `idx_partner_ops_mcc_mnc`, `idx_partner_ops_status`, `idx_partner_ops_o
| `direction` | VARCHAR(10) | NOT NULL | `inbound` when FM issued the context; `outbound` when the partner issued it |
| `federation_context_id` | VARCHAR(255) | NOT NULL | Opaque OPG.04 context identifier; not assumed to be a UUID |
| `status_callback_url` | TEXT | | OPG.04 `partnerStatusLink` for status callbacks |
| `status` | VARCHAR(20) | NOT NULL | Directed federation lifecycle state |
| `status` | VARCHAR(20) | NOT NULL | Lowercase mirror of the OPG.04 `Status` enum carried by the `onPartnerStatusEvent` callback: `available`, `locked`, `not_available`, `temporary_failure`, `failed`; plus `terminated` once `DeleteFederationDetails` has run (row kept for audit). No pending state: `CreateFederation` returns the `federationContextId` synchronously |
| `created_at` | TIMESTAMPTZ | NOT NULL, DEFAULT now() | |
| `updated_at` | TIMESTAMPTZ | NOT NULL, DEFAULT now() | |

@@ -337,11 +337,11 @@ Tracks the FM rewrite (branch `feature/r2-fastapi-rewrite`). Update as tables la
| Table | Schema in code | Repo adapter | Notes |
|---|---|---|---|
| `partner_ops` | Partial (id, mcc_mnc, oauth2_client_id, base_url, our_client_id, our_client_secret_ref, token_endpoint, status) | `PostgresPartnerRepo.find_by_oauth2_client_id`, `.find_by_id` | `name`, `supported_apis`, `sla_config`, `last_health_check_at`, `partner_ca_cert_path` pending |
| `federation_contexts` | Not yet | — | Required to resolve opaque OPG.04 `federationContextId` by partner and direction |
| `federation_contexts` | Full | `PostgresFederationContextRepo.find_active_outbound`, `.find_inbound` | Not yet consulted by the outbound hand-off (`APIForwarding` rework pending) |
| `federation_agreements` | Full | `PostgresAgreementRepo.find_active_for_partner` (prefers the agreement valid now, else newest) | Used by inbound authorizer and outbound hand-off (`AgreementChecker`) |
| `routing_rules` | Full (incl. `UNIQUE(identifier_type, value_range, priority)`, partial active index) | `PostgresRoutingRuleRepo.list_active` | Matching lives in `domain/routing.py` (`RoutingResolver`): most specific match wins, `priority` breaks ties |
| `shared_resource_catalogues` | Not yet | — | Catalogue sync (Phase 2) |
| `federation_transactions` | Partial (current code lacks context, idempotency, request fingerprint, external resource, and callback columns) | `PostgresTransactionRepo.add`, `.record_outcome` | Written `pending` before the outbound hand-off; inbound `command.srm.*` path not wired yet |
| `federation_transactions` | Partial (has `federation_context_row_id` and `external_txn_id`; lacks idempotency, request fingerprint, external resource, and callback columns) | `PostgresTransactionRepo.add`, `.record_outcome` | Written `pending` before the outbound hand-off; inbound `command.srm.*` path not wired yet |

## Revision History

@@ -350,3 +350,4 @@ Tracks the FM rewrite (branch `feature/r2-fastapi-rewrite`). Update as tables la
| 2.0-draft | 2026-08-06 | Initial FM persistence model, promoted from requirements-and-design §J–§K. |
| 2.1-draft | 2026-09-08 | Align entities, context routing, transaction audit fields, ADR references, and DataBus roles with current FM architecture. |
| 2.1-draft | 2026-09-08 | Dropped `X-Federation-Correlation-ID`; `federation_correlation_id` replaced by `external_txn_id`. |
| 2.1-draft | 2026-09-08 | `federation_contexts` landed in code; status vocabulary enumerated from the OPG.04 `Status` enum. |
+2 −1
Changes for fm/requirements-and-design.md: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -152,7 +152,7 @@ federation_contexts 1 ──── * federation_transactions
| `direction` | VARCHAR(10) | NOT NULL | `inbound` when we issued the context; `outbound` when partner issued it |
| `federation_context_id` | VARCHAR(255) | NOT NULL | Opaque OPG.04 `FederationContextId`; never assume UUID format |
| `status_callback_url` | TEXT | | `partnerStatusLink` used for required OPG.04 status callbacks |
| `status` | VARCHAR(20) | NOT NULL | Directed federation lifecycle state |
| `status` | VARCHAR(20) | NOT NULL | Lowercase mirror of the OPG.04 `Status` enum carried by the `onPartnerStatusEvent` callback: `available`, `locked`, `not_available`, `temporary_failure`, `failed`; plus `terminated` once `DeleteFederationDetails` has run (row kept for audit). No pending state: `CreateFederation` returns the `federationContextId` synchronously |
| `created_at` | TIMESTAMPTZ | NOT NULL, DEFAULT now() | |
| `updated_at` | TIMESTAMPTZ | NOT NULL, DEFAULT now() | |

@@ -647,3 +647,4 @@ A locally connected App Provider queries device location for a subscriber on a p
| 2.0 | 2026-07-07 | OOP Release 2.0. |
| 2.0 | 2026-09-04 | REQ-FED-19 narrowed for partner profiles/agreements only (routing rules explicitly unaffected — out of ADR-0043's scope); added REQ-FED-20/21 for OEG-proxied federation establishment (ADR-0043) and SRM-forwarded federated deploys (ADR-0044). Added L.3a and `command.fm.federation.*` to K.2; L.3 scoped to subscriber-identifier routing only. |
| 2.0 | 2026-09-08 | Dropped the `X-Federation-Correlation-ID` extension: OPG.04 v1.4.0 defines no correlation header and a partner never stores or echoes it. REQ-FED-10 reworded; `federation_transactions.federation_correlation_id` replaced by `external_txn_id` (OPG.04 `txnIdentifier`/`apiTxnId`). |
| 2.0 | 2026-09-08 | Enumerated `federation_contexts.status`: OPG.04 `Status` values plus `terminated`; establishment is synchronous so there is no pending state. |