UNPKG

@fin.cx/opendata

Version:

A comprehensive TypeScript library that manages open business data for German companies by integrating MongoDB, processing JSONL bulk data, and automating browser interactions for Handelsregister data retrieval.

68 lines (62 loc) 1.62 kB
import * as plugins from './plugins.js'; @plugins.smartdata.Manager() export class BusinessRecord extends plugins.smartdata.SmartDataDbDoc< BusinessRecord, BusinessRecord > { // STATIC public static getByGermanParsedRegistration = async (parsedGermanRegistrationArg: BusinessRecord['data']['germanParsedRegistration']) => { const businessRecords = await BusinessRecord.getInstance({ data: { germanParsedRegistration: parsedGermanRegistrationArg, } }); return businessRecords; }; // INSTANCE @plugins.smartdata.unI() id: string; @plugins.smartdata.svDb() data: { name?: string; startDate?: string; endDate?: string; status?: 'active' | 'liquidating' | 'closed'; address?: string; postalCode?: string; city?: string; country?: string; phone?: string; fax?: string; email?: string; website?: string; businessType?: string; registrationId?: string; germanParsedRegistration?: { court?: string; type?: 'HRA' | 'HRB' | 'GnR' | 'PR' | 'VR' | 'GsR'; number?: string; }; legalForm?: | 'GmbH' | 'GmbH & Co. KG' | 'AG' | 'LLC' | 'LLP' | 'GmbH & Co. KGaA' | 'GmbH & Co. KGaA, LLC'; managingDirectors?: string[]; boardOfDirectors?: string[]; supervisoryBoard?: string[]; foundingDate?: string; capital?: string; purpose?: string; lastUpdate?: string; } = {}; /** * validates the record against the Handelregister. */ public async validate() { if (!this.data.name) throw new Error('Name is required.'); } }