feat: code review notes

This commit is contained in:
Ahmed Bouhuolia
2024-02-21 17:17:34 +02:00
parent d16ec7cda9
commit 1752c32eec
30 changed files with 43 additions and 42 deletions

View File

@@ -31,7 +31,6 @@ export const BalanceSheetNetIncome = (Base: any) =>
/**
* Retrieves the closing balance of income accounts.
* @returns {number}
*
*/
private getIncomeTotal = () => {
const closeingBalance = this.repository.incomeLedger.getClosingBalance();

View File

@@ -41,13 +41,14 @@ export default class BalanceSheetTable extends R.compose(
BalanceSheetBase
)(FinancialSheet) {
/**
* @param {}
* Balance sheet data.
* @param {IBalanceSheetStatementData}
*/
private reportData: IBalanceSheetStatementData;
/**
* Balance sheet query.
* @parma {}
* @parma {BalanceSheetQuery}
*/
private query: BalanceSheetQuery;

View File

@@ -61,14 +61,14 @@ export const FinancialSheetStructure = (Base: Class) =>
});
};
findNodeDeep = (nodes, callback) => {
public findNodeDeep = (nodes, callback) => {
return findValueDeep(nodes, callback, {
childrenPath: 'children',
pathFormat: 'array',
});
};
mapAccNodesDeep = (nodes, callback) => {
public mapAccNodesDeep = (nodes, callback) => {
return reduceDeep(
nodes,
(acc, value, key, parentValue, context) => {
@@ -97,11 +97,11 @@ export const FinancialSheetStructure = (Base: Class) =>
});
};
getTotalOfChildrenNodes = (node) => {
public getTotalOfChildrenNodes = (node) => {
return this.getTotalOfNodes(node.children);
};
getTotalOfNodes = (nodes) => {
public getTotalOfNodes = (nodes) => {
return sumBy(nodes, 'total.amount');
};
};

View File

@@ -40,11 +40,4 @@ export class ProfitLossSheetExportInjectable {
return tableCsv;
}
public async pdf(
tenantId: number,
query: IProfitLossSheetQuery
): Promise<Buffer> {
const table = await this.profitLossSheetTable.table(tenantId, query);
}
}

View File

@@ -52,6 +52,7 @@ export class TableSheetPdf {
landscape,
});
}
/**
* Converts the table columns to pdf columns.
* @param {ITableColumn[]} columns