/** * Resolve the vertical that applies to a memory write. * * Order of resolution: * 1. The write's account-level :LocalBusiness has a non-empty * `businessType` property → vertical = `schema-${businessType}`, * source = `localbusiness-override`, after applying VERTICAL_ALIASES. * 2. Otherwise → vertical = the brand-declared default, source = * `brand-default`. Brand vertical is `null` for non-vertical brands * (Maxy default), in which case only base rules apply. * * VERTICAL_ALIASES folds a businessType that has no ontology of its own onto * the vertical that already carries its labels. `trades` (plumber, electrician, * decorator) is service-delivery work on the canonical construction/SiteDesk * ontology and ships no divergent labels, so it resolves to `schema-construction` * — there is no `schema-trades.md`. Without this fold a `trades` businessType * would resolve to a non-existent file and every construction label would be * validated out-of-scope (base-only), silently dropping the rules that apply. * * The Cypher query reads the LocalBusiness anchored at `accountId`. Today's * data shape is one LocalBusiness per account; `LIMIT 1` defends against * incidental duplicates without claiming to resolve them. * * Errors propagate — the validator never silently falls back to brand-default * on a Neo4j failure. A silent fallback would mask a connectivity problem * with a doctrinally-wrong validation outcome. */ import type { Session } from "neo4j-driver"; export type VerticalSource = "brand-default" | "localbusiness-override"; export interface VerticalContext { /** Schema file basename without `.md`, or `null` for base-only. */ resolvedVertical: string | null; source: VerticalSource; } export interface ResolveActiveVerticalParams { session: Session; accountId: string | undefined; brandVertical: string | null; } export declare function resolveActiveVertical(params: ResolveActiveVerticalParams): Promise; //# sourceMappingURL=resolve-active-vertical.d.ts.map