This commit is contained in:
2024-09-29 13:56:38 +02:00
commit 31a6ef96d8
85 changed files with 13360 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import * as plugins from './plugins.js';
import { Reception } from './classes.reception.js';
export class ReceptionDb {
public smartdataDb: plugins.smartdata.SmartdataDb;
public receptionRef: Reception;
constructor(receptionRefArg: Reception) {
this.receptionRef = receptionRefArg;
}
public async start(databaseNameArg?: string) {
this.smartdataDb = new plugins.smartdata.SmartdataDb({
mongoDbUser: await this.receptionRef.serviceQenv.getEnvVarOnDemand('MONGO_DB_USER'),
mongoDbName: databaseNameArg || await this.receptionRef.serviceQenv.getEnvVarOnDemand('MONGO_DB_NAME'),
mongoDbPass: await this.receptionRef.serviceQenv.getEnvVarOnDemand('MONGO_DB_PASS'),
mongoDbUrl: await this.receptionRef.serviceQenv.getEnvVarOnDemand('MONGO_DB_URL'),
});
await this.smartdataDb.init();
}
public async stop() {
await this.smartdataDb.close();
}
}