@@ -99,6 +99,7 @@ export function createSession(sessionId: string): SessionState {
9999 ageCategory : null ,
100100 gender : null ,
101101 supportNeed : null ,
102+ adviceSubcategory : null ,
102103 additionalNeeds : [ ] ,
103104 needCount : 0 ,
104105 homeless : null ,
@@ -247,6 +248,9 @@ const needProfileRequirements: Record<string, string[]> = {
247248 // Drop In: Age (youth drop-ins), Gender (some gender-specific)
248249 'Drop In' : [ 'age' , 'gender' ] ,
249250
251+ // Advice: subcategory selection provides targeting, no further profiling
252+ 'Advice' : [ ] ,
253+
250254 // Location-only needs - no profiling required
251255 'Food' : [ ] ,
252256 'Items' : [ ] ,
@@ -417,6 +421,14 @@ const nationalFallbacks: Record<string, Array<{name: string; phone?: string; web
417421 website : 'https://nationalcareers.service.gov.uk' ,
418422 description : 'Free careers advice, skills assessment and training information'
419423 }
424+ ] ,
425+ 'Advice' : [
426+ {
427+ name : 'Citizens Advice' ,
428+ phone : '0800 144 8848' ,
429+ website : 'https://www.citizensadvice.org.uk' ,
430+ description : 'Free, confidential advice on benefits, debt, housing, legal and other issues'
431+ }
420432 ]
421433} ;
422434
@@ -514,7 +526,7 @@ function buildNonHousingTerminal(session: SessionState): string {
514526
515527function buildTerminalServices ( session : SessionState ) : string {
516528 // Check if this is a non-housing need
517- const housingRelatedNeeds = [ 'Emergency Housing' , 'Advice' ] ;
529+ const housingRelatedNeeds = [ 'Emergency Housing' ] ;
518530 if ( session . supportNeed && ! housingRelatedNeeds . includes ( session . supportNeed ) ) {
519531 return buildNonHousingTerminal ( session ) ;
520532 }
@@ -1060,11 +1072,19 @@ export function processInput(session: SessionState, input: string): RoutingResul
10601072 case 'B5_MAIN_SUPPORT_NEED' :
10611073 const needOptions = [ 'Emergency Housing' , 'Food' , 'Work' , 'Health' , 'Advice' , 'Drop In' , 'Financial' , 'Items' , 'Services' , 'Comms' , 'Training' , 'Activities' ] ;
10621074 const need = choice ? needOptions [ choice - 1 ] : null ;
1063-
1064- // Housing-related needs require full profiling (age, gender, homelessness status, etc.)
1065- const housingRelatedNeeds = [ 'Emergency Housing' , 'Advice' ] ;
1075+
1076+ // Advice routes to subcategory selection
1077+ if ( need === 'Advice' ) {
1078+ return {
1079+ ...phrase ( 'B5A_ADVICE_TYPE' , session . isSupporter ) ,
1080+ stateUpdates : { currentGate : 'B5A_ADVICE_TYPE' , supportNeed : need , needCount : session . needCount + 1 }
1081+ } ;
1082+ }
1083+
1084+ // Housing needs require full profiling
1085+ const housingRelatedNeeds = [ 'Emergency Housing' ] ;
10661086 const needsFullProfiling = housingRelatedNeeds . includes ( need || '' ) ;
1067-
1087+
10681088 if ( needsFullProfiling ) {
10691089 // Continue to homelessness status question
10701090 return {
@@ -1076,7 +1096,13 @@ export function processInput(session: SessionState, input: string): RoutingResul
10761096 const updatedSession = { ...session , supportNeed : need , needCount : session . needCount + 1 } ;
10771097 return routeToNextProfileQuestion ( updatedSession ) ;
10781098 }
1079-
1099+
1100+ case 'B5A_ADVICE_TYPE' :
1101+ const adviceOptions = [ 'Advice:Benefits' , 'Advice:Debt' , 'Advice:Employment' , 'Advice:Immigration' , 'Advice:Health' , 'Advice:Legal' , 'Advice:General' ] ;
1102+ const adviceSub = choice ? adviceOptions [ choice - 1 ] : null ;
1103+ const adviceSession = { ...session , adviceSubcategory : adviceSub } ;
1104+ return routeToNextProfileQuestion ( adviceSession ) ;
1105+
10801106 // ============================================================
10811107 // CATEGORY-SPECIFIC PROFILING GATES
10821108 // ============================================================
0 commit comments