mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
refactoring: balance sheet report.
refactoring: trial balance sheet report. refactoring: general ledger report. refactoring: journal report. refactoring: P&L report.
This commit is contained in:
19
server/src/repositories/CachableRepository.ts
Normal file
19
server/src/repositories/CachableRepository.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import hashObject from 'object-hash';
|
||||
|
||||
|
||||
export default class CachableRepository {
|
||||
repositoryName: string;
|
||||
|
||||
/**
|
||||
* Retrieve the cache key of the method name and arguments.
|
||||
* @param {string} method
|
||||
* @param {...any} args
|
||||
* @return {string}
|
||||
*/
|
||||
getCacheKey(method, ...args) {
|
||||
const hashArgs = hashObject({ ...args });
|
||||
const repositoryName = this.repositoryName;
|
||||
|
||||
return `${repositoryName}-${method}-${hashArgs}`;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user