export interface NamePair {
  en: string;
  am: string;
}

export interface Organization {
  id: string;
  name: NamePair;
  key: string;
  isSuperAdmin: boolean;
  isGovernmentOrganization: boolean;
  status: string;
  parentId: string | null;
  organizationTypeId: string;
  createdAt: string;
  updatedAt: string;
}

export interface Profession {
  id: string;
  departmentId: string;
  department?: Organization;
  name: NamePair;
  description: NamePair;
  isActive: boolean;
  createdAt: string;
  updatedAt: string;
}

export interface ListResponse<T> {
  count?: number;
  total?: number;
  items: T[];
}

export interface CreateProfessionPayload {
  departmentId: string;
  name: NamePair;
  description: NamePair;
}

export interface UpdateProfessionPayload {
  id: string;
  departmentId?: string;
  name?: NamePair;
  description?: NamePair;
  isActive?: boolean;
}

/** Identifiers whose rendered shape is authored in the backoffice. */
export type NumberFormatScope =
  | 'SEAFARER_NUMBER'
  | 'SEAMAN_BOOK_NUMBER'
  | 'BTC_NUMBER'
  | 'BSID';

/**
 * The shape of a generated identifier — prefix, optional year, separator and
 * zero-padded counter, e.g. SEA-2026-000001.
 *
 * Only the shape. The counter itself is server-side and atomic, so nothing
 * here can cause two people to be issued the same number.
 */
export interface NumberFormatConfig {
  id: string;
  scope: NumberFormatScope;
  prefix: string;
  includeYear: boolean;
  separator: string;
  sequenceLength: number;
  startingNumber: number;
  activeFrom: string;
  isActive: boolean;
  createdAt: string;
  updatedAt: string;
}

export interface NumberFormatPayload {
  scope: NumberFormatScope;
  prefix: string;
  includeYear?: boolean;
  separator?: string;
  sequenceLength?: number;
  startingNumber?: number;
  activeFrom?: string;
  isActive?: boolean;
}
