You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3.**Capabilities are overridable** - Brokered connections can restrict/modify capabilities (e.g., disable rating)
51
-
4.**Implicit visibility** - BrokeredConnection existence grants access; AccountConnection in OSS is system-wide accessible (Insiders: org-scoped)
52
+
4.**Implicit visibility** - BrokeredConnection existence grants access; Carrier in OSS is system-wide accessible (Insiders: org-scoped via CarrierLink)
10.**Keep Carrier model name** - Do NOT rename to AccountConnection; remove `is_system`, `active_users`, `active_orgs` fields
61
+
11.**Single utility module** - Consolidate GatewayMixin, UnifiedConnection, ConnectionResolver into single `carriers.py` utility with `resolve_carrier()` and `create_snapshot()` functions
62
+
12.**Gateway logic on models** - Each model (Carrier, SystemConnection, BrokeredConnection) keeps its own `gateway` property
63
+
13.**Complete gateway.Carriers replacement** - `gateway.Connections` completely replaces `gateway.Carriers` (no alias)
23.**Carrier snapshot minimal data** - Store: connection_id, connection_type, carrier_code, carrier_id, carrier_name, test_mode (no capabilities, no config)
78
+
24.**Visibility via CarrierLink only** - Remove active_users/active_orgs M2M; OSS: all carriers visible; Insiders: org-scoped via CarrierLink
79
+
25.**Orgs package in same PR** - Create BrokeredConnectionLink in orgs package as part of this migration
80
+
81
+
#### Implementation Details
82
+
26.**Utility in core/utils.py** - Add `resolve_carrier()` and `create_snapshot()` functions to existing core utils module
83
+
27.**Org brokered created_by is null** - Org-scoped BrokeredConnections have created_by=null; access via BrokeredConnectionLink
84
+
28.**Simple snapshot, no fallback ID** - Snapshot contains connection_id only; if connection deleted, use snapshot for display only
85
+
29.**resolve_carrier() returns None** - When connection not found or access denied, return None (caller handles)
86
+
30.**Brokered snapshot uses system ID** - When BrokeredConnection is used, snapshot stores SystemConnection ID (stable if brokered deleted)
87
+
31.**Connection type values** - Use "account", "system", "brokered" as connection_type values in snapshots
88
+
32.**SystemConnection.created_by** - Nullable FK(User, on_delete=SET_NULL) to track admin who created it
89
+
33.**Brokered resolution with system ID** - When resolving type='brokered' snapshot: find user's BrokeredConnection for that SystemConnection; return it if found, else return SystemConnection
90
+
34.**Brokered snapshot uses computed values** - Snapshot stores system.id as connection_id but uses brokered's computed carrier_id, carrier_name (respects overrides)
91
+
35.**Connections API: list() and first()** - Keep simple: `list()` returns all matching, `first()` returns first match
92
+
36.**Forward-only migration** - No reverse migration. Data is moved. Manual intervention needed for rollback.
93
+
94
+
### Areas Requiring Updates (Carrier References)
95
+
96
+
The following files/modules reference the Carrier model and will need updates:
97
+
98
+
**Core Module:**
99
+
-`modules/core/karrio/server/core/gateway.py` - Main gateway.Carriers class
0 commit comments