/**
 * Re-exported from the shared contract so both apps read one definition.
 *
 * See the portal's copy of this file: the two apps each maintained their own
 * `Location`/`LocationType` and drifted. The payload types below stay here —
 * only the backoffice writes locations.
 */
export type {
  Location,
  LocationType,
  ListResponse,
} from '@ema-platform/api';

import type { Bilingual } from '@ema-platform/api';

/** @deprecated Use `Bilingual` from `@ema-platform/api` — it carries om/so too. */
export type NamePair = Bilingual;

export interface CreateLocationTypePayload {
  code: string;
  names: Bilingual;
  level: number;
}

export interface UpdateLocationTypePayload extends CreateLocationTypePayload {
  id: string;
}

export interface CreateLocationPayload {
  code: string;
  names: Bilingual;
  locationTypeId: string;
  parentId?: string | null;
}

export interface UpdateLocationPayload extends CreateLocationPayload {
  id: string;
}
