feat(webapp): invoice tax rate

This commit is contained in:
Ahmed Bouhuolia
2023-09-11 23:17:27 +02:00
parent 6abae43c6f
commit b98b73ad98
21 changed files with 615 additions and 126 deletions

View File

@@ -0,0 +1,22 @@
// @ts-nocheck
import { useRequestQuery } from '../useQueryRequest';
import QUERY_TYPES from './types';
/**
* Retrieves tax rates.
* @param {number} customerId - Customer id.
*/
export function useTaxRates(props) {
return useRequestQuery(
[QUERY_TYPES.TAX_RATES],
{
method: 'get',
url: `tax-rates`,
},
{
select: (res) => res.data.data,
defaultData: [],
...props,
},
);
}

View File

@@ -224,6 +224,10 @@ const ORGANIZATION = {
ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES: 'ORGANIZATION_MUTATE_BASE_CURRENCY_ABILITIES',
};
export const TAX_RATES = {
TAX_RATES: 'TAX_RATES',
}
export default {
...Authentication,
...ACCOUNTS,
@@ -257,4 +261,5 @@ export default {
...BRANCHES,
...DASHBOARD,
...ORGANIZATION,
...TAX_RATES
};