Keep nonbanking panel routes available with minimal adapters

This commit is contained in:
unimatrix 2026-11-23 15:44:37 +00:00
commit 31fa039e4f

View file

@ -37,6 +37,9 @@ async function officeAuthority(tx,d,actor,now,lock=false){
return holder;
}
export function createPoliticalDecisions(db,bank,keys,deps={}){
// Unrelated panel routes also run with a read-only/minimal store. They must
// remain usable; only this decision service requires transactional banking.
if(typeof db?.query!=='function'||typeof db?.transaction!=='function')return{read:async()=>fail('Decision banking unavailable.',503),execute:async()=>fail('Decision banking unavailable.',503)};
// The production central pool exposes prepared reads rather than first().
// Keep every transaction callback on its original connection.
db={...boardReadStore(db,db),transaction:db.transaction.bind(db)};