@fin.cx/opendata
Version:
A comprehensive TypeScript library for accessing business data and real-time financial information. Features include German company data management with MongoDB integration, JSONL bulk processing, automated Handelsregister interactions, and real-time stoc
68 lines (62 loc) • 1.62 kB
text/typescript
import * as plugins from './plugins.js';
.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
.smartdata.unI()
id: string;
.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.');
}
}