_segmentId → business segment name) and is partially wired into exports, but it is not surfaced well for end users:businessSegmentId in attik-backend/src/config/exportFieldDefinitions.ts is pickerHidden: true and resolves from the primary service’s segment via charges (aggregationPath: '__primarySegmentId' in aggregationHelpers.ts) — usable for aggregation group-by, not obvious as a column.segment and charges catalogSegment).catalogSegment (name) and a filter-only catalogBusinessSegmentId; segment appears reliably only when charges are the expanded linked collection.BusinessSegment model is referenced in attik-backend/src/util/functions/dataExports/metadata.ts (getModelForEntity('businessSegments')) but business segments are not an allowed base/linked entity in ALLOWED_ENTITIES / entityFieldDefinitions.referenceableFromBase in exportFieldDefinitions.ts, with resolvers in getRelatedIds and reverseLookupConfig (joinedReport.ts, metadata.ts). The matrix is intentionally sparse, not N×N:contacts base → [] — no linked collections from a contact-base report.referenceableFromBase).attik-backend/src/util/functions/dataExports/RELATIONSHIPS.md (must stay in sync with referenceableFromBase, getRelatedIds, reverseLookupConfig).attik-frontend/src/app/tools/data-exports/)CreateReportForm.tsx, ReportColumnsSection.tsx, useDataExportsEntities.ts) reads referenceableFrom from GET /data-exports/entities?include=referenceable — any backend matrix expansion must be reflected here automatically; verify multi-link + column picker UX when many collections are linkable.ReportFiltersSection.tsx) already has a business-segment API endpoint branch — ensure new segment columns/filters use consistent labels with admin business-segment settings.attik-backend/src/config/exportFieldDefinitions.ts — add or unhide user-facing fields, e.g. Primary Business Segment (name) on inspections and/or quotes, resolved from primary charge → service → _segmentId → segment name (mirror __primarySegmentId pipeline in aggregationHelpers.ts and charge catalogSegment in joinedReport.ts).referenceableFromBase plus resolvers, not a single generic join engine (unless dev chooses otherwise).reverseLookupConfig.contacts).ALLOWED_ENTITIES pair against user stories.referenceableFromBase, resolver in getRelatedIds or reverseLookupConfig, row-expansion rule in expandRowsByRelated if one-to-many, filter path in filterBuilders.ts, and RELATIONSHIPS.md update.attik-backend/src/config/exportFieldDefinitions.tsattik-backend/src/util/functions/dataExports/joinedReport.ts, metadata.tsattik-backend/src/util/functions/dataExports/RELATIONSHIPS.mdPlease authenticate to join the conversation.
Triage
Main App
About 4 hours ago
Linear
Get notified by email when there are changes.
Triage
Main App
About 4 hours ago
Linear
Get notified by email when there are changes.