@burdenoff/microfe-govcitizenhub 2026.720.7 → 2026.730.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/govcitizenhub/GovCitizenHubRoot.d.ts.map +1 -1
- package/dist/govcitizenhub/GovCitizenHubRoot.js +44 -36
- package/dist/govcitizenhub/GovCitizenHubRoot.js.map +1 -1
- package/dist/govcitizenhub/GovCitizenHubRoutes.d.ts.map +1 -1
- package/dist/govcitizenhub/GovCitizenHubRoutes.js +134 -6
- package/dist/govcitizenhub/GovCitizenHubRoutes.js.map +1 -1
- package/dist/govcitizenhub/components/DocumentUploadField.d.ts +17 -11
- package/dist/govcitizenhub/components/DocumentUploadField.d.ts.map +1 -1
- package/dist/govcitizenhub/components/DocumentUploadField.js +45 -42
- package/dist/govcitizenhub/components/DocumentUploadField.js.map +1 -1
- package/dist/govcitizenhub/components/GovCharts.js +127 -51
- package/dist/govcitizenhub/components/GovCharts.js.map +1 -1
- package/dist/govcitizenhub/hooks/index.d.ts +1 -0
- package/dist/govcitizenhub/hooks/index.d.ts.map +1 -1
- package/dist/govcitizenhub/hooks/index.js +1 -0
- package/dist/govcitizenhub/hooks/useGovApi.d.ts +3 -0
- package/dist/govcitizenhub/hooks/useGovApi.d.ts.map +1 -1
- package/dist/govcitizenhub/hooks/useGovApi.js +1 -1
- package/dist/govcitizenhub/hooks/useGovApi.js.map +1 -1
- package/dist/govcitizenhub/hooks/useIntelligenceApi.d.ts +214 -0
- package/dist/govcitizenhub/hooks/useIntelligenceApi.d.ts.map +1 -0
- package/dist/govcitizenhub/hooks/useIntelligenceApi.js +1140 -0
- package/dist/govcitizenhub/hooks/useIntelligenceApi.js.map +1 -0
- package/dist/govcitizenhub/index.d.ts +1 -0
- package/dist/govcitizenhub/index.d.ts.map +1 -1
- package/dist/govcitizenhub/index.js +18 -0
- package/dist/govcitizenhub/pages/agencies/AgenciesPage.js +7 -7
- package/dist/govcitizenhub/pages/agencies/AgencyFormDialog.js +6 -6
- package/dist/govcitizenhub/pages/applications/ApplicationDetailPage.js +16 -16
- package/dist/govcitizenhub/pages/applications/ApplicationsPage.js +35 -35
- package/dist/govcitizenhub/pages/applications/ApplicationsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/applications/NewApplicationPage.js +1 -1
- package/dist/govcitizenhub/pages/documents/DocumentsPage.js +5 -5
- package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js +30 -30
- package/dist/govcitizenhub/pages/grievances/GrievanceDetailPage.js.map +1 -1
- package/dist/govcitizenhub/pages/grievances/GrievancesPage.js +15 -15
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.js +634 -0
- package/dist/govcitizenhub/pages/intelligence/AdminLevelsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.d.ts +20 -0
- package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.js +537 -0
- package/dist/govcitizenhub/pages/intelligence/AssetFormDialog.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetImage.d.ts +11 -0
- package/dist/govcitizenhub/pages/intelligence/AssetImage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetImage.js +25 -0
- package/dist/govcitizenhub/pages/intelligence/AssetImage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.d.ts +15 -0
- package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.js +203 -0
- package/dist/govcitizenhub/pages/intelligence/AssetMapPanel.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.js +497 -0
- package/dist/govcitizenhub/pages/intelligence/BenchmarkPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/BudgetPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/BudgetPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/BudgetPage.js +1084 -0
- package/dist/govcitizenhub/pages/intelligence/BudgetPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.d.ts +13 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.js +581 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationFormDialog.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.d.ts +11 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.js +429 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationParticipateDialog.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.d.ts +8 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.js +235 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationResultsPanel.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.js +534 -0
- package/dist/govcitizenhub/pages/intelligence/ConsultationsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.js +723 -0
- package/dist/govcitizenhub/pages/intelligence/CorrectionsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ElectionsPage.d.ts +5 -0
- package/dist/govcitizenhub/pages/intelligence/ElectionsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ElectionsPage.js +1029 -0
- package/dist/govcitizenhub/pages/intelligence/ElectionsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/GovernancePage.d.ts +5 -0
- package/dist/govcitizenhub/pages/intelligence/GovernancePage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/GovernancePage.js +1545 -0
- package/dist/govcitizenhub/pages/intelligence/GovernancePage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.js +960 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorCatalogPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.d.ts +13 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.js +927 -0
- package/dist/govcitizenhub/pages/intelligence/IndicatorsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.js +620 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionDirectoryPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.d.ts +20 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.js +183 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionLayout.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.js +629 -0
- package/dist/govcitizenhub/pages/intelligence/JurisdictionProfilePage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.js +1124 -0
- package/dist/govcitizenhub/pages/intelligence/OpenDataPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ProjectsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/ProjectsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ProjectsPage.js +1518 -0
- package/dist/govcitizenhub/pages/intelligence/ProjectsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.js +577 -0
- package/dist/govcitizenhub/pages/intelligence/PublicAssetsPage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.d.ts +4 -0
- package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.js +534 -0
- package/dist/govcitizenhub/pages/intelligence/ServicePerformancePage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/TimelinePage.d.ts +5 -0
- package/dist/govcitizenhub/pages/intelligence/TimelinePage.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/TimelinePage.js +538 -0
- package/dist/govcitizenhub/pages/intelligence/TimelinePage.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/consultationQuestions.d.ts +53 -0
- package/dist/govcitizenhub/pages/intelligence/consultationQuestions.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/consultationQuestions.js +138 -0
- package/dist/govcitizenhub/pages/intelligence/consultationQuestions.js.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/index.d.ts +27 -0
- package/dist/govcitizenhub/pages/intelligence/index.d.ts.map +1 -0
- package/dist/govcitizenhub/pages/intelligence/index.js +17 -0
- package/dist/govcitizenhub/pages/payments/PaymentsPage.js +11 -11
- package/dist/govcitizenhub/pages/payments/PaymentsPage.js.map +1 -1
- package/dist/govcitizenhub/pages/permits/PermitsPage.js +6 -6
- package/dist/govcitizenhub/pages/services/ServiceDetailPage.js +8 -8
- package/dist/govcitizenhub/pages/services/ServiceFormDialog.js +98 -98
- package/dist/govcitizenhub/pages/services/ServiceFormDialog.js.map +1 -1
- package/dist/govcitizenhub/types/index.d.ts +1 -0
- package/dist/govcitizenhub/types/index.d.ts.map +1 -1
- package/dist/govcitizenhub/types/intelligence.d.ts +1559 -0
- package/dist/govcitizenhub/types/intelligence.d.ts.map +1 -0
- package/dist/govcitizenhub/types/intelligence.js +125 -0
- package/dist/govcitizenhub/types/intelligence.js.map +1 -0
- package/dist/index.js +19 -2
- package/dist/node_modules/recharts/es6/chart/BarChart.js +24 -0
- package/dist/node_modules/recharts/es6/chart/BarChart.js.map +1 -0
- package/dist/utils/pageContext.d.ts +1 -0
- package/dist/utils/pageContext.d.ts.map +1 -1
- package/dist/utils/pageContext.js +44 -17
- package/dist/utils/pageContext.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGovApi.js","names":[],"sources":["../../../src/govcitizenhub/hooks/useGovApi.ts"],"sourcesContent":["/**\n * GovCitizenHub API hooks\n * @module govcitizenhub/hooks\n *\n * React-Query hooks wired DIRECTLY to the real `wspace-govcitizenhub-svc`\n * federated GraphQL contract (the `gov*` operations). Every query/mutation below\n * uses an inline gql string whose fields match the svc `.hive-schema.graphql`\n * exactly. No mock data.\n *\n * Transport: `graphqlFetch({ gateway: 'workspace', workspaceToken: true })` — the\n * host shell supplies the gateway base URL + a workspace-scoped token.\n *\n * IMPORTANT: `User`/`File` are id-only federation stubs in this subgraph. We\n * never select `citizen { firstName }` or `file { url }`.\n */\n\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\n\nimport { useGovCitizenHub } from '../context';\nimport { clearGraphqlResponseCache } from '../lib/graphql-cache';\nimport type {\n GovConnection,\n GovAgency,\n GovService,\n GovServiceCategory,\n GovServiceStatus,\n GovApplication,\n GovApplicationStatus,\n GovDocument,\n GovDocumentStatus,\n GovCaseNote,\n GovPermit,\n GovPermitStatus,\n GovPayment,\n GovPaymentStatus,\n GovGrievance,\n GovGrievanceStatus,\n GovCreateAgencyInput,\n GovUpdateAgencyInput,\n GovCreateServiceInput,\n GovUpdateServiceInput,\n GovCreateApplicationInput,\n GovUpdateApplicationInput,\n GovAddDocumentInput,\n GovAddCaseNoteInput,\n GovCreatePaymentInput,\n GovIssuePermitInput,\n GovReportGrievanceInput,\n GovUpdateGrievanceInput,\n GovDashboardSummary,\n GovApplicationSlaSummary,\n GovServiceApplicationCount,\n GovDeskApplicationCount,\n PaginationInput,\n} from '../types';\n\n// ============================================================================\n// Transport\n// ============================================================================\n\nconst isMutation = (query: string): boolean => /^\\s*mutation\\b/.test(query);\n\nconst govQuery = async <TData>(\n query: string,\n variables: Record<string, unknown>,\n baseUrl?: string\n): Promise<TData> => {\n // A mutation must never be served from — or coalesced onto — the read cache,\n // and the resolved read cache must be dropped once it commits so the\n // React-Query refetch that follows sees the new state, not a stale (≤15s)\n // pre-write response. Clear before AND after the write.\n const mutating = isMutation(query);\n if (mutating) clearGraphqlResponseCache();\n\n const response = await graphqlFetch<TData>({\n gateway: 'workspace',\n baseUrl,\n query,\n variables,\n workspaceToken: true,\n });\n\n if (mutating) clearGraphqlResponseCache();\n\n // GraphQL partial success: the gateway can attach a non-fatal top-level error\n // (e.g. a be-sdk activity/usage tracking side-effect) alongside a fully-resolved\n // payload. Only treat the request as failed when it produced NO usable data —\n // otherwise the operation genuinely succeeded and surfacing the background error\n // as a destructive toast would mislead the user.\n const data = response.data as Record<string, unknown> | null | undefined;\n const hasUsableData =\n data != null && Object.values(data).some((value) => value !== null && value !== undefined);\n\n if (!hasUsableData) {\n throw new Error(response.errors?.[0]?.message ?? 'GraphQL response did not include data');\n }\n if (response.errors?.length) {\n // Non-fatal: keep the data, but leave a breadcrumb for diagnostics.\n console.warn('[govcitizenhub] GraphQL partial error (data returned):', response.errors);\n }\n return response.data as TData;\n};\n\n// React-Query key roots (one namespace per domain entity).\nconst KEY = {\n dashboard: ['govcitizenhub', 'dashboard-summary'] as const,\n applicationSlaSummary: ['govcitizenhub', 'application-sla-summary'] as const,\n applicationsByService: ['govcitizenhub', 'applications-by-service'] as const,\n applicationsByDesk: ['govcitizenhub', 'applications-by-desk'] as const,\n agencies: ['govcitizenhub', 'agencies'] as const,\n agency: (id: string) => ['govcitizenhub', 'agency', id] as const,\n services: ['govcitizenhub', 'services'] as const,\n service: (id: string) => ['govcitizenhub', 'service', id] as const,\n applications: ['govcitizenhub', 'applications'] as const,\n application: (id: string) => ['govcitizenhub', 'application', id] as const,\n payments: ['govcitizenhub', 'payments'] as const,\n payment: (id: string) => ['govcitizenhub', 'payment', id] as const,\n permits: ['govcitizenhub', 'permits'] as const,\n grievances: ['govcitizenhub', 'grievances'] as const,\n grievance: (id: string) => ['govcitizenhub', 'grievance', id] as const,\n};\n\nconst DEFAULT_PAGE: PaginationInput = { limit: 50 };\n\n/** Build a clean PaginationInput, dropping nullish cursor so the svc never sees `cursor: null`. */\nconst page = (p?: PaginationInput): PaginationInput => {\n const base = p ?? DEFAULT_PAGE;\n const result: PaginationInput = { limit: base.limit ?? DEFAULT_PAGE.limit };\n if (base.offset != null) result.offset = base.offset;\n if (base.cursor != null) result.cursor = base.cursor;\n return result;\n};\n\n// ============================================================================\n// Reusable gql field selections (codegen-free strictness)\n// ============================================================================\n\nconst AGENCY_FIELDS = `\n id workspaceId code contactEmail contactPhone description isActive jurisdiction\n name tags createdAt updatedAt\n`;\n\nconst SERVICE_FIELDS = `\n id workspaceId agencyId category currency eligibility feeAmount feeType formSchema\n name publishedAt requiredDocuments slaDays slug status summary tags createdAt updatedAt\n`;\n\nconst DOCUMENT_FIELDS = `\n id workspaceId applicationId name status requirement rejectionReason\n file { id } createdAt updatedAt\n`;\n\nconst CASE_NOTE_FIELDS = `\n id workspaceId applicationId authorId body type createdAt updatedAt\n`;\n\nconst PERMIT_FIELDS = `\n id workspaceId applicationId serviceId holderId title verificationCode status\n issuedAt expiresAt revokedAt revokeReason file { id } createdAt updatedAt\n`;\n\nconst PAYMENT_FIELDS = `\n id workspaceId applicationId payerId amount currency status receiptNumber\n providerRef lineItems paidAt refundedAt createdAt updatedAt\n`;\n\nconst APPLICATION_FIELDS = `\n id workspaceId reference serviceId citizenId assignedToId status priority dueDate\n submittedAt decidedAt decisionReason tags createdAt updatedAt\n`;\n\nconst GRIEVANCE_FIELDS = `\n id workspaceId title description category status priority location latitude longitude\n photoFileIds reporterId agencyId assignedToId resolution resolvedAt tags createdAt updatedAt\n`;\n\n// ============================================================================\n// Dashboard summary (authoritative, backend-computed counts)\n// ============================================================================\n\n/**\n * Reads `govDashboardSummary` — the svc-computed operations totals. These are\n * authoritative (full-corpus counts, not a capped client-side window), so the\n * dashboard tiles and status donut MUST source from here, never from a paged\n * list's `items.length`.\n */\nconst DASHBOARD_TREND_FIELDS = `current previous changePercent direction`;\n\nexport const useGovDashboardSummary = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: KEY.dashboard,\n queryFn: async () => {\n const result = await govQuery<{ govDashboardSummary: GovDashboardSummary }>(\n `query GovDashboardSummary {\n govDashboardSummary {\n applicationsTotal\n applicationsByStatus { status count }\n pendingPayments\n pendingPaymentsAmount\n openGrievances\n activePermits\n publishedServices\n activeAgencies\n applicationsTotalTrend { ${DASHBOARD_TREND_FIELDS} }\n pendingPaymentsTrend { ${DASHBOARD_TREND_FIELDS} }\n openGrievancesTrend { ${DASHBOARD_TREND_FIELDS} }\n activePermitsTrend { ${DASHBOARD_TREND_FIELDS} }\n publishedServicesTrend { ${DASHBOARD_TREND_FIELDS} }\n activeAgenciesTrend { ${DASHBOARD_TREND_FIELDS} }\n }\n }`,\n {},\n apiGatewayUrl\n );\n return result.govDashboardSummary;\n },\n });\n};\n\n/**\n * Reads `govApplicationSlaSummary` — the svc-computed, corpus-wide SLA\n * breakdown across every non-terminal application. Unlike a page-level SLA\n * strip, this is accurate regardless of which page of results is loaded.\n */\nexport const useGovApplicationSlaSummary = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: KEY.applicationSlaSummary,\n queryFn: async () => {\n const result = await govQuery<{ govApplicationSlaSummary: GovApplicationSlaSummary }>(\n `query GovApplicationSlaSummary {\n govApplicationSlaSummary { onTrack dueSoon overdue noDueDate }\n }`,\n {},\n apiGatewayUrl\n );\n return result.govApplicationSlaSummary;\n },\n });\n};\n\n/** Reads `govApplicationsByService` — corpus-wide application volume per service. */\nexport const useGovApplicationsByService = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: KEY.applicationsByService,\n queryFn: async () => {\n const result = await govQuery<{ govApplicationsByService: GovServiceApplicationCount[] }>(\n `query GovApplicationsByService {\n govApplicationsByService { serviceId serviceName count }\n }`,\n {},\n apiGatewayUrl\n );\n return result.govApplicationsByService;\n },\n });\n};\n\n/** Reads `govApplicationsByDesk` — corpus-wide application volume per assigned officer. */\nexport const useGovApplicationsByDesk = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: KEY.applicationsByDesk,\n queryFn: async () => {\n const result = await govQuery<{ govApplicationsByDesk: GovDeskApplicationCount[] }>(\n `query GovApplicationsByDesk {\n govApplicationsByDesk { assignedToId count }\n }`,\n {},\n apiGatewayUrl\n );\n return result.govApplicationsByDesk;\n },\n });\n};\n\n// ============================================================================\n// Agencies (server-side: paginated GovAgencyConnection; this hook flattens it\n// back to a plain array since every current consumer — AgenciesPage,\n// ServiceFormDialog, GrievancesPage — reads `data` as GovAgency[])\n// ============================================================================\n\nexport interface AgencyFilters {\n isActive?: boolean;\n pagination?: PaginationInput;\n}\n\nexport const useGovAgencies = (filters: AgencyFilters = {}) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: [...KEY.agencies, filters],\n queryFn: async () => {\n const result = await govQuery<{ govListAgencies: GovConnection<GovAgency> }>(\n `query GovListAgencies($isActive: Boolean, $pagination: PaginationInput) {\n govListAgencies(isActive: $isActive, pagination: $pagination) {\n items { ${AGENCY_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { isActive: filters.isActive, pagination: page(filters.pagination ?? { limit: 100 }) },\n apiGatewayUrl\n );\n return result.govListAgencies.items;\n },\n });\n};\n\nexport const useGovAgency = (id: string | undefined) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: KEY.agency(id ?? ''),\n enabled: Boolean(id),\n queryFn: async () => {\n const result = await govQuery<{ govAgency: GovAgency | null }>(\n `query GovAgency($id: ID!) {\n govAgency(id: $id) { ${AGENCY_FIELDS} services { ${SERVICE_FIELDS} } }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.govAgency;\n },\n });\n};\n\nexport const useGovCreateAgency = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: GovCreateAgencyInput) => {\n const result = await govQuery<{ govCreateAgency: GovAgency }>(\n `mutation GovCreateAgency($input: GovCreateAgencyInput!) {\n govCreateAgency(input: $input) { ${AGENCY_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.govCreateAgency;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.agencies }),\n });\n};\n\nexport const useGovUpdateAgency = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: { id: string; input: GovUpdateAgencyInput }) => {\n const result = await govQuery<{ govUpdateAgency: GovAgency }>(\n `mutation GovUpdateAgency($id: ID!, $input: GovUpdateAgencyInput!) {\n govUpdateAgency(id: $id, input: $input) { ${AGENCY_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govUpdateAgency;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.agencies });\n qc.invalidateQueries({ queryKey: KEY.agency(data.id) });\n },\n });\n};\n\nexport const useGovArchiveAgency = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (id: string) => {\n const result = await govQuery<{ govArchiveAgency: boolean }>(\n `mutation GovArchiveAgency($id: ID!) { govArchiveAgency(id: $id) }`,\n { id },\n apiGatewayUrl\n );\n return result.govArchiveAgency;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.agencies }),\n });\n};\n\n// ============================================================================\n// Services (connection)\n// ============================================================================\n\nexport interface ServiceFilters {\n agencyId?: string;\n category?: GovServiceCategory;\n status?: GovServiceStatus;\n pagination?: PaginationInput;\n}\n\nexport const useGovServices = (filters: ServiceFilters = {}) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: [...KEY.services, filters],\n queryFn: async () => {\n const result = await govQuery<{ govListServices: GovConnection<GovService> }>(\n `query GovListServices($agencyId: ID, $category: GovServiceCategory, $status: GovServiceStatus, $pagination: PaginationInput) {\n govListServices(agencyId: $agencyId, category: $category, status: $status, pagination: $pagination) {\n items { ${SERVICE_FIELDS} agency { id name } }\n pageInfo { cursor hasMore }\n }\n }`,\n {\n agencyId: filters.agencyId,\n category: filters.category,\n status: filters.status,\n pagination: page(filters.pagination),\n },\n apiGatewayUrl\n );\n return result.govListServices;\n },\n });\n};\n\nexport const useGovService = (id: string | undefined) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: KEY.service(id ?? ''),\n enabled: Boolean(id),\n queryFn: async () => {\n const result = await govQuery<{ govService: GovService | null }>(\n `query GovService($id: ID!) {\n govService(id: $id) { ${SERVICE_FIELDS} agency { ${AGENCY_FIELDS} } }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.govService;\n },\n });\n};\n\nexport const useGovCreateService = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: GovCreateServiceInput) => {\n const result = await govQuery<{ govCreateService: GovService }>(\n `mutation GovCreateService($input: GovCreateServiceInput!) {\n govCreateService(input: $input) { ${SERVICE_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.govCreateService;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.services }),\n });\n};\n\nexport const useGovUpdateService = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: { id: string; input: GovUpdateServiceInput }) => {\n const result = await govQuery<{ govUpdateService: GovService }>(\n `mutation GovUpdateService($id: ID!, $input: GovUpdateServiceInput!) {\n govUpdateService(id: $id, input: $input) { ${SERVICE_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govUpdateService;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.services });\n qc.invalidateQueries({ queryKey: KEY.service(data.id) });\n },\n });\n};\n\nexport const useGovTransitionService = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: { id: string; status: GovServiceStatus }) => {\n const result = await govQuery<{ govTransitionService: GovService }>(\n `mutation GovTransitionService($id: ID!, $status: GovServiceStatus!) {\n govTransitionService(id: $id, status: $status) { ${SERVICE_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govTransitionService;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.services });\n qc.invalidateQueries({ queryKey: KEY.service(data.id) });\n },\n });\n};\n\n// ============================================================================\n// Applications (connection)\n// ============================================================================\n\nexport interface ApplicationFilters {\n assignedToId?: string;\n citizenId?: string;\n serviceId?: string;\n status?: GovApplicationStatus;\n pagination?: PaginationInput;\n}\n\nexport const useGovApplications = (filters: ApplicationFilters = {}) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: [...KEY.applications, filters],\n queryFn: async () => {\n const result = await govQuery<{ govListApplications: GovConnection<GovApplication> }>(\n `query GovListApplications($assignedToId: ID, $citizenId: ID, $serviceId: ID, $status: GovApplicationStatus, $pagination: PaginationInput) {\n govListApplications(assignedToId: $assignedToId, citizenId: $citizenId, serviceId: $serviceId, status: $status, pagination: $pagination) {\n items { ${APPLICATION_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n {\n assignedToId: filters.assignedToId,\n citizenId: filters.citizenId,\n serviceId: filters.serviceId,\n status: filters.status,\n pagination: page(filters.pagination),\n },\n apiGatewayUrl\n );\n return result.govListApplications;\n },\n });\n};\n\nexport const useGovApplication = (id: string | undefined) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: KEY.application(id ?? ''),\n enabled: Boolean(id),\n queryFn: async () => {\n const result = await govQuery<{ govApplication: GovApplication | null }>(\n `query GovApplication($id: ID!) {\n govApplication(id: $id) {\n ${APPLICATION_FIELDS}\n formData\n documents { ${DOCUMENT_FIELDS} }\n notes { ${CASE_NOTE_FIELDS} }\n permits { ${PERMIT_FIELDS} }\n }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.govApplication;\n },\n });\n};\n\nexport const useGovCreateApplication = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: GovCreateApplicationInput) => {\n const result = await govQuery<{ govCreateApplication: GovApplication }>(\n `mutation GovCreateApplication($input: GovCreateApplicationInput!) {\n govCreateApplication(input: $input) { ${APPLICATION_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.govCreateApplication;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.applications }),\n });\n};\n\nexport const useGovUpdateApplication = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: { id: string; input: GovUpdateApplicationInput }) => {\n const result = await govQuery<{ govUpdateApplication: GovApplication }>(\n `mutation GovUpdateApplication($id: ID!, $input: GovUpdateApplicationInput!) {\n govUpdateApplication(id: $id, input: $input) { ${APPLICATION_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govUpdateApplication;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.applications });\n qc.invalidateQueries({ queryKey: KEY.application(data.id) });\n },\n });\n};\n\nexport const useGovSubmitApplication = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (id: string) => {\n const result = await govQuery<{ govSubmitApplication: GovApplication }>(\n `mutation GovSubmitApplication($id: ID!) {\n govSubmitApplication(id: $id) { ${APPLICATION_FIELDS} }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.govSubmitApplication;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.applications });\n qc.invalidateQueries({ queryKey: KEY.application(data.id) });\n },\n });\n};\n\nexport const useGovTransitionApplication = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: {\n id: string;\n status: GovApplicationStatus;\n reason?: string | null;\n }) => {\n const result = await govQuery<{ govTransitionApplication: GovApplication }>(\n `mutation GovTransitionApplication($id: ID!, $status: GovApplicationStatus!, $reason: String) {\n govTransitionApplication(id: $id, status: $status, reason: $reason) { ${APPLICATION_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govTransitionApplication;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.applications });\n qc.invalidateQueries({ queryKey: KEY.application(data.id) });\n },\n });\n};\n\n// ============================================================================\n// Documents (attached to an application)\n// ============================================================================\n\nexport const useGovAddDocument = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: GovAddDocumentInput) => {\n const result = await govQuery<{ govAddDocument: GovDocument }>(\n `mutation GovAddDocument($input: GovAddDocumentInput!) {\n govAddDocument(input: $input) { ${DOCUMENT_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.govAddDocument;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.application(data.applicationId) });\n qc.invalidateQueries({ queryKey: KEY.applications });\n },\n });\n};\n\nexport const useGovReviewDocument = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: {\n id: string;\n status: GovDocumentStatus;\n rejectionReason?: string | null;\n applicationId?: string;\n }) => {\n const result = await govQuery<{ govReviewDocument: GovDocument }>(\n `mutation GovReviewDocument($id: ID!, $status: GovDocumentStatus!, $rejectionReason: String) {\n govReviewDocument(id: $id, status: $status, rejectionReason: $rejectionReason) { ${DOCUMENT_FIELDS} }\n }`,\n { id: vars.id, status: vars.status, rejectionReason: vars.rejectionReason },\n apiGatewayUrl\n );\n return result.govReviewDocument;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.application(data.applicationId) });\n },\n });\n};\n\n// ============================================================================\n// Case notes (domain-owned casework timeline)\n// ============================================================================\n\nexport const useGovAddCaseNote = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: GovAddCaseNoteInput) => {\n const result = await govQuery<{ govAddCaseNote: GovCaseNote }>(\n `mutation GovAddCaseNote($input: GovAddCaseNoteInput!) {\n govAddCaseNote(input: $input) { ${CASE_NOTE_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.govAddCaseNote;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.application(data.applicationId) });\n },\n });\n};\n\n// ============================================================================\n// Payments (connection)\n// ============================================================================\n\nexport interface PaymentFilters {\n applicationId?: string;\n payerId?: string;\n status?: GovPaymentStatus;\n pagination?: PaginationInput;\n}\n\nexport const useGovPayments = (filters: PaymentFilters = {}) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: [...KEY.payments, filters],\n queryFn: async () => {\n const result = await govQuery<{ govListPayments: GovConnection<GovPayment> }>(\n `query GovListPayments($applicationId: ID, $payerId: ID, $status: GovPaymentStatus, $pagination: PaginationInput) {\n govListPayments(applicationId: $applicationId, payerId: $payerId, status: $status, pagination: $pagination) {\n items { ${PAYMENT_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n {\n applicationId: filters.applicationId,\n payerId: filters.payerId,\n status: filters.status,\n pagination: page(filters.pagination),\n },\n apiGatewayUrl\n );\n return result.govListPayments;\n },\n });\n};\n\nexport const useGovCreatePayment = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: GovCreatePaymentInput) => {\n const result = await govQuery<{ govCreatePayment: GovPayment }>(\n `mutation GovCreatePayment($input: GovCreatePaymentInput!) {\n govCreatePayment(input: $input) { ${PAYMENT_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.govCreatePayment;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.payments });\n if (data.applicationId)\n qc.invalidateQueries({ queryKey: KEY.application(data.applicationId) });\n },\n });\n};\n\nexport const useGovMarkPaymentPaid = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: { id: string; providerRef?: string | null }) => {\n const result = await govQuery<{ govMarkPaymentPaid: GovPayment }>(\n `mutation GovMarkPaymentPaid($id: ID!, $providerRef: String) {\n govMarkPaymentPaid(id: $id, providerRef: $providerRef) { ${PAYMENT_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govMarkPaymentPaid;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.payments }),\n });\n};\n\nexport const useGovRefundPayment = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (id: string) => {\n const result = await govQuery<{ govRefundPayment: GovPayment }>(\n `mutation GovRefundPayment($id: ID!) {\n govRefundPayment(id: $id) { ${PAYMENT_FIELDS} }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.govRefundPayment;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.payments }),\n });\n};\n\n// ============================================================================\n// Permits (list = ARRAY, no pagination) + public verification\n// ============================================================================\n\nexport interface PermitFilters {\n holderId?: string;\n serviceId?: string;\n status?: GovPermitStatus;\n pagination?: PaginationInput;\n}\n\n/**\n * `govListPermits` returns a paginated `GovPermitConnection`, flattened to a\n * plain array here since PermitsPage reads `data` as GovPermit[] and infers\n * `hasMore` itself from a full-length page. Callers page with `{ limit, offset }`.\n */\nexport const useGovPermits = (filters: PermitFilters = {}) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: [...KEY.permits, filters],\n queryFn: async () => {\n const result = await govQuery<{ govListPermits: GovConnection<GovPermit> }>(\n `query GovListPermits($holderId: ID, $serviceId: ID, $status: GovPermitStatus, $pagination: PaginationInput) {\n govListPermits(holderId: $holderId, serviceId: $serviceId, status: $status, pagination: $pagination) {\n items { ${PERMIT_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n {\n holderId: filters.holderId,\n serviceId: filters.serviceId,\n status: filters.status,\n pagination: page(filters.pagination),\n },\n apiGatewayUrl\n );\n return result.govListPermits.items;\n },\n });\n};\n\nexport const useGovIssuePermit = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: GovIssuePermitInput) => {\n const result = await govQuery<{ govIssuePermit: GovPermit }>(\n `mutation GovIssuePermit($input: GovIssuePermitInput!) {\n govIssuePermit(input: $input) { ${PERMIT_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.govIssuePermit;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.permits });\n if (data.applicationId)\n qc.invalidateQueries({ queryKey: KEY.application(data.applicationId) });\n },\n });\n};\n\nexport const useGovRevokePermit = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: { id: string; reason?: string | null }) => {\n const result = await govQuery<{ govRevokePermit: GovPermit }>(\n `mutation GovRevokePermit($id: ID!, $reason: String) {\n govRevokePermit(id: $id, reason: $reason) { ${PERMIT_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govRevokePermit;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.permits }),\n });\n};\n\n/**\n * Render the permit as a downloadable/printable PDF (BOFF-4060). A mutation\n * (not a query) even though the backend field is a GraphQL Query: it's a\n * client-triggered, non-cached action fired from a \"Download\" / \"Print\"\n * button, exactly like the `getBlob` thunk in the platform's Save-to-Files\n * pattern — the bytes are only assembled when the officer actually clicks.\n */\nexport const useGovPermitPdf = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useMutation({\n mutationFn: async (id: string) => {\n const result = await govQuery<{\n govPermitPdf: { pdfBase64: string; filename: string; generatedAt: string };\n }>(\n `query GovPermitPdf($id: ID!) {\n govPermitPdf(id: $id) { pdfBase64 filename generatedAt }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.govPermitPdf;\n },\n });\n};\n\n/**\n * Persist a `wspace-files-svc` File reference onto an issued permit once the\n * client has saved the rendered PDF via the platform's Save-to-Files flow.\n */\nexport const useGovAttachPermitFile = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: { id: string; fileId: string }) => {\n const result = await govQuery<{ govAttachPermitFile: GovPermit }>(\n `mutation GovAttachPermitFile($id: ID!, $fileId: ID!) {\n govAttachPermitFile(id: $id, fileId: $fileId) { ${PERMIT_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govAttachPermitFile;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.permits }),\n });\n};\n\n/**\n * Public permit verification by printed code. `govVerifyPermit` is a PUBLIC field\n * (no auth), but we keep the workspace-token transport for a consistent gateway\n * path. `enabled` is false until a code is supplied so the query is manual.\n */\nexport const useGovVerifyPermit = (verificationCode: string | undefined) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: ['govcitizenhub', 'verify-permit', verificationCode ?? ''],\n enabled: Boolean(verificationCode),\n retry: false,\n queryFn: async () => {\n const result = await govQuery<{ govVerifyPermit: GovPermit | null }>(\n `query GovVerifyPermit($verificationCode: String!) {\n govVerifyPermit(verificationCode: $verificationCode) { ${PERMIT_FIELDS} }\n }`,\n { verificationCode },\n apiGatewayUrl\n );\n return result.govVerifyPermit;\n },\n });\n};\n\n// ============================================================================\n// Grievances (connection)\n// ============================================================================\n\nexport interface GrievanceFilters {\n agencyId?: string;\n reporterId?: string;\n status?: GovGrievanceStatus;\n pagination?: PaginationInput;\n}\n\nexport const useGovGrievances = (filters: GrievanceFilters = {}) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: [...KEY.grievances, filters],\n queryFn: async () => {\n const result = await govQuery<{ govListGrievances: GovConnection<GovGrievance> }>(\n `query GovListGrievances($agencyId: ID, $reporterId: ID, $status: GovGrievanceStatus, $pagination: PaginationInput) {\n govListGrievances(agencyId: $agencyId, reporterId: $reporterId, status: $status, pagination: $pagination) {\n items { ${GRIEVANCE_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n {\n agencyId: filters.agencyId,\n reporterId: filters.reporterId,\n status: filters.status,\n pagination: page(filters.pagination),\n },\n apiGatewayUrl\n );\n return result.govListGrievances;\n },\n });\n};\n\nexport const useGovGrievance = (id: string | undefined) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: KEY.grievance(id ?? ''),\n enabled: Boolean(id),\n queryFn: async () => {\n const result = await govQuery<{ govGrievance: GovGrievance | null }>(\n `query GovGrievance($id: ID!) {\n govGrievance(id: $id) { ${GRIEVANCE_FIELDS} }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.govGrievance;\n },\n });\n};\n\nexport const useGovReportGrievance = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: GovReportGrievanceInput) => {\n const result = await govQuery<{ govReportGrievance: GovGrievance }>(\n `mutation GovReportGrievance($input: GovReportGrievanceInput!) {\n govReportGrievance(input: $input) { ${GRIEVANCE_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.govReportGrievance;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.grievances }),\n });\n};\n\nexport const useGovUpdateGrievance = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: { id: string; input: GovUpdateGrievanceInput }) => {\n const result = await govQuery<{ govUpdateGrievance: GovGrievance }>(\n `mutation GovUpdateGrievance($id: ID!, $input: GovUpdateGrievanceInput!) {\n govUpdateGrievance(id: $id, input: $input) { ${GRIEVANCE_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govUpdateGrievance;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.grievances });\n qc.invalidateQueries({ queryKey: KEY.grievance(data.id) });\n },\n });\n};\n\nexport const useGovTransitionGrievance = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: {\n id: string;\n status: GovGrievanceStatus;\n resolution?: string | null;\n }) => {\n const result = await govQuery<{ govTransitionGrievance: GovGrievance }>(\n `mutation GovTransitionGrievance($id: ID!, $status: GovGrievanceStatus!, $resolution: String) {\n govTransitionGrievance(id: $id, status: $status, resolution: $resolution) { ${GRIEVANCE_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govTransitionGrievance;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.grievances });\n qc.invalidateQueries({ queryKey: KEY.grievance(data.id) });\n },\n });\n};\n"],"mappings":";;;;;;AA6DA,IAAM,KAAc,MAA2B,iBAAiB,KAAK,CAAK,GAEpE,IAAW,OACf,GACA,GACA,MACmB;CAKnB,IAAM,IAAW,EAAW,CAAK;CACjC,AAAI,KAAU,EAA0B;CAExC,IAAM,IAAW,MAAM,EAAoB;EACzC,SAAS;EACT;EACA;EACA;EACA,gBAAgB;CAClB,CAAC;CAED,AAAI,KAAU,EAA0B;CAOxC,IAAM,IAAO,EAAS;CAItB,IAAI,EAFF,KAAQ,QAAQ,OAAO,OAAO,CAAI,EAAE,MAAM,MAAU,KAAU,IAA2B,IAGzF,MAAU,MAAM,EAAS,SAAS,IAAI,WAAW,uCAAuC;CAM1F,OAJI,EAAS,QAAQ,UAEnB,QAAQ,KAAK,0DAA0D,EAAS,MAAM,GAEjF,EAAS;AAClB,GAGM,IAAM;CACV,WAAW,CAAC,iBAAiB,mBAAmB;CAChD,uBAAuB,CAAC,iBAAiB,yBAAyB;CAClE,uBAAuB,CAAC,iBAAiB,yBAAyB;CAClE,oBAAoB,CAAC,iBAAiB,sBAAsB;CAC5D,UAAU,CAAC,iBAAiB,UAAU;CACtC,SAAS,MAAe;EAAC;EAAiB;EAAU;CAAE;CACtD,UAAU,CAAC,iBAAiB,UAAU;CACtC,UAAU,MAAe;EAAC;EAAiB;EAAW;CAAE;CACxD,cAAc,CAAC,iBAAiB,cAAc;CAC9C,cAAc,MAAe;EAAC;EAAiB;EAAe;CAAE;CAChE,UAAU,CAAC,iBAAiB,UAAU;CACtC,UAAU,M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C,IAAM,EAAE,qBAAkB,EAAiB,GACrC,IAAK,EAAe;CAC1B,OAAO,EAAY;EACjB,YAAY,OAAO,OAQV,MAPc,EACnB;gDACwC,EAAiB;YAEzD,EAAE,SAAM,GACR,CACF,GACc;EAEhB,iBAAiB,EAAG,kBAAkB,EAAE,UAAU,EAAI,WAAW,CAAC;CACpE,CAAC;AACH,GAEa,WAA8B;CACzC,IAAM,EAAE,qBAAkB,EAAiB,GACrC,IAAK,EAAe;CAC1B,OAAO,EAAY;EACjB,YAAY,OAAO,OAQV,MAPc,EACnB;yDACiD,EAAiB;YAElE,GACA,CACF,GACc;EAEhB,YAAY,MAAS;GAEnB,AADA,EAAG,kBAAkB,EAAE,UAAU,EAAI,WAAW,CAAC,GACjD,EAAG,kBAAkB,EAAE,UAAU,EAAI,UAAU,EAAK,EAAE,EAAE,CAAC;EAC3D;CACF,CAAC;AACH,GAEa,WAAkC;CAC7C,IAAM,EAAE,qBAAkB,EAAiB,GACrC,IAAK,EAAe;CAC1B,OAAO,EAAY;EACjB,YAAY,OAAO,OAYV,MAPc,EACnB;wFACgF,EAAiB;YAEjG,GACA,CACF,GACc;EAEhB,YAAY,MAAS;GAEnB,AADA,EAAG,kBAAkB,EAAE,UAAU,EAAI,WAAW,CAAC,GACjD,EAAG,kBAAkB,EAAE,UAAU,EAAI,UAAU,EAAK,EAAE,EAAE,CAAC;EAC3D;CACF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"useGovApi.js","names":[],"sources":["../../../src/govcitizenhub/hooks/useGovApi.ts"],"sourcesContent":["/**\n * GovCitizenHub API hooks\n * @module govcitizenhub/hooks\n *\n * React-Query hooks wired DIRECTLY to the real `wspace-govcitizenhub-svc`\n * federated GraphQL contract (the `gov*` operations). Every query/mutation below\n * uses an inline gql string whose fields match the svc `.hive-schema.graphql`\n * exactly. No mock data.\n *\n * Transport: `graphqlFetch({ gateway: 'workspace', workspaceToken: true })` — the\n * host shell supplies the gateway base URL + a workspace-scoped token.\n *\n * IMPORTANT: `User`/`File` are id-only federation stubs in this subgraph. We\n * never select `citizen { firstName }` or `file { url }`.\n */\n\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\n\nimport { useGovCitizenHub } from '../context';\nimport { clearGraphqlResponseCache } from '../lib/graphql-cache';\nimport type {\n GovConnection,\n GovAgency,\n GovService,\n GovServiceCategory,\n GovServiceStatus,\n GovApplication,\n GovApplicationStatus,\n GovDocument,\n GovDocumentStatus,\n GovCaseNote,\n GovPermit,\n GovPermitStatus,\n GovPayment,\n GovPaymentStatus,\n GovGrievance,\n GovGrievanceStatus,\n GovCreateAgencyInput,\n GovUpdateAgencyInput,\n GovCreateServiceInput,\n GovUpdateServiceInput,\n GovCreateApplicationInput,\n GovUpdateApplicationInput,\n GovAddDocumentInput,\n GovAddCaseNoteInput,\n GovCreatePaymentInput,\n GovIssuePermitInput,\n GovReportGrievanceInput,\n GovUpdateGrievanceInput,\n GovDashboardSummary,\n GovApplicationSlaSummary,\n GovServiceApplicationCount,\n GovDeskApplicationCount,\n PaginationInput,\n} from '../types';\n\n// ============================================================================\n// Transport\n// ============================================================================\n\nconst isMutation = (query: string): boolean => /^\\s*mutation\\b/.test(query);\n\nexport const govQuery = async <TData>(\n query: string,\n variables: Record<string, unknown>,\n baseUrl?: string\n): Promise<TData> => {\n // A mutation must never be served from — or coalesced onto — the read cache,\n // and the resolved read cache must be dropped once it commits so the\n // React-Query refetch that follows sees the new state, not a stale (≤15s)\n // pre-write response. Clear before AND after the write.\n const mutating = isMutation(query);\n if (mutating) clearGraphqlResponseCache();\n\n const response = await graphqlFetch<TData>({\n gateway: 'workspace',\n baseUrl,\n query,\n variables,\n workspaceToken: true,\n });\n\n if (mutating) clearGraphqlResponseCache();\n\n // GraphQL partial success: the gateway can attach a non-fatal top-level error\n // (e.g. a be-sdk activity/usage tracking side-effect) alongside a fully-resolved\n // payload. Only treat the request as failed when it produced NO usable data —\n // otherwise the operation genuinely succeeded and surfacing the background error\n // as a destructive toast would mislead the user.\n const data = response.data as Record<string, unknown> | null | undefined;\n const hasUsableData =\n data != null && Object.values(data).some((value) => value !== null && value !== undefined);\n\n if (!hasUsableData) {\n throw new Error(response.errors?.[0]?.message ?? 'GraphQL response did not include data');\n }\n if (response.errors?.length) {\n // Non-fatal: keep the data, but leave a breadcrumb for diagnostics.\n console.warn('[govcitizenhub] GraphQL partial error (data returned):', response.errors);\n }\n return response.data as TData;\n};\n\n// React-Query key roots (one namespace per domain entity).\nconst KEY = {\n dashboard: ['govcitizenhub', 'dashboard-summary'] as const,\n applicationSlaSummary: ['govcitizenhub', 'application-sla-summary'] as const,\n applicationsByService: ['govcitizenhub', 'applications-by-service'] as const,\n applicationsByDesk: ['govcitizenhub', 'applications-by-desk'] as const,\n agencies: ['govcitizenhub', 'agencies'] as const,\n agency: (id: string) => ['govcitizenhub', 'agency', id] as const,\n services: ['govcitizenhub', 'services'] as const,\n service: (id: string) => ['govcitizenhub', 'service', id] as const,\n applications: ['govcitizenhub', 'applications'] as const,\n application: (id: string) => ['govcitizenhub', 'application', id] as const,\n payments: ['govcitizenhub', 'payments'] as const,\n payment: (id: string) => ['govcitizenhub', 'payment', id] as const,\n permits: ['govcitizenhub', 'permits'] as const,\n grievances: ['govcitizenhub', 'grievances'] as const,\n grievance: (id: string) => ['govcitizenhub', 'grievance', id] as const,\n};\n\nconst DEFAULT_PAGE: PaginationInput = { limit: 50 };\n\n/** Build a clean PaginationInput, dropping nullish cursor so the svc never sees `cursor: null`. */\nexport const page = (p?: PaginationInput): PaginationInput => {\n const base = p ?? DEFAULT_PAGE;\n const result: PaginationInput = { limit: base.limit ?? DEFAULT_PAGE.limit };\n if (base.offset != null) result.offset = base.offset;\n if (base.cursor != null) result.cursor = base.cursor;\n return result;\n};\n\n// ============================================================================\n// Reusable gql field selections (codegen-free strictness)\n// ============================================================================\n\nconst AGENCY_FIELDS = `\n id workspaceId code contactEmail contactPhone description isActive jurisdiction\n name tags createdAt updatedAt\n`;\n\nconst SERVICE_FIELDS = `\n id workspaceId agencyId category currency eligibility feeAmount feeType formSchema\n name publishedAt requiredDocuments slaDays slug status summary tags createdAt updatedAt\n`;\n\nconst DOCUMENT_FIELDS = `\n id workspaceId applicationId name status requirement rejectionReason\n file { id } createdAt updatedAt\n`;\n\nconst CASE_NOTE_FIELDS = `\n id workspaceId applicationId authorId body type createdAt updatedAt\n`;\n\nconst PERMIT_FIELDS = `\n id workspaceId applicationId serviceId holderId title verificationCode status\n issuedAt expiresAt revokedAt revokeReason file { id } createdAt updatedAt\n`;\n\nconst PAYMENT_FIELDS = `\n id workspaceId applicationId payerId amount currency status receiptNumber\n providerRef lineItems paidAt refundedAt createdAt updatedAt\n`;\n\nconst APPLICATION_FIELDS = `\n id workspaceId reference serviceId citizenId assignedToId status priority dueDate\n submittedAt decidedAt decisionReason tags createdAt updatedAt\n`;\n\nconst GRIEVANCE_FIELDS = `\n id workspaceId title description category status priority location latitude longitude\n photoFileIds reporterId agencyId assignedToId resolution resolvedAt tags createdAt updatedAt\n`;\n\n// ============================================================================\n// Dashboard summary (authoritative, backend-computed counts)\n// ============================================================================\n\n/**\n * Reads `govDashboardSummary` — the svc-computed operations totals. These are\n * authoritative (full-corpus counts, not a capped client-side window), so the\n * dashboard tiles and status donut MUST source from here, never from a paged\n * list's `items.length`.\n */\nconst DASHBOARD_TREND_FIELDS = `current previous changePercent direction`;\n\nexport const useGovDashboardSummary = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: KEY.dashboard,\n queryFn: async () => {\n const result = await govQuery<{ govDashboardSummary: GovDashboardSummary }>(\n `query GovDashboardSummary {\n govDashboardSummary {\n applicationsTotal\n applicationsByStatus { status count }\n pendingPayments\n pendingPaymentsAmount\n openGrievances\n activePermits\n publishedServices\n activeAgencies\n applicationsTotalTrend { ${DASHBOARD_TREND_FIELDS} }\n pendingPaymentsTrend { ${DASHBOARD_TREND_FIELDS} }\n openGrievancesTrend { ${DASHBOARD_TREND_FIELDS} }\n activePermitsTrend { ${DASHBOARD_TREND_FIELDS} }\n publishedServicesTrend { ${DASHBOARD_TREND_FIELDS} }\n activeAgenciesTrend { ${DASHBOARD_TREND_FIELDS} }\n }\n }`,\n {},\n apiGatewayUrl\n );\n return result.govDashboardSummary;\n },\n });\n};\n\n/**\n * Reads `govApplicationSlaSummary` — the svc-computed, corpus-wide SLA\n * breakdown across every non-terminal application. Unlike a page-level SLA\n * strip, this is accurate regardless of which page of results is loaded.\n */\nexport const useGovApplicationSlaSummary = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: KEY.applicationSlaSummary,\n queryFn: async () => {\n const result = await govQuery<{ govApplicationSlaSummary: GovApplicationSlaSummary }>(\n `query GovApplicationSlaSummary {\n govApplicationSlaSummary { onTrack dueSoon overdue noDueDate }\n }`,\n {},\n apiGatewayUrl\n );\n return result.govApplicationSlaSummary;\n },\n });\n};\n\n/** Reads `govApplicationsByService` — corpus-wide application volume per service. */\nexport const useGovApplicationsByService = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: KEY.applicationsByService,\n queryFn: async () => {\n const result = await govQuery<{ govApplicationsByService: GovServiceApplicationCount[] }>(\n `query GovApplicationsByService {\n govApplicationsByService { serviceId serviceName count }\n }`,\n {},\n apiGatewayUrl\n );\n return result.govApplicationsByService;\n },\n });\n};\n\n/** Reads `govApplicationsByDesk` — corpus-wide application volume per assigned officer. */\nexport const useGovApplicationsByDesk = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: KEY.applicationsByDesk,\n queryFn: async () => {\n const result = await govQuery<{ govApplicationsByDesk: GovDeskApplicationCount[] }>(\n `query GovApplicationsByDesk {\n govApplicationsByDesk { assignedToId count }\n }`,\n {},\n apiGatewayUrl\n );\n return result.govApplicationsByDesk;\n },\n });\n};\n\n// ============================================================================\n// Agencies (server-side: paginated GovAgencyConnection; this hook flattens it\n// back to a plain array since every current consumer — AgenciesPage,\n// ServiceFormDialog, GrievancesPage — reads `data` as GovAgency[])\n// ============================================================================\n\nexport interface AgencyFilters {\n isActive?: boolean;\n pagination?: PaginationInput;\n}\n\nexport const useGovAgencies = (filters: AgencyFilters = {}) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: [...KEY.agencies, filters],\n queryFn: async () => {\n const result = await govQuery<{ govListAgencies: GovConnection<GovAgency> }>(\n `query GovListAgencies($isActive: Boolean, $pagination: PaginationInput) {\n govListAgencies(isActive: $isActive, pagination: $pagination) {\n items { ${AGENCY_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n { isActive: filters.isActive, pagination: page(filters.pagination ?? { limit: 100 }) },\n apiGatewayUrl\n );\n return result.govListAgencies.items;\n },\n });\n};\n\nexport const useGovAgency = (id: string | undefined) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: KEY.agency(id ?? ''),\n enabled: Boolean(id),\n queryFn: async () => {\n const result = await govQuery<{ govAgency: GovAgency | null }>(\n `query GovAgency($id: ID!) {\n govAgency(id: $id) { ${AGENCY_FIELDS} services { ${SERVICE_FIELDS} } }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.govAgency;\n },\n });\n};\n\nexport const useGovCreateAgency = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: GovCreateAgencyInput) => {\n const result = await govQuery<{ govCreateAgency: GovAgency }>(\n `mutation GovCreateAgency($input: GovCreateAgencyInput!) {\n govCreateAgency(input: $input) { ${AGENCY_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.govCreateAgency;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.agencies }),\n });\n};\n\nexport const useGovUpdateAgency = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: { id: string; input: GovUpdateAgencyInput }) => {\n const result = await govQuery<{ govUpdateAgency: GovAgency }>(\n `mutation GovUpdateAgency($id: ID!, $input: GovUpdateAgencyInput!) {\n govUpdateAgency(id: $id, input: $input) { ${AGENCY_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govUpdateAgency;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.agencies });\n qc.invalidateQueries({ queryKey: KEY.agency(data.id) });\n },\n });\n};\n\nexport const useGovArchiveAgency = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (id: string) => {\n const result = await govQuery<{ govArchiveAgency: boolean }>(\n `mutation GovArchiveAgency($id: ID!) { govArchiveAgency(id: $id) }`,\n { id },\n apiGatewayUrl\n );\n return result.govArchiveAgency;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.agencies }),\n });\n};\n\n// ============================================================================\n// Services (connection)\n// ============================================================================\n\nexport interface ServiceFilters {\n agencyId?: string;\n category?: GovServiceCategory;\n status?: GovServiceStatus;\n pagination?: PaginationInput;\n}\n\nexport const useGovServices = (filters: ServiceFilters = {}) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: [...KEY.services, filters],\n queryFn: async () => {\n const result = await govQuery<{ govListServices: GovConnection<GovService> }>(\n `query GovListServices($agencyId: ID, $category: GovServiceCategory, $status: GovServiceStatus, $pagination: PaginationInput) {\n govListServices(agencyId: $agencyId, category: $category, status: $status, pagination: $pagination) {\n items { ${SERVICE_FIELDS} agency { id name } }\n pageInfo { cursor hasMore }\n }\n }`,\n {\n agencyId: filters.agencyId,\n category: filters.category,\n status: filters.status,\n pagination: page(filters.pagination),\n },\n apiGatewayUrl\n );\n return result.govListServices;\n },\n });\n};\n\nexport const useGovService = (id: string | undefined) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: KEY.service(id ?? ''),\n enabled: Boolean(id),\n queryFn: async () => {\n const result = await govQuery<{ govService: GovService | null }>(\n `query GovService($id: ID!) {\n govService(id: $id) { ${SERVICE_FIELDS} agency { ${AGENCY_FIELDS} } }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.govService;\n },\n });\n};\n\nexport const useGovCreateService = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: GovCreateServiceInput) => {\n const result = await govQuery<{ govCreateService: GovService }>(\n `mutation GovCreateService($input: GovCreateServiceInput!) {\n govCreateService(input: $input) { ${SERVICE_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.govCreateService;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.services }),\n });\n};\n\nexport const useGovUpdateService = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: { id: string; input: GovUpdateServiceInput }) => {\n const result = await govQuery<{ govUpdateService: GovService }>(\n `mutation GovUpdateService($id: ID!, $input: GovUpdateServiceInput!) {\n govUpdateService(id: $id, input: $input) { ${SERVICE_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govUpdateService;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.services });\n qc.invalidateQueries({ queryKey: KEY.service(data.id) });\n },\n });\n};\n\nexport const useGovTransitionService = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: { id: string; status: GovServiceStatus }) => {\n const result = await govQuery<{ govTransitionService: GovService }>(\n `mutation GovTransitionService($id: ID!, $status: GovServiceStatus!) {\n govTransitionService(id: $id, status: $status) { ${SERVICE_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govTransitionService;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.services });\n qc.invalidateQueries({ queryKey: KEY.service(data.id) });\n },\n });\n};\n\n// ============================================================================\n// Applications (connection)\n// ============================================================================\n\nexport interface ApplicationFilters {\n assignedToId?: string;\n citizenId?: string;\n serviceId?: string;\n status?: GovApplicationStatus;\n pagination?: PaginationInput;\n}\n\nexport const useGovApplications = (filters: ApplicationFilters = {}) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: [...KEY.applications, filters],\n queryFn: async () => {\n const result = await govQuery<{ govListApplications: GovConnection<GovApplication> }>(\n `query GovListApplications($assignedToId: ID, $citizenId: ID, $serviceId: ID, $status: GovApplicationStatus, $pagination: PaginationInput) {\n govListApplications(assignedToId: $assignedToId, citizenId: $citizenId, serviceId: $serviceId, status: $status, pagination: $pagination) {\n items { ${APPLICATION_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n {\n assignedToId: filters.assignedToId,\n citizenId: filters.citizenId,\n serviceId: filters.serviceId,\n status: filters.status,\n pagination: page(filters.pagination),\n },\n apiGatewayUrl\n );\n return result.govListApplications;\n },\n });\n};\n\nexport const useGovApplication = (id: string | undefined) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: KEY.application(id ?? ''),\n enabled: Boolean(id),\n queryFn: async () => {\n const result = await govQuery<{ govApplication: GovApplication | null }>(\n `query GovApplication($id: ID!) {\n govApplication(id: $id) {\n ${APPLICATION_FIELDS}\n formData\n documents { ${DOCUMENT_FIELDS} }\n notes { ${CASE_NOTE_FIELDS} }\n permits { ${PERMIT_FIELDS} }\n }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.govApplication;\n },\n });\n};\n\nexport const useGovCreateApplication = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: GovCreateApplicationInput) => {\n const result = await govQuery<{ govCreateApplication: GovApplication }>(\n `mutation GovCreateApplication($input: GovCreateApplicationInput!) {\n govCreateApplication(input: $input) { ${APPLICATION_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.govCreateApplication;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.applications }),\n });\n};\n\nexport const useGovUpdateApplication = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: { id: string; input: GovUpdateApplicationInput }) => {\n const result = await govQuery<{ govUpdateApplication: GovApplication }>(\n `mutation GovUpdateApplication($id: ID!, $input: GovUpdateApplicationInput!) {\n govUpdateApplication(id: $id, input: $input) { ${APPLICATION_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govUpdateApplication;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.applications });\n qc.invalidateQueries({ queryKey: KEY.application(data.id) });\n },\n });\n};\n\nexport const useGovSubmitApplication = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (id: string) => {\n const result = await govQuery<{ govSubmitApplication: GovApplication }>(\n `mutation GovSubmitApplication($id: ID!) {\n govSubmitApplication(id: $id) { ${APPLICATION_FIELDS} }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.govSubmitApplication;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.applications });\n qc.invalidateQueries({ queryKey: KEY.application(data.id) });\n },\n });\n};\n\nexport const useGovTransitionApplication = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: {\n id: string;\n status: GovApplicationStatus;\n reason?: string | null;\n }) => {\n const result = await govQuery<{ govTransitionApplication: GovApplication }>(\n `mutation GovTransitionApplication($id: ID!, $status: GovApplicationStatus!, $reason: String) {\n govTransitionApplication(id: $id, status: $status, reason: $reason) { ${APPLICATION_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govTransitionApplication;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.applications });\n qc.invalidateQueries({ queryKey: KEY.application(data.id) });\n },\n });\n};\n\n// ============================================================================\n// Documents (attached to an application)\n// ============================================================================\n\nexport const useGovAddDocument = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: GovAddDocumentInput) => {\n const result = await govQuery<{ govAddDocument: GovDocument }>(\n `mutation GovAddDocument($input: GovAddDocumentInput!) {\n govAddDocument(input: $input) { ${DOCUMENT_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.govAddDocument;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.application(data.applicationId) });\n qc.invalidateQueries({ queryKey: KEY.applications });\n },\n });\n};\n\nexport const useGovReviewDocument = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: {\n id: string;\n status: GovDocumentStatus;\n rejectionReason?: string | null;\n applicationId?: string;\n }) => {\n const result = await govQuery<{ govReviewDocument: GovDocument }>(\n `mutation GovReviewDocument($id: ID!, $status: GovDocumentStatus!, $rejectionReason: String) {\n govReviewDocument(id: $id, status: $status, rejectionReason: $rejectionReason) { ${DOCUMENT_FIELDS} }\n }`,\n { id: vars.id, status: vars.status, rejectionReason: vars.rejectionReason },\n apiGatewayUrl\n );\n return result.govReviewDocument;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.application(data.applicationId) });\n },\n });\n};\n\n// ============================================================================\n// Case notes (domain-owned casework timeline)\n// ============================================================================\n\nexport const useGovAddCaseNote = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: GovAddCaseNoteInput) => {\n const result = await govQuery<{ govAddCaseNote: GovCaseNote }>(\n `mutation GovAddCaseNote($input: GovAddCaseNoteInput!) {\n govAddCaseNote(input: $input) { ${CASE_NOTE_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.govAddCaseNote;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.application(data.applicationId) });\n },\n });\n};\n\n// ============================================================================\n// Payments (connection)\n// ============================================================================\n\nexport interface PaymentFilters {\n applicationId?: string;\n payerId?: string;\n status?: GovPaymentStatus;\n pagination?: PaginationInput;\n}\n\nexport const useGovPayments = (filters: PaymentFilters = {}) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: [...KEY.payments, filters],\n queryFn: async () => {\n const result = await govQuery<{ govListPayments: GovConnection<GovPayment> }>(\n `query GovListPayments($applicationId: ID, $payerId: ID, $status: GovPaymentStatus, $pagination: PaginationInput) {\n govListPayments(applicationId: $applicationId, payerId: $payerId, status: $status, pagination: $pagination) {\n items { ${PAYMENT_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n {\n applicationId: filters.applicationId,\n payerId: filters.payerId,\n status: filters.status,\n pagination: page(filters.pagination),\n },\n apiGatewayUrl\n );\n return result.govListPayments;\n },\n });\n};\n\nexport const useGovCreatePayment = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: GovCreatePaymentInput) => {\n const result = await govQuery<{ govCreatePayment: GovPayment }>(\n `mutation GovCreatePayment($input: GovCreatePaymentInput!) {\n govCreatePayment(input: $input) { ${PAYMENT_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.govCreatePayment;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.payments });\n if (data.applicationId)\n qc.invalidateQueries({ queryKey: KEY.application(data.applicationId) });\n },\n });\n};\n\nexport const useGovMarkPaymentPaid = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: { id: string; providerRef?: string | null }) => {\n const result = await govQuery<{ govMarkPaymentPaid: GovPayment }>(\n `mutation GovMarkPaymentPaid($id: ID!, $providerRef: String) {\n govMarkPaymentPaid(id: $id, providerRef: $providerRef) { ${PAYMENT_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govMarkPaymentPaid;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.payments }),\n });\n};\n\nexport const useGovRefundPayment = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (id: string) => {\n const result = await govQuery<{ govRefundPayment: GovPayment }>(\n `mutation GovRefundPayment($id: ID!) {\n govRefundPayment(id: $id) { ${PAYMENT_FIELDS} }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.govRefundPayment;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.payments }),\n });\n};\n\n// ============================================================================\n// Permits (list = ARRAY, no pagination) + public verification\n// ============================================================================\n\nexport interface PermitFilters {\n holderId?: string;\n serviceId?: string;\n status?: GovPermitStatus;\n pagination?: PaginationInput;\n}\n\n/**\n * `govListPermits` returns a paginated `GovPermitConnection`, flattened to a\n * plain array here since PermitsPage reads `data` as GovPermit[] and infers\n * `hasMore` itself from a full-length page. Callers page with `{ limit, offset }`.\n */\nexport const useGovPermits = (filters: PermitFilters = {}) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: [...KEY.permits, filters],\n queryFn: async () => {\n const result = await govQuery<{ govListPermits: GovConnection<GovPermit> }>(\n `query GovListPermits($holderId: ID, $serviceId: ID, $status: GovPermitStatus, $pagination: PaginationInput) {\n govListPermits(holderId: $holderId, serviceId: $serviceId, status: $status, pagination: $pagination) {\n items { ${PERMIT_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n {\n holderId: filters.holderId,\n serviceId: filters.serviceId,\n status: filters.status,\n pagination: page(filters.pagination),\n },\n apiGatewayUrl\n );\n return result.govListPermits.items;\n },\n });\n};\n\nexport const useGovIssuePermit = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: GovIssuePermitInput) => {\n const result = await govQuery<{ govIssuePermit: GovPermit }>(\n `mutation GovIssuePermit($input: GovIssuePermitInput!) {\n govIssuePermit(input: $input) { ${PERMIT_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.govIssuePermit;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.permits });\n if (data.applicationId)\n qc.invalidateQueries({ queryKey: KEY.application(data.applicationId) });\n },\n });\n};\n\nexport const useGovRevokePermit = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: { id: string; reason?: string | null }) => {\n const result = await govQuery<{ govRevokePermit: GovPermit }>(\n `mutation GovRevokePermit($id: ID!, $reason: String) {\n govRevokePermit(id: $id, reason: $reason) { ${PERMIT_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govRevokePermit;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.permits }),\n });\n};\n\n/**\n * Render the permit as a downloadable/printable PDF (BOFF-4060). A mutation\n * (not a query) even though the backend field is a GraphQL Query: it's a\n * client-triggered, non-cached action fired from a \"Download\" / \"Print\"\n * button, exactly like the `getBlob` thunk in the platform's Save-to-Files\n * pattern — the bytes are only assembled when the officer actually clicks.\n */\nexport const useGovPermitPdf = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useMutation({\n mutationFn: async (id: string) => {\n const result = await govQuery<{\n govPermitPdf: { pdfBase64: string; filename: string; generatedAt: string };\n }>(\n `query GovPermitPdf($id: ID!) {\n govPermitPdf(id: $id) { pdfBase64 filename generatedAt }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.govPermitPdf;\n },\n });\n};\n\n/**\n * Persist a `wspace-files-svc` File reference onto an issued permit once the\n * client has saved the rendered PDF via the platform's Save-to-Files flow.\n */\nexport const useGovAttachPermitFile = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: { id: string; fileId: string }) => {\n const result = await govQuery<{ govAttachPermitFile: GovPermit }>(\n `mutation GovAttachPermitFile($id: ID!, $fileId: ID!) {\n govAttachPermitFile(id: $id, fileId: $fileId) { ${PERMIT_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govAttachPermitFile;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.permits }),\n });\n};\n\n/**\n * Public permit verification by printed code. `govVerifyPermit` is a PUBLIC field\n * (no auth), but we keep the workspace-token transport for a consistent gateway\n * path. `enabled` is false until a code is supplied so the query is manual.\n */\nexport const useGovVerifyPermit = (verificationCode: string | undefined) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: ['govcitizenhub', 'verify-permit', verificationCode ?? ''],\n enabled: Boolean(verificationCode),\n retry: false,\n queryFn: async () => {\n const result = await govQuery<{ govVerifyPermit: GovPermit | null }>(\n `query GovVerifyPermit($verificationCode: String!) {\n govVerifyPermit(verificationCode: $verificationCode) { ${PERMIT_FIELDS} }\n }`,\n { verificationCode },\n apiGatewayUrl\n );\n return result.govVerifyPermit;\n },\n });\n};\n\n// ============================================================================\n// Grievances (connection)\n// ============================================================================\n\nexport interface GrievanceFilters {\n agencyId?: string;\n reporterId?: string;\n status?: GovGrievanceStatus;\n pagination?: PaginationInput;\n}\n\nexport const useGovGrievances = (filters: GrievanceFilters = {}) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: [...KEY.grievances, filters],\n queryFn: async () => {\n const result = await govQuery<{ govListGrievances: GovConnection<GovGrievance> }>(\n `query GovListGrievances($agencyId: ID, $reporterId: ID, $status: GovGrievanceStatus, $pagination: PaginationInput) {\n govListGrievances(agencyId: $agencyId, reporterId: $reporterId, status: $status, pagination: $pagination) {\n items { ${GRIEVANCE_FIELDS} }\n pageInfo { cursor hasMore }\n }\n }`,\n {\n agencyId: filters.agencyId,\n reporterId: filters.reporterId,\n status: filters.status,\n pagination: page(filters.pagination),\n },\n apiGatewayUrl\n );\n return result.govListGrievances;\n },\n });\n};\n\nexport const useGovGrievance = (id: string | undefined) => {\n const { apiGatewayUrl } = useGovCitizenHub();\n return useQuery({\n queryKey: KEY.grievance(id ?? ''),\n enabled: Boolean(id),\n queryFn: async () => {\n const result = await govQuery<{ govGrievance: GovGrievance | null }>(\n `query GovGrievance($id: ID!) {\n govGrievance(id: $id) { ${GRIEVANCE_FIELDS} }\n }`,\n { id },\n apiGatewayUrl\n );\n return result.govGrievance;\n },\n });\n};\n\nexport const useGovReportGrievance = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (input: GovReportGrievanceInput) => {\n const result = await govQuery<{ govReportGrievance: GovGrievance }>(\n `mutation GovReportGrievance($input: GovReportGrievanceInput!) {\n govReportGrievance(input: $input) { ${GRIEVANCE_FIELDS} }\n }`,\n { input },\n apiGatewayUrl\n );\n return result.govReportGrievance;\n },\n onSuccess: () => qc.invalidateQueries({ queryKey: KEY.grievances }),\n });\n};\n\nexport const useGovUpdateGrievance = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: { id: string; input: GovUpdateGrievanceInput }) => {\n const result = await govQuery<{ govUpdateGrievance: GovGrievance }>(\n `mutation GovUpdateGrievance($id: ID!, $input: GovUpdateGrievanceInput!) {\n govUpdateGrievance(id: $id, input: $input) { ${GRIEVANCE_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govUpdateGrievance;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.grievances });\n qc.invalidateQueries({ queryKey: KEY.grievance(data.id) });\n },\n });\n};\n\nexport const useGovTransitionGrievance = () => {\n const { apiGatewayUrl } = useGovCitizenHub();\n const qc = useQueryClient();\n return useMutation({\n mutationFn: async (vars: {\n id: string;\n status: GovGrievanceStatus;\n resolution?: string | null;\n }) => {\n const result = await govQuery<{ govTransitionGrievance: GovGrievance }>(\n `mutation GovTransitionGrievance($id: ID!, $status: GovGrievanceStatus!, $resolution: String) {\n govTransitionGrievance(id: $id, status: $status, resolution: $resolution) { ${GRIEVANCE_FIELDS} }\n }`,\n vars,\n apiGatewayUrl\n );\n return result.govTransitionGrievance;\n },\n onSuccess: (data) => {\n qc.invalidateQueries({ queryKey: KEY.grievances });\n qc.invalidateQueries({ queryKey: KEY.grievance(data.id) });\n },\n });\n};\n"],"mappings":";;;;;;AA6DA,IAAM,KAAc,MAA2B,iBAAiB,KAAK,CAAK,GAE7D,IAAW,OACtB,GACA,GACA,MACmB;CAKnB,IAAM,IAAW,EAAW,CAAK;CACjC,AAAI,KAAU,EAA0B;CAExC,IAAM,IAAW,MAAM,EAAoB;EACzC,SAAS;EACT;EACA;EACA;EACA,gBAAgB;CAClB,CAAC;CAED,AAAI,KAAU,EAA0B;CAOxC,IAAM,IAAO,EAAS;CAItB,IAAI,EAFF,KAAQ,QAAQ,OAAO,OAAO,CAAI,EAAE,MAAM,MAAU,KAAU,IAA2B,IAGzF,MAAU,MAAM,EAAS,SAAS,IAAI,WAAW,uCAAuC;CAM1F,OAJI,EAAS,QAAQ,UAEnB,QAAQ,KAAK,0DAA0D,EAAS,MAAM,GAEjF,EAAS;AAClB,GAGM,IAAM;CACV,WAAW,CAAC,iBAAiB,mBAAmB;CAChD,uBAAuB,CAAC,iBAAiB,yBAAyB;CAClE,uBAAuB,CAAC,iBAAiB,yBAAyB;CAClE,oBAAoB,CAAC,iBAAiB,sBAAsB;CAC5D,UAAU,CAAC,iBAAiB,UAAU;CACtC,SAAS,MAAe;EAAC;EAAiB;EAAU;CAAE;CACtD,UAAU,CAAC,iBAAiB,UAAU;CACtC,UAAU,MAAe;EAAC;EAAiB;EAAW;CAAE;CACxD,cAAc,CAAC,iBAAiB,cAAc;CAC9C,cAAc,MAAe;EAAC;EAAiB;EAAe;CAAE;CAChE,UAAU,CAAC,iBAAiB,UAAU;CACtC,UAAU,MAAe;EAAC;EAAiB;EAAW;CAAE;CACxD,SAAS,CAAC,iBAAiB,SAAS;CACpC,YAAY,CAAC,iBAAiB,YAAY;CAC1C,YAAY,MAAe;EAAC;EAAiB;EAAa;CAAE;AAC9D,GAEM,I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AEhB,iBAAiB,EAAG,kBAAkB,EAAE,UAAU,EAAI,WAAW,CAAC;CACpE,CAAC;AACH,GAEa,WAA8B;CACzC,IAAM,EAAE,qBAAkB,EAAiB,GACrC,IAAK,EAAe;CAC1B,OAAO,EAAY;EACjB,YAAY,OAAO,OAQV,MAPc,EACnB;yDACiD,EAAiB;YAElE,GACA,CACF,GACc;EAEhB,YAAY,MAAS;GAEnB,AADA,EAAG,kBAAkB,EAAE,UAAU,EAAI,WAAW,CAAC,GACjD,EAAG,kBAAkB,EAAE,UAAU,EAAI,UAAU,EAAK,EAAE,EAAE,CAAC;EAC3D;CACF,CAAC;AACH,GAEa,WAAkC;CAC7C,IAAM,EAAE,qBAAkB,EAAiB,GACrC,IAAK,EAAe;CAC1B,OAAO,EAAY;EACjB,YAAY,OAAO,OAYV,MAPc,EACnB;wFACgF,EAAiB;YAEjG,GACA,CACF,GACc;EAEhB,YAAY,MAAS;GAEnB,AADA,EAAG,kBAAkB,EAAE,UAAU,EAAI,WAAW,CAAC,GACjD,EAAG,kBAAkB,EAAE,UAAU,EAAI,UAAU,EAAK,EAAE,EAAE,CAAC;EAC3D;CACF,CAAC;AACH"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { GovAdminLevel, GovAdminLevelConnection, GovAssetCategoryCount, GovBenchmarkResult, GovBenchmarkScope, GovBudget, GovBudgetConnection, GovBudgetExecution, GovBudgetFilterInput, GovBudgetLineInput, GovConsultation, GovConsultationConnection, GovConsultationFilterInput, GovConsultationResponse, GovConsultationResults, GovCreateAdminLevelInput, GovCreateBudgetInput, GovCreateConsultationInput, GovCreateDatasetInput, GovCreateElectionInput, GovCreateIndicatorInput, GovCreateJurisdictionEventInput, GovCreateJurisdictionInput, GovCreateOfficialCommitmentInput, GovCreateOfficialInput, GovCreateProjectInput, GovCreateProjectMilestoneInput, GovCreatePublicAssetInput, GovDataChangeProposal, GovDataChangeProposalConnection, GovDataChangeProposalFilterInput, GovDataset, GovDatasetConnection, GovDatasetFilterInput, GovElection, GovElectionConnection, GovElectionFilterInput, GovElectionResultInput, GovGrievanceInsights, GovIndicator, GovIndicatorConnection, GovIndicatorDomain, GovIndicatorFilterInput, GovIndicatorSeries, GovIndicatorValue, GovIndicatorValueConnection, GovIndicatorValueFilterInput, GovJurisdiction, GovJurisdictionConnection, GovJurisdictionEvent, GovJurisdictionEventConnection, GovJurisdictionFilterInput, GovJurisdictionFollow, GovJurisdictionInsight, GovJurisdictionOverview, GovJurisdictionScorecard, GovJurisdictionTreeNode, GovOfficial, GovOfficialCommitment, GovOfficialCommitmentConnection, GovOfficialCommitmentFilterInput, GovOfficialConnection, GovOfficialFilterInput, GovProject, GovProjectConnection, GovProjectFilterInput, GovProjectMilestone, GovProjectStatus, GovProposalStatus, GovPublicAsset, GovPublicAssetConnection, GovPublicAssetFilterInput, GovRecordIndicatorValueInput, GovServicePerformance, GovSubmitConsultationResponseInput, GovSubmitDataChangeProposalInput, GovUpdateAdminLevelInput, GovUpdateBudgetInput, GovUpdateConsultationInput, GovUpdateDatasetInput, GovUpdateElectionInput, GovUpdateIndicatorInput, GovUpdateIndicatorValueInput, GovUpdateJurisdictionEventInput, GovUpdateJurisdictionInput, GovUpdateOfficialCommitmentInput, GovUpdateOfficialInput, GovUpdateProjectInput, GovUpdateProjectMilestoneInput, GovUpdatePublicAssetInput, PaginationInput } from '../types';
|
|
2
|
+
|
|
3
|
+
export declare const useGovAdminLevels: (countryCode?: string, pagination?: PaginationInput) => import('@tanstack/react-query').UseQueryResult<GovAdminLevelConnection, Error>;
|
|
4
|
+
export declare const useGovAdminLevel: (id: string | undefined) => import('@tanstack/react-query').UseQueryResult<GovAdminLevel | null, Error>;
|
|
5
|
+
export declare const useGovCreateAdminLevel: () => import('@tanstack/react-query').UseMutationResult<GovAdminLevel, Error, GovCreateAdminLevelInput, unknown>;
|
|
6
|
+
export declare const useGovUpdateAdminLevel: () => import('@tanstack/react-query').UseMutationResult<GovAdminLevel, Error, {
|
|
7
|
+
id: string;
|
|
8
|
+
input: GovUpdateAdminLevelInput;
|
|
9
|
+
}, unknown>;
|
|
10
|
+
export declare const useGovDeleteAdminLevel: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
|
|
11
|
+
/** Bootstrap a country's hierarchy from a named preset. Additive and idempotent. */
|
|
12
|
+
export declare const useGovSeedAdminLevels: () => import('@tanstack/react-query').UseMutationResult<GovAdminLevel[], Error, {
|
|
13
|
+
countryCode: string;
|
|
14
|
+
preset?: string | null;
|
|
15
|
+
}, unknown>;
|
|
16
|
+
export declare const useGovJurisdictions: (filter?: GovJurisdictionFilterInput, pagination?: PaginationInput) => import('@tanstack/react-query').UseQueryResult<GovJurisdictionConnection, Error>;
|
|
17
|
+
export declare const useGovJurisdiction: (id: string | undefined) => import('@tanstack/react-query').UseQueryResult<GovJurisdiction | null, Error>;
|
|
18
|
+
export declare const useGovJurisdictionBySlug: (slug: string | undefined) => import('@tanstack/react-query').UseQueryResult<GovJurisdiction | null, Error>;
|
|
19
|
+
/** The administrative hierarchy as a tree. `maxDepth` is clamped to 6 tiers by the service. */
|
|
20
|
+
export declare const useGovJurisdictionTree: (rootId?: string | null, maxDepth?: number) => import('@tanstack/react-query').UseQueryResult<GovJurisdictionTreeNode[], Error>;
|
|
21
|
+
/** Single page-load aggregate for the jurisdiction profile screen. */
|
|
22
|
+
export declare const useGovJurisdictionOverview: (jurisdictionId: string | undefined) => import('@tanstack/react-query').UseQueryResult<GovJurisdictionOverview | null, Error>;
|
|
23
|
+
export declare const useGovCreateJurisdiction: () => import('@tanstack/react-query').UseMutationResult<GovJurisdiction, Error, GovCreateJurisdictionInput, unknown>;
|
|
24
|
+
export declare const useGovUpdateJurisdiction: () => import('@tanstack/react-query').UseMutationResult<GovJurisdiction, Error, {
|
|
25
|
+
id: string;
|
|
26
|
+
input: GovUpdateJurisdictionInput;
|
|
27
|
+
}, unknown>;
|
|
28
|
+
export declare const useGovPublishJurisdiction: () => import('@tanstack/react-query').UseMutationResult<GovJurisdiction, Error, string, unknown>;
|
|
29
|
+
export declare const useGovArchiveJurisdiction: () => import('@tanstack/react-query').UseMutationResult<GovJurisdiction, Error, string, unknown>;
|
|
30
|
+
export declare const useGovDeleteJurisdiction: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
|
|
31
|
+
export declare const useGovOfficials: (filter?: GovOfficialFilterInput, pagination?: PaginationInput) => import('@tanstack/react-query').UseQueryResult<GovOfficialConnection, Error>;
|
|
32
|
+
export declare const useGovOfficial: (id: string | undefined) => import('@tanstack/react-query').UseQueryResult<GovOfficial | null, Error>;
|
|
33
|
+
export declare const useGovOfficialCommitments: (filter?: GovOfficialCommitmentFilterInput, pagination?: PaginationInput) => import('@tanstack/react-query').UseQueryResult<GovOfficialCommitmentConnection, Error>;
|
|
34
|
+
export declare const useGovCreateOfficial: () => import('@tanstack/react-query').UseMutationResult<GovOfficial, Error, GovCreateOfficialInput, unknown>;
|
|
35
|
+
export declare const useGovUpdateOfficial: () => import('@tanstack/react-query').UseMutationResult<GovOfficial, Error, {
|
|
36
|
+
id: string;
|
|
37
|
+
input: GovUpdateOfficialInput;
|
|
38
|
+
}, unknown>;
|
|
39
|
+
export declare const useGovDeleteOfficial: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
|
|
40
|
+
export declare const useGovCreateOfficialCommitment: () => import('@tanstack/react-query').UseMutationResult<GovOfficialCommitment, Error, GovCreateOfficialCommitmentInput, unknown>;
|
|
41
|
+
export declare const useGovUpdateOfficialCommitment: () => import('@tanstack/react-query').UseMutationResult<GovOfficialCommitment, Error, {
|
|
42
|
+
id: string;
|
|
43
|
+
input: GovUpdateOfficialCommitmentInput;
|
|
44
|
+
}, unknown>;
|
|
45
|
+
export declare const useGovDeleteOfficialCommitment: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
|
|
46
|
+
export declare const useGovElections: (filter?: GovElectionFilterInput, pagination?: PaginationInput) => import('@tanstack/react-query').UseQueryResult<GovElectionConnection, Error>;
|
|
47
|
+
export declare const useGovElection: (id: string | undefined) => import('@tanstack/react-query').UseQueryResult<GovElection | null, Error>;
|
|
48
|
+
export declare const useGovCreateElection: () => import('@tanstack/react-query').UseMutationResult<GovElection, Error, GovCreateElectionInput, unknown>;
|
|
49
|
+
export declare const useGovUpdateElection: () => import('@tanstack/react-query').UseMutationResult<GovElection, Error, {
|
|
50
|
+
id: string;
|
|
51
|
+
input: GovUpdateElectionInput;
|
|
52
|
+
}, unknown>;
|
|
53
|
+
export declare const useGovDeleteElection: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
|
|
54
|
+
/** Replace an election's declared results in one transaction. */
|
|
55
|
+
export declare const useGovRecordElectionResults: () => import('@tanstack/react-query').UseMutationResult<GovElection, Error, {
|
|
56
|
+
electionId: string;
|
|
57
|
+
results: GovElectionResultInput[];
|
|
58
|
+
}, unknown>;
|
|
59
|
+
export declare const useGovJurisdictionEvents: (jurisdictionId: string | undefined, pagination?: PaginationInput) => import('@tanstack/react-query').UseQueryResult<GovJurisdictionEventConnection, Error>;
|
|
60
|
+
export declare const useGovCreateJurisdictionEvent: () => import('@tanstack/react-query').UseMutationResult<GovJurisdictionEvent, Error, GovCreateJurisdictionEventInput, unknown>;
|
|
61
|
+
export declare const useGovUpdateJurisdictionEvent: () => import('@tanstack/react-query').UseMutationResult<GovJurisdictionEvent, Error, {
|
|
62
|
+
id: string;
|
|
63
|
+
input: GovUpdateJurisdictionEventInput;
|
|
64
|
+
}, unknown>;
|
|
65
|
+
export declare const useGovDeleteJurisdictionEvent: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
|
|
66
|
+
export declare const useGovBudgets: (filter?: GovBudgetFilterInput, pagination?: PaginationInput) => import('@tanstack/react-query').UseQueryResult<GovBudgetConnection, Error>;
|
|
67
|
+
export declare const useGovBudget: (id: string | undefined) => import('@tanstack/react-query').UseQueryResult<GovBudget | null, Error>;
|
|
68
|
+
export declare const useGovBudgetExecution: (budgetId: string | undefined) => import('@tanstack/react-query').UseQueryResult<GovBudgetExecution | null, Error>;
|
|
69
|
+
export declare const useGovCreateBudget: () => import('@tanstack/react-query').UseMutationResult<GovBudget, Error, GovCreateBudgetInput, unknown>;
|
|
70
|
+
export declare const useGovUpdateBudget: () => import('@tanstack/react-query').UseMutationResult<GovBudget, Error, {
|
|
71
|
+
id: string;
|
|
72
|
+
input: GovUpdateBudgetInput;
|
|
73
|
+
}, unknown>;
|
|
74
|
+
export declare const useGovPublishBudget: () => import('@tanstack/react-query').UseMutationResult<GovBudget, Error, string, unknown>;
|
|
75
|
+
export declare const useGovDeleteBudget: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
|
|
76
|
+
/** Create/update budget lines in one transaction; the service re-derives the totals. */
|
|
77
|
+
export declare const useGovUpsertBudgetLines: () => import('@tanstack/react-query').UseMutationResult<GovBudget, Error, {
|
|
78
|
+
budgetId: string;
|
|
79
|
+
lines: GovBudgetLineInput[];
|
|
80
|
+
}, unknown>;
|
|
81
|
+
export declare const useGovDeleteBudgetLine: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, {
|
|
82
|
+
id: string;
|
|
83
|
+
budgetId?: string;
|
|
84
|
+
}, unknown>;
|
|
85
|
+
export declare const useGovProjects: (filter?: GovProjectFilterInput, pagination?: PaginationInput) => import('@tanstack/react-query').UseQueryResult<GovProjectConnection, Error>;
|
|
86
|
+
export declare const useGovProject: (id: string | undefined) => import('@tanstack/react-query').UseQueryResult<GovProject | null, Error>;
|
|
87
|
+
export declare const useGovCreateProject: () => import('@tanstack/react-query').UseMutationResult<GovProject, Error, GovCreateProjectInput, unknown>;
|
|
88
|
+
export declare const useGovUpdateProject: () => import('@tanstack/react-query').UseMutationResult<GovProject, Error, {
|
|
89
|
+
id: string;
|
|
90
|
+
input: GovUpdateProjectInput;
|
|
91
|
+
}, unknown>;
|
|
92
|
+
/** Advance a project's delivery status, optionally recording progress and a delay reason. */
|
|
93
|
+
export declare const useGovUpdateProjectStatus: () => import('@tanstack/react-query').UseMutationResult<GovProject, Error, {
|
|
94
|
+
id: string;
|
|
95
|
+
status: GovProjectStatus;
|
|
96
|
+
progressPercent?: number | null;
|
|
97
|
+
delayReason?: string | null;
|
|
98
|
+
}, unknown>;
|
|
99
|
+
export declare const useGovDeleteProject: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
|
|
100
|
+
export declare const useGovCreateProjectMilestone: () => import('@tanstack/react-query').UseMutationResult<GovProjectMilestone, Error, GovCreateProjectMilestoneInput, unknown>;
|
|
101
|
+
export declare const useGovUpdateProjectMilestone: () => import('@tanstack/react-query').UseMutationResult<GovProjectMilestone, Error, {
|
|
102
|
+
id: string;
|
|
103
|
+
input: GovUpdateProjectMilestoneInput;
|
|
104
|
+
}, unknown>;
|
|
105
|
+
export declare const useGovDeleteProjectMilestone: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, {
|
|
106
|
+
id: string;
|
|
107
|
+
projectId?: string;
|
|
108
|
+
}, unknown>;
|
|
109
|
+
export declare const useGovIndicators: (filter?: GovIndicatorFilterInput, pagination?: PaginationInput) => import('@tanstack/react-query').UseQueryResult<GovIndicatorConnection, Error>;
|
|
110
|
+
export declare const useGovIndicator: (id: string | undefined) => import('@tanstack/react-query').UseQueryResult<GovIndicator | null, Error>;
|
|
111
|
+
export declare const useGovIndicatorValues: (filter?: GovIndicatorValueFilterInput, pagination?: PaginationInput) => import('@tanstack/react-query').UseQueryResult<GovIndicatorValueConnection, Error>;
|
|
112
|
+
/** An indicator's full published history for one jurisdiction, keyed by indicator CODE. */
|
|
113
|
+
export declare const useGovIndicatorSeries: (jurisdictionId: string | undefined, indicatorCode: string | undefined, range?: {
|
|
114
|
+
fromPeriod?: string;
|
|
115
|
+
toPeriod?: string;
|
|
116
|
+
}) => import('@tanstack/react-query').UseQueryResult<GovIndicatorSeries | null, Error>;
|
|
117
|
+
export declare const useGovCreateIndicator: () => import('@tanstack/react-query').UseMutationResult<GovIndicator, Error, GovCreateIndicatorInput, unknown>;
|
|
118
|
+
export declare const useGovUpdateIndicator: () => import('@tanstack/react-query').UseMutationResult<GovIndicator, Error, {
|
|
119
|
+
id: string;
|
|
120
|
+
input: GovUpdateIndicatorInput;
|
|
121
|
+
}, unknown>;
|
|
122
|
+
export declare const useGovDeleteIndicator: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
|
|
123
|
+
/** Seed the country-neutral standard indicator catalogue. Additive and idempotent. */
|
|
124
|
+
export declare const useGovSeedIndicatorCatalog: () => import('@tanstack/react-query').UseMutationResult<GovIndicator[], Error, GovIndicatorDomain[] | undefined, unknown>;
|
|
125
|
+
export declare const useGovRecordIndicatorValue: () => import('@tanstack/react-query').UseMutationResult<GovIndicatorValue, Error, GovRecordIndicatorValueInput, unknown>;
|
|
126
|
+
/** Record many values in one transaction. Existing period rows are updated in place. */
|
|
127
|
+
export declare const useGovBulkRecordIndicatorValues: () => import('@tanstack/react-query').UseMutationResult<GovIndicatorValue[], Error, GovRecordIndicatorValueInput[], unknown>;
|
|
128
|
+
export declare const useGovUpdateIndicatorValue: () => import('@tanstack/react-query').UseMutationResult<GovIndicatorValue, Error, {
|
|
129
|
+
id: string;
|
|
130
|
+
input: GovUpdateIndicatorValueInput;
|
|
131
|
+
}, unknown>;
|
|
132
|
+
export declare const useGovDeleteIndicatorValue: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
|
|
133
|
+
export declare const useGovJurisdictionScorecard: (jurisdictionId: string | undefined, periodLabel?: string) => import('@tanstack/react-query').UseQueryResult<GovJurisdictionScorecard | null, Error>;
|
|
134
|
+
export declare const useGovJurisdictionBenchmark: (jurisdictionId: string | undefined, indicatorCode: string | undefined, options?: {
|
|
135
|
+
scope?: GovBenchmarkScope;
|
|
136
|
+
periodLabel?: string;
|
|
137
|
+
peerIds?: string[];
|
|
138
|
+
}) => import('@tanstack/react-query').UseQueryResult<GovBenchmarkResult | null, Error>;
|
|
139
|
+
export declare const useGovJurisdictionInsights: (jurisdictionId: string | undefined) => import('@tanstack/react-query').UseQueryResult<GovJurisdictionInsight[], Error>;
|
|
140
|
+
/** Service-delivery performance computed live from the catalogue + casework models. */
|
|
141
|
+
export declare const useGovJurisdictionServicePerformance: (jurisdictionId: string | undefined, range?: {
|
|
142
|
+
from?: string;
|
|
143
|
+
to?: string;
|
|
144
|
+
}) => import('@tanstack/react-query').UseQueryResult<GovServicePerformance, Error>;
|
|
145
|
+
/** Citizen-issue insight computed live from the existing grievance model. */
|
|
146
|
+
export declare const useGovJurisdictionGrievanceInsights: (jurisdictionId: string | undefined, range?: {
|
|
147
|
+
from?: string;
|
|
148
|
+
to?: string;
|
|
149
|
+
}) => import('@tanstack/react-query').UseQueryResult<GovGrievanceInsights, Error>;
|
|
150
|
+
export declare const useGovPublicAssets: (filter?: GovPublicAssetFilterInput, pagination?: PaginationInput) => import('@tanstack/react-query').UseQueryResult<GovPublicAssetConnection, Error>;
|
|
151
|
+
export declare const useGovPublicAsset: (id: string | undefined) => import('@tanstack/react-query').UseQueryResult<GovPublicAsset | null, Error>;
|
|
152
|
+
/** Asset counts by category — drives map legends and registry summaries. */
|
|
153
|
+
export declare const useGovPublicAssetSummary: (jurisdictionId: string | undefined) => import('@tanstack/react-query').UseQueryResult<GovAssetCategoryCount[], Error>;
|
|
154
|
+
export declare const useGovCreatePublicAsset: () => import('@tanstack/react-query').UseMutationResult<GovPublicAsset, Error, GovCreatePublicAssetInput, unknown>;
|
|
155
|
+
export declare const useGovUpdatePublicAsset: () => import('@tanstack/react-query').UseMutationResult<GovPublicAsset, Error, {
|
|
156
|
+
id: string;
|
|
157
|
+
input: GovUpdatePublicAssetInput;
|
|
158
|
+
}, unknown>;
|
|
159
|
+
export declare const useGovDeletePublicAsset: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
|
|
160
|
+
export declare const useGovConsultations: (filter?: GovConsultationFilterInput, pagination?: PaginationInput) => import('@tanstack/react-query').UseQueryResult<GovConsultationConnection, Error>;
|
|
161
|
+
export declare const useGovConsultation: (id: string | undefined) => import('@tanstack/react-query').UseQueryResult<GovConsultation | null, Error>;
|
|
162
|
+
/** Aggregate, publishable results. Raw responses are never exposed. */
|
|
163
|
+
export declare const useGovConsultationResults: (consultationId: string | undefined) => import('@tanstack/react-query').UseQueryResult<GovConsultationResults | null, Error>;
|
|
164
|
+
/**
|
|
165
|
+
* The calling actor's own response, if any. Resolving to `null` is the normal
|
|
166
|
+
* pre-submission state — not an error.
|
|
167
|
+
*/
|
|
168
|
+
export declare const useGovMyConsultationResponse: (consultationId: string | undefined) => import('@tanstack/react-query').UseQueryResult<GovConsultationResponse | null, Error>;
|
|
169
|
+
export declare const useGovCreateConsultation: () => import('@tanstack/react-query').UseMutationResult<GovConsultation, Error, GovCreateConsultationInput, unknown>;
|
|
170
|
+
export declare const useGovUpdateConsultation: () => import('@tanstack/react-query').UseMutationResult<GovConsultation, Error, {
|
|
171
|
+
id: string;
|
|
172
|
+
input: GovUpdateConsultationInput;
|
|
173
|
+
}, unknown>;
|
|
174
|
+
export declare const useGovOpenConsultation: () => import('@tanstack/react-query').UseMutationResult<GovConsultation, Error, string, unknown>;
|
|
175
|
+
export declare const useGovCloseConsultation: () => import('@tanstack/react-query').UseMutationResult<GovConsultation, Error, string, unknown>;
|
|
176
|
+
/** Compute and publish the aggregate result set. Raw responses are never published. */
|
|
177
|
+
export declare const useGovPublishConsultationResults: () => import('@tanstack/react-query').UseMutationResult<GovConsultation, Error, string, unknown>;
|
|
178
|
+
export declare const useGovDeleteConsultation: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
|
|
179
|
+
/** Submit the calling actor's response. One response per actor per consultation. */
|
|
180
|
+
export declare const useGovSubmitConsultationResponse: () => import('@tanstack/react-query').UseMutationResult<GovConsultationResponse, Error, GovSubmitConsultationResponseInput, unknown>;
|
|
181
|
+
export declare const useGovDatasets: (filter?: GovDatasetFilterInput, pagination?: PaginationInput) => import('@tanstack/react-query').UseQueryResult<GovDatasetConnection, Error>;
|
|
182
|
+
export declare const useGovDataset: (id: string | undefined) => import('@tanstack/react-query').UseQueryResult<GovDataset | null, Error>;
|
|
183
|
+
export declare const useGovCreateDataset: () => import('@tanstack/react-query').UseMutationResult<GovDataset, Error, GovCreateDatasetInput, unknown>;
|
|
184
|
+
export declare const useGovUpdateDataset: () => import('@tanstack/react-query').UseMutationResult<GovDataset, Error, {
|
|
185
|
+
id: string;
|
|
186
|
+
input: GovUpdateDatasetInput;
|
|
187
|
+
}, unknown>;
|
|
188
|
+
export declare const useGovPublishDataset: () => import('@tanstack/react-query').UseMutationResult<GovDataset, Error, string, unknown>;
|
|
189
|
+
export declare const useGovDeleteDataset: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
|
|
190
|
+
/** Increment a dataset's download counter. */
|
|
191
|
+
export declare const useGovRecordDatasetDownload: () => import('@tanstack/react-query').UseMutationResult<GovDataset, Error, string, unknown>;
|
|
192
|
+
export declare const useGovMyFollowedJurisdictions: (pagination?: PaginationInput) => import('@tanstack/react-query').UseQueryResult<GovJurisdictionConnection, Error>;
|
|
193
|
+
export declare const useGovFollowJurisdiction: () => import('@tanstack/react-query').UseMutationResult<GovJurisdictionFollow, Error, {
|
|
194
|
+
jurisdictionId: string;
|
|
195
|
+
topics?: string[] | null;
|
|
196
|
+
channels?: string[] | null;
|
|
197
|
+
}, unknown>;
|
|
198
|
+
export declare const useGovUnfollowJurisdiction: () => import('@tanstack/react-query').UseMutationResult<boolean, Error, string, unknown>;
|
|
199
|
+
export declare const useGovDataChangeProposals: (filter?: GovDataChangeProposalFilterInput, pagination?: PaginationInput) => import('@tanstack/react-query').UseQueryResult<GovDataChangeProposalConnection, Error>;
|
|
200
|
+
export declare const useGovDataChangeProposal: (id: string | undefined) => import('@tanstack/react-query').UseQueryResult<GovDataChangeProposal | null, Error>;
|
|
201
|
+
/** Corrections the calling actor has submitted. */
|
|
202
|
+
export declare const useGovMyDataChangeProposals: (pagination?: PaginationInput) => import('@tanstack/react-query').UseQueryResult<GovDataChangeProposalConnection, Error>;
|
|
203
|
+
export declare const useGovSubmitDataChangeProposal: () => import('@tanstack/react-query').UseMutationResult<GovDataChangeProposal, Error, GovSubmitDataChangeProposalInput, unknown>;
|
|
204
|
+
export declare const useGovWithdrawDataChangeProposal: () => import('@tanstack/react-query').UseMutationResult<GovDataChangeProposal, Error, string, unknown>;
|
|
205
|
+
/**
|
|
206
|
+
* Record a review decision. ACCEPTED records the accepted correction and stamps
|
|
207
|
+
* `appliedAt`; it never silently mutates the target record.
|
|
208
|
+
*/
|
|
209
|
+
export declare const useGovReviewDataChangeProposal: () => import('@tanstack/react-query').UseMutationResult<GovDataChangeProposal, Error, {
|
|
210
|
+
id: string;
|
|
211
|
+
decision: GovProposalStatus;
|
|
212
|
+
reviewNote?: string | null;
|
|
213
|
+
}, unknown>;
|
|
214
|
+
//# sourceMappingURL=useIntelligenceApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIntelligenceApi.d.ts","sourceRoot":"","sources":["../../../src/govcitizenhub/hooks/useIntelligenceApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAMH,OAAO,KAAK,EACV,aAAa,EACb,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,+BAA+B,EAC/B,0BAA0B,EAC1B,gCAAgC,EAChC,sBAAsB,EACtB,qBAAqB,EACrB,8BAA8B,EAC9B,yBAAyB,EACzB,qBAAqB,EACrB,+BAA+B,EAC/B,gCAAgC,EAChC,UAAU,EACV,o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