PR Summary

What problems was I solving

Prospect/account overview pages were reconstructing canonical audience URLs in the frontend UI using route keys, creating redundant URL logic across UI and backend, and not threading tenant domain preferences properly through query boundaries.

What user-facing changes did I ship

Prospects and account overview pages now display canonical page URLs directly from backend instead of reconstructing them; switching tenant domains properly updates the URL display for pages. No UI functional changes. The 'Copy Link' functionality may show 'Publish to copy link' for unpublished pages as before.

How I implemented it

  1. Page Service: Added batch URL generation API getPageUrlsByPageIds that fetches canonical public URLs for multiple pages in one call without creating missing linked-audience route keys (enabling safe URL-only reads).

  2. Repository: Added getPageLinksByTargetsAndDomain method using a lateral SQL join to efficiently find which routing table entries reference target page IDs.

  3. Management Gateway: Updated prospectOverview and accountOverview GraphQL queries to add tenantDomainId parameter and serialize the url field; they call the new batch API via getPageUrlsByPageIdBatchChunked helper.

  4. Management UI View Model: Updated GraphQL operations to include tenantDomainId parameter and url field; view model hooks (useProspectsIndexViewModel) now thread tenantDomainId through all overviews.

  5. Management UI App: Prospects page now receives tenantDomainId from domain preferences and renders page.url directly in ProspectPagesCell, eliminating client-side URL construction.

Description for the changelog

feat: Add page-service batch page URL summary API for prospect/account overview (ARC-2083).

  • Backend: New getPageUrlsByPageIds API returns canonical URLs keyed by pageId without side effects.
  • Repository: Added getPageLinksByTargetsAndDomain with lateral join for efficient routing table lookups.
  • GraphQL: Prospect and account overview queries now accept tenantDomainId and return url field.
  • UI: Prospects and account pages consume canonical URLs directly, eliminating frontend URL construction.
  • Domain preferences: tenantDomainId is now properly threaded through overview data flow.

Management Gateway: Prospect/Account Overview URL Generation (Batch, tenantDomainId threading)

high3 files
Add batch page URL generation to prospect/account overview GraphQL queries; add tenantDomainId parameter threading; remove client-side route key fields from schema.

Page Service: New Batch Page URL Generation Feature

high3 files
Add batch canonical URL generation API `getPageUrlsByPageIds`; move linked-audience route key resolution to service layer; disable side-effectful route key creation in batch mode.

Page Service: Repository for Batch Page Link Retrieval

medium2 files
Add `getPageLinksByTargetsAndDomain` repository method to fetch routing table entries given multiple target page IDs via lateral join; update coverage tests.

Management UI: Prospect/Account Overview Queries Update; tenantDomainId Parameter

medium2 files
Update GraphQL operations for `ManagementProspectOverview` and `ManagementAccountOverview` to add `tenantDomainId` parameter and `url` field to `ProspectOverviewPage` fragment; regenerate operation contracts.

Management UI: Prospect Index View Model Now Threads tenantDomainId

medium2 files
Update `useProspectsIndexViewModel` to accept and thread `tenantDomainId` parameter through GraphQL query fetchers; update tests to include the parameter in mock GraphQL calls.

Management UI: Prospect Overviews Types Now Include url Field, Excluding prospectRouteKey/accountRouteKey

medium1 file
Update `ProspectOverviewPage` interface to include `url: string | null` and remove `prospectRouteKey` and `accountRouteKey`; update `hydrateProspectOverviewPage` to deserialize `url` from backend string to frontend Date type.

Management UI: Prospect Page Uses tenantDomainId and Consumes canonical page.url

low1 file
Remove `buildProspectPageUrl` import and `targetDomain` variable; thread `tenantDomainId` from preferred domain selection through `useProspectsIndexViewModel`; replace conditional URL construction with direct `page.url` field rendering in `ProspectPagesCell`.

Management UI: prospects-page-support Returns domains Array Instead of single defaultDomain

low2 files
Refactor `useProspectsPageSupportViewModel` to return full `domains` array instead of extracting default domain and `isLoadingUsers` separately; update test expectations to map `defaultDomain` to `domains[0]?.domain` and verify domains-map shape.

Page Service: Comprehensive Unit Tests for Batch URL Generation Feature

low1 file
Add extensive unit tests for new `getPageUrlsByPageIds` batch API implementation; verify no side effects in batch mode (no route key creation), verify null handling for unpublished pages, verify publisher service batch call, verify repository call shape.