import type { DaDataSuggestion, Nullable } from '../../core-types'; import type { DaDataAddress } from '../address/address-types'; export type DaDataPartyType = 'LEGAL' | 'INDIVIDUAL'; export type DaDataPartyStatus = 'ACTIVE' | 'LIQUIDATING' | 'LIQUIDATED' | 'REORGANIZING' | 'BANKRUPT'; export type DaDataPartyBranchType = 'MAIN' | 'BRANCH'; /** * @see https://dadata.ru/api/suggest/party/#response */ interface DaDataPartyAddress extends Omit { qc: '0' | '1' | '3'; house_cadnum: Nullable; floor: Nullable; flat_price: Nullable; } export interface DaDataPartyRussiaFio { name: string; patronymic: string; surname: string; gender: null; qc: null; source: null; } export interface DaDataParty { inn: string; kpp: string; ogrn: string; ogrn_date: number; hid: string; capital: Nullable; type: DaDataPartyType; fio?: DaDataPartyRussiaFio; name: { full_with_opf: string; short_with_opf: string; latin: Nullable; full: string; short: string; }; okpo: Nullable; okato: Nullable; oktmo: Nullable; okogu: Nullable; okfs: Nullable; okved: string; okved_type: string; okveds: Nullable; authorities: null; documents: null; licenses: null; phones: null; emails: null; employee_count: Nullable; finance: Nullable<{ tax_system: Nullable; income: Nullable; expense: Nullable; debt: Nullable; penalty: Nullable; year: Nullable; }>; opf: { code: string; type: string; full: string; short: string; }; management?: Nullable<{ name: string; post: string; disqualified: Nullable; }>; founders: Nullable; managers: Nullable; predecessors: Nullable; successors: Nullable; branch_count?: number; branch_type?: DaDataPartyBranchType; address: DaDataSuggestion; state: { actuality_date: number; registration_date: number; liquidation_date: Nullable; status: DaDataPartyStatus; code: Nullable; }; source: null; qc: null; } export type DaDataPartySuggestion = DaDataSuggestion; /** * Алиасы для типов по организациям в России 🇷🇺 для консистентности с другими странами */ export type DaDataPartyRussiaStatus = DaDataPartyStatus; export type DaDataPartyRussiaType = DaDataPartyType; export type DaDataPartyRussia = DaDataParty; export type DaDataPartyRussiaSuggestion = DaDataSuggestion; export {};