feat: licenses administration basic authentication.

feat: accounts slug.
feat: duplicate accounts_balance table and merge balance with accounts table.
feat: refactoring customers and vendors.
feat: system user soft deleting.
feat: preventing build tenant database without any subscription.
feat: remove 'password' property from 'req.user' object.
feat: refactoring JournalPoster class.
feat: delete duplicated directories and files.
This commit is contained in:
Ahmed Bouhuolia
2020-09-09 21:30:19 +02:00
parent 98bba3d3a0
commit ad00f140d1
77 changed files with 2431 additions and 1848 deletions

View File

@@ -1,18 +1,18 @@
import NodeCache from 'node-cache';
class Cache {
export default class Cache {
cache: NodeCache;
constructor() {
constructor(config?: object) {
this.cache = new NodeCache({
// stdTTL: 9999999,
// checkperiod: 9999999 * 0.2,
useClones: false,
...config,
});
}
get(key, storeFunction) {
get(key: string, storeFunction: () => Promise<any>) {
const value = this.cache.get(key);
if (value) {
return Promise.resolve(value);
}
@@ -22,11 +22,11 @@ class Cache {
});
}
set(key, results) {
set(key: string, results: any) {
this.cache.set(key, results);
}
del(keys) {
del(keys: string) {
this.cache.del(keys);
}
@@ -46,7 +46,4 @@ class Cache {
flush() {
this.cache.flushAll();
}
}
export default new Cache();
}