diff --git a/src/config/env.ts b/src/config/env.ts index 13f9a7e..2f77f5e 100644 --- a/src/config/env.ts +++ b/src/config/env.ts @@ -32,7 +32,7 @@ export const env = { /** Every documented endpoint lives under this prefix. */ apiBaseUrl: `${API_ORIGIN}/api/v1`, /** Organisation the app is branded for; sent at registration and at sign-in. */ - orgId: 'ORG001', + orgId: '107295', /** * Modules with no backend behind them yet — cards, loans, insurance, deposits, * the dashboard and the agent app — still resolve from fixtures. Registration, diff --git a/src/features/featureConfig.ts b/src/features/featureConfig.ts index 39025e5..4eb1085 100644 --- a/src/features/featureConfig.ts +++ b/src/features/featureConfig.ts @@ -1,4 +1,4 @@ -import { FeatureKey } from '../constants/featureKeys'; + import { FeatureKey } from '../constants/featureKeys'; import type { FeatureDefinition, FeatureOverrides } from './types'; /** @@ -22,7 +22,14 @@ export const DEFAULT_FEATURE_CONFIG: Record = { [FeatureKey.AUTH]: { enabled: true, description: 'Authentication module' }, [FeatureKey.AUTH_LOGIN]: { enabled: true }, [FeatureKey.AUTH_LOGIN_USER_ROLE]: { enabled: true, description: 'Customer login tab' }, - [FeatureKey.AUTH_LOGIN_AGENT_ROLE]: { enabled: true, description: 'Agent login tab' }, + [FeatureKey.AUTH_LOGIN_AGENT_ROLE]: { + enabled: false, + description: 'Agent login tab', + reason: + 'Off with the agent app itself. This key is not under `agent`, so it does not ' + + 'inherit that kill — left on, the tab would offer a role whose app no longer ' + + 'exists, and RootNavigator would drop the agent into the customer app instead.', + }, [FeatureKey.AUTH_LOGIN_BIOMETRIC]: { enabled: true }, [FeatureKey.AUTH_LOGIN_FORGOT_PASSWORD]: { enabled: true }, [FeatureKey.AUTH_REGISTER]: { @@ -251,7 +258,14 @@ export const DEFAULT_FEATURE_CONFIG: Record = { }, // --------------------------------------------------------------- Agent ---- - [FeatureKey.AGENT]: { enabled: true, description: 'Field-agent application' }, + [FeatureKey.AGENT]: { + enabled: false, + description: 'Field-agent application', + reason: + 'Parked for now. Disabling this root retires the whole agent app — the 24 keys ' + + 'below inherit it, so they are left as they are and the module comes back in ' + + 'one edit. Pair with `auth.login.agentRole`, which sits outside this subtree.', + }, [FeatureKey.AGENT_DASHBOARD]: { enabled: true }, [FeatureKey.AGENT_DASHBOARD_MAIN]: { enabled: true }, diff --git a/src/features/featureService.test.ts b/src/features/featureService.test.ts index ff50255..3bb7d8c 100644 --- a/src/features/featureService.test.ts +++ b/src/features/featureService.test.ts @@ -69,6 +69,11 @@ describe('featureService', () => { it('disables a single child without touching its parent or siblings', () => { featureService.setSource(FeatureSource.Remote, { + // The agent app ships disabled, so its root is turned on here rather than + // assumed. This test is about child-level isolation, not about which + // products happen to be switched on in the static config — leaving that + // implicit is what made it fail the day the agent app was parked. + [FeatureKey.AGENT]: true, [FeatureKey.AGENT_CUSTOMERS_CREATE]: false, [FeatureKey.AGENT_CUSTOMERS_DELETE]: false, }); @@ -208,6 +213,10 @@ describe('guardFeature', () => { }); it('runs the action while the feature is enabled', () => { + // Same reason as above: the key is a fixture for the guard's behaviour, so + // its subtree is enabled explicitly rather than inherited from the config. + featureService.setSource(FeatureSource.Remote, { [FeatureKey.AGENT]: true }); + const action = jest.fn(() => 'ran'); const guarded = guardFeature(FeatureKey.AGENT_CUSTOMERS_DELETE, action);