feat: dynamic tax thresholds from backend (#5342)
* feat: dynamic tax thresholds from backend * fix: lint & i18n
This commit is contained in:
@@ -41,6 +41,7 @@ export class LabrinthStateModule extends AbstractModule {
|
||||
muralBankDetails,
|
||||
iso3166Data,
|
||||
payoutMethods,
|
||||
globals,
|
||||
] = await Promise.all([
|
||||
// Tag endpoints
|
||||
this.client
|
||||
@@ -126,6 +127,15 @@ export class LabrinthStateModule extends AbstractModule {
|
||||
method: 'GET',
|
||||
})
|
||||
.catch((err) => handleError(err, [], '/v3/payout/methods')),
|
||||
|
||||
// Global configuration
|
||||
this.client
|
||||
.request<{ tax_compliance_thresholds: Record<string, number> }>('/globals', {
|
||||
api: 'labrinth',
|
||||
version: 'internal',
|
||||
method: 'GET',
|
||||
})
|
||||
.catch((err) => handleError(err, null, '/_internal/globals')),
|
||||
])
|
||||
|
||||
const tremendousIdMap = Object.fromEntries(
|
||||
@@ -148,6 +158,7 @@ export class LabrinthStateModule extends AbstractModule {
|
||||
tremendousIdMap,
|
||||
countries: iso3166Data.countries,
|
||||
subdivisions: iso3166Data.subdivisions,
|
||||
taxComplianceThresholds: globals?.tax_compliance_thresholds,
|
||||
errors,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -782,6 +782,8 @@ export namespace Labrinth {
|
||||
countries: ISO3166.Country[]
|
||||
subdivisions: Record<string, ISO3166.Subdivision[]>
|
||||
|
||||
taxComplianceThresholds?: Record<string, number>
|
||||
|
||||
errors: unknown[]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user