add server to monorepo.

This commit is contained in:
a.bouhuolia
2023-02-03 11:57:50 +02:00
parent 28e309981b
commit 80b97b5fdc
1303 changed files with 137049 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
import { upperFirst, camelCase } from 'lodash';
import {
CASHFLOW_TRANSACTION_TYPE,
CASHFLOW_TRANSACTION_TYPE_META,
ICashflowTransactionTypeMeta,
} from './constants';
/**
* Ensures the given transaction type to transformed to properiate format.
* @param {string} type
* @returns {string}
*/
export const transformCashflowTransactionType = (type) => {
return upperFirst(camelCase(type));
};
/**
* Retrieve the cashflow transaction type meta.
* @param {CASHFLOW_TRANSACTION_TYPE} transactionType
* @returns {ICashflowTransactionTypeMeta}
*/
export function getCashflowTransactionType(
transactionType: CASHFLOW_TRANSACTION_TYPE
): ICashflowTransactionTypeMeta {
return CASHFLOW_TRANSACTION_TYPE_META[transactionType];
}
/**
* Retrieve cashflow accounts transactions types
* @returns {string}
*/
export const getCashflowAccountTransactionsTypes = () => {
return Object.values(CASHFLOW_TRANSACTION_TYPE_META).map((meta) => meta.type);
};