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:
Ahmed Bouhuolia
2020-08-27 20:39:55 +02:00
parent e23b8d9947
commit e4270dc039
63 changed files with 2567 additions and 462 deletions

View File

@@ -0,0 +1,13 @@
import { Request, Response } from 'express';
import { Container } from 'typedi';
export default async (req: Request, res: Response, next: Function) => {
const { organizationId, knex } = req;
if (!organizationId || !knex) {
throw new Error('Should load `TenancyMiddleware` before this middleware.');
}
Container.of(`tenant-${organizationId}`).set('knex', knex);
next();
};