using PlotLine.Models.Investigations; namespace PlotLine.Services.Investigations; // Trusted authenticated adapters only. Catalogue data never supplies a URL or a controller name. public static class DestinationRegistry { public static readonly HashSet Resolvers=["Write","Characters","PlotThreads","Timeline","Relationships","Review"]; public static (string Controller,string Action,object Values)? Resolve(Capability d,int project,int book,bool authorised,IReadOnlyDictionary answers) { if(!authorised||!d.Available||project<=0||d.RequiresBook&&book<=0||!InvestigationEngine.Allows(d.Prerequisites,answers))return null; var controller=d.Resolver switch{"Write"=>"Writer","Characters"=>"Characters","PlotThreads"=>"PlotLineWorkspace","Timeline"=>"Timeline","Relationships"=>"RelationshipMap","Review"=>"Writer",_=>null}; return controller==null?null:(controller,controller=="Writer"?(d.Resolver=="Review"?"Review":"Write"):"Index",new{projectId=project,bookId=book}); } }