// Step 1: Pure lookup helpers over SAUDI_LOCATION_HIERARCHY. No side // effects, no fetch — the dataset is static and imported directly, so // these functions are safe to call from both client components and the // yup validation schema (see src/validations/branch.validator.ts). import { SAUDI_LOCATION_HIERARCHY } from "@/src/data/saudiLocationHierarchy"; import { RegionEntry, CityEntry, DistrictEntry, ResolvedLocation } from "../data/location"; // Step 2: Return every region — used to populate the first dropdown. export function getRegions(): RegionEntry[] { return SAUDI_LOCATION_HIERARCHY; } // Step 3: Return the cities that belong to a given region id. Returns an // empty array (not undefined) when the region id is unknown, so callers // can render an empty