/**
 * Geography reference-data domain — the public province → city → district hierarchy the
 * backend seeds and serves (b4 contract `dev/contracts/domains/geography-addresses.md`).
 * Shapes mirror the wire DTOs exactly; the wire casing is **camelCase**
 * (`nameFa`/`sortOrder`/`provinceId`), not the snake_case the routing convention implies —
 * the swagger snapshot is the source of truth.
 *
 * The public lookups return **active-only, `sortOrder`-ordered** rows, so the DTOs carry no
 * `isActive`: an inactive region is simply absent, never a disabled option to render. A city
 * with **no districts** (e.g. Mashhad) returns a valid empty district list = whole-city-only.
 */

/** Fields shared by every reference region — the localisable name pair drives the dropdown label. */
export interface RegionName {
  nameFa: string;
  nameEn: string;
}

/** `ProvinceDto`. */
export interface Province extends RegionName {
  id: number;
  sortOrder: number;
}

/** `CityDto` — belongs to one province. */
export interface City extends RegionName {
  id: number;
  provinceId: number;
  sortOrder: number;
}

/** `DistrictDto` — belongs to one city. A `null`/absent district on a coverage area = whole city. */
export interface District extends RegionName {
  id: number;
  cityId: number;
  sortOrder: number;
}

/** The domain's API seam — a mock and the real client both implement this interface. */
export interface GeographyApi {
  listProvinces(): Promise<Province[]>;
  listCities(provinceId: number): Promise<City[]>;
  listDistricts(cityId: number): Promise<District[]>;
}
