WIP: transactions by customers report.

This commit is contained in:
a.bouhuolia
2021-05-06 03:10:14 +02:00
parent 97d12d4294
commit c57f2de970
6 changed files with 288 additions and 31 deletions

View File

@@ -71,8 +71,7 @@ export default class FinancialStatementsService {
router.use(
'/transactions-by-customers',
Container.get(TransactionsByCustomers).router(),
)
);
return router;
}
}

View File

@@ -4,11 +4,15 @@ import { Inject } from 'typedi';
import asyncMiddleware from 'api/middleware/asyncMiddleware';
import BaseFinancialReportController from '../BaseFinancialReportController';
import TransactionsByCustomersService from 'services/FinancialStatements/TransactionsByCustomer/TransactionsByCustomersService';
import TransactionsByCustomersTableRows from 'services/FinancialStatements/TransactionsByCustomer/TransactionsByCustomersTableRows';
export default class TransactionsByCustomersReportController extends BaseFinancialReportController {
@Inject()
transactionsByCustomersService: TransactionsByCustomersService;
@Inject()
transactionsByCustomersTableRows: TransactionsByCustomersTableRows;
/**
* Router constructor.
*/
@@ -60,6 +64,12 @@ export default class TransactionsByCustomersReportController extends BaseFinanci
filter
);
return res.status(200).send({
table: {
rows: this.transactionsByCustomersTableRows.tableRows(data),
},
});
return res.status(200).send({
data: this.transfromToResponse(data),
columns: this.transfromToResponse(columns),