From c9b8431f35cbd1888c37a0b125cc32621472515c Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 14 Jul 2026 20:18:36 -0400 Subject: [PATCH 1/2] feat: add Firestore composite indexes for lobbying explorer Adds indexes required for the lobbying pages: - lobbyingFilings: generalCourt+billId, entityNameNorm+year, clientNameNorm+year, entityNameNorm+generalCourt+billId, clientNameNorm+generalCourt+billId, generalCourt+entityNameNorm, generalCourt+clientNameNorm - lobbyingRegistrants: entityNameNorm+year Co-Authored-By: Claude Sonnet 4.6 --- firestore.indexes.json | 147 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 140 insertions(+), 7 deletions(-) diff --git a/firestore.indexes.json b/firestore.indexes.json index 83cb3fa6d..e78707bc2 100644 --- a/firestore.indexes.json +++ b/firestore.indexes.json @@ -788,25 +788,46 @@ "collectionGroup": "ballotQuestions", "queryScope": "COLLECTION", "fields": [ - { "fieldPath": "electionYear", "order": "ASCENDING" }, - { "fieldPath": "ballotStatus", "order": "ASCENDING" } + { + "fieldPath": "electionYear", + "order": "ASCENDING" + }, + { + "fieldPath": "ballotStatus", + "order": "ASCENDING" + } ] }, { "collectionGroup": "publishedTestimony", "queryScope": "COLLECTION_GROUP", "fields": [ - { "fieldPath": "ballotQuestionId", "order": "ASCENDING" }, - { "fieldPath": "publishedAt", "order": "DESCENDING" } + { + "fieldPath": "ballotQuestionId", + "order": "ASCENDING" + }, + { + "fieldPath": "publishedAt", + "order": "DESCENDING" + } ] }, { "collectionGroup": "publishedTestimony", "queryScope": "COLLECTION", "fields": [ - { "fieldPath": "billId", "order": "ASCENDING" }, - { "fieldPath": "court", "order": "ASCENDING" }, - { "fieldPath": "ballotQuestionId", "order": "ASCENDING" } + { + "fieldPath": "billId", + "order": "ASCENDING" + }, + { + "fieldPath": "court", + "order": "ASCENDING" + }, + { + "fieldPath": "ballotQuestionId", + "order": "ASCENDING" + } ] }, { @@ -898,6 +919,118 @@ } } ] + }, + { + "collectionGroup": "lobbyingFilings", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "generalCourt", + "order": "ASCENDING" + }, + { + "fieldPath": "billId", + "order": "ASCENDING" + } + ] + }, + { + "collectionGroup": "lobbyingFilings", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "generalCourt", + "order": "ASCENDING" + }, + { + "fieldPath": "chamber", + "order": "ASCENDING" + } + ] + }, + { + "collectionGroup": "lobbyingFilings", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "generalCourt", + "order": "ASCENDING" + }, + { + "fieldPath": "entityNameNorm", + "order": "ASCENDING" + } + ] + }, + { + "collectionGroup": "lobbyingFilings", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "generalCourt", + "order": "ASCENDING" + }, + { + "fieldPath": "clientNameNorm", + "order": "ASCENDING" + } + ] + }, + { + "collectionGroup": "lobbyingFilings", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "registrantId", + "order": "ASCENDING" + }, + { + "fieldPath": "year", + "order": "DESCENDING" + } + ] + }, + { + "collectionGroup": "lobbyingFilings", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "clientNameNorm", + "order": "ASCENDING" + }, + { + "fieldPath": "year", + "order": "DESCENDING" + } + ] + }, + { + "collectionGroup": "lobbyingFilings", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "entityNameNorm", + "order": "ASCENDING" + }, + { + "fieldPath": "year", + "order": "DESCENDING" + } + ] + }, + { + "collectionGroup": "lobbyingRegistrants", + "queryScope": "COLLECTION", + "fields": [ + { + "fieldPath": "entityNameNorm", + "order": "ASCENDING" + }, + { + "fieldPath": "year", + "order": "DESCENDING" + } + ] } ], "fieldOverrides": [ From 48d9c7d6d4ebb6c9dbe30be9011a00901cbedeaf Mon Sep 17 00:00:00 2001 From: Nathan Date: Tue, 14 Jul 2026 21:33:30 -0400 Subject: [PATCH 2/2] feat: add Firestore read rule for lobbyingMeta collection Required for the lobbying explorer Vercel preview to read overview stats. Co-Authored-By: Claude Sonnet 4.6 --- firestore.rules | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firestore.rules b/firestore.rules index 42db67276..df5659ac5 100644 --- a/firestore.rules +++ b/firestore.rules @@ -111,6 +111,10 @@ service cloud.firestore { allow read: if true; allow write: if false; } + match /lobbyingMeta/{id} { + allow read: if true; + allow write: if false; + } match /transcriptions/{tid} { // public, read-only allow read: if true