fix: system repositories.

This commit is contained in:
a.bouhuolia
2020-12-17 17:19:16 +02:00
parent 7a847fc895
commit a67b1fbdd0
54 changed files with 1452 additions and 983 deletions

View File

@@ -2,6 +2,7 @@
// Here we import all events.
import 'subscribers/authentication';
import 'subscribers/organization';
import 'subscribers/inviteUser';
import 'subscribers/manualJournals';
import 'subscribers/expenses';
import 'subscribers/bills';

View File

@@ -21,10 +21,8 @@ export default async ({ expressApp }) => {
objectionLoader({ knex });
// It returns the agenda instance because it's needed in the subsequent loaders
const { agenda } = await dependencyInjectorLoader({
mongoConnection,
knex,
});
const { agenda } = await dependencyInjectorLoader({ mongoConnection, knex });
await jobsLoader({ agenda });
Logger.info('[init] Jobs loaded');

View File

@@ -6,9 +6,12 @@ import {
} from 'system/repositories';
export default () => {
const knex = Container.get('knex');
const cache = Container.get('cache');
return {
systemUserRepository: Container.get(SystemUserRepository),
subscriptionRepository: Container.get(SubscriptionRepository),
tenantRepository: Container.get(TenantRepository),
systemUserRepository: new SystemUserRepository(knex, cache),
subscriptionRepository: new SubscriptionRepository(knex, cache),
tenantRepository: new TenantRepository(knex, cache),
};
}