mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: Payment system with voucher cards.
feat: Design with inversion dependency injection architecture. feat: Prettier http middleware. feat: Re-write items categories with preferred accounts.
This commit is contained in:
@@ -1,17 +1,25 @@
|
||||
import { Container } from 'typedi';
|
||||
import LoggerInstance from '@/services/Logger';
|
||||
import agendaFactory from '@/loaders/agenda';
|
||||
import SmsClientLoader from '@/loaders/smsClient';
|
||||
|
||||
export default ({ mongoConnection, knex }) => {
|
||||
try {;
|
||||
try {
|
||||
const agendaInstance = agendaFactory({ mongoConnection });
|
||||
const smsClientInstance = SmsClientLoader();
|
||||
|
||||
Container.set('agenda', agendaInstance);
|
||||
Container.set('logger', LoggerInstance)
|
||||
Container.set('knex', knex);
|
||||
|
||||
LoggerInstance.info('Agenda has been injected into container');
|
||||
|
||||
Container.set('logger', LoggerInstance)
|
||||
LoggerInstance.info('Logger instance has been injected into container');
|
||||
|
||||
Container.set('knex', knex);
|
||||
LoggerInstance.info('Knex instance has been injected into container');
|
||||
|
||||
Container.set('SMSClient', smsClientInstance);
|
||||
LoggerInstance.info('SMS client has been injected into container');
|
||||
|
||||
return { agenda: agendaInstance };
|
||||
} catch (e) {
|
||||
LoggerInstance.error('Error on dependency injector loader: %o', e);
|
||||
|
||||
Reference in New Issue
Block a user