fix(core): Fix issues with JSONL data processing and improve error handling in business record validation
This commit is contained in:
@@ -11,6 +11,9 @@ export class BusinessRecord extends plugins.smartdata.SmartDataDbDoc<
|
||||
@plugins.smartdata.svDb()
|
||||
data: {
|
||||
name?: string;
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
status?: 'active' | 'liquidating' | 'closed';
|
||||
address?: string;
|
||||
postalCode?: string;
|
||||
city?: string;
|
||||
@@ -42,4 +45,11 @@ export class BusinessRecord extends plugins.smartdata.SmartDataDbDoc<
|
||||
purpose?: string;
|
||||
lastUpdate?: string;
|
||||
} = {};
|
||||
|
||||
/**
|
||||
* validates the record against the Handelregister.
|
||||
*/
|
||||
public async validate() {
|
||||
if (!this.data.name) throw new Error('Name is required.');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user