feat(political-office): enhance political office benefits and salary computation
All checks were successful
Deploy to production / deploy (push) Successful in 3m6s
All checks were successful
Deploy to production / deploy (push) Successful in 3m6s
- Added a new hierarchyLevel field to PoliticalOfficeType for better categorization of political roles. - Updated computePoliticalDailySalaryPayout function to incorporate hierarchy level in salary calculations, allowing for more dynamic salary adjustments based on office rank. - Modified SQL scripts to reflect changes in political office benefits, ensuring compatibility with the new salary structure. - Enhanced localization files to support updated benefit descriptions and salary formats across multiple languages. - Improved UI components to display the new salary calculations and benefits accurately in the PoliticsView.
This commit is contained in:
@@ -335,7 +335,9 @@ export default {
|
||||
return this.$t('falukant.politics.benefits.tax_exemption', { regions: labels });
|
||||
}
|
||||
if (b.tr === 'daily_salary') {
|
||||
return this.$t('falukant.politics.benefits.daily_salary', { amount: b.params?.amount ?? '—' });
|
||||
return this.$t('falukant.politics.benefits.daily_salary', {
|
||||
amount: this.formatPoliticsMoney(b.params?.amount)
|
||||
});
|
||||
}
|
||||
if (b.tr === 'reputation_periodic') {
|
||||
return this.$t('falukant.politics.benefits.reputation_periodic', {
|
||||
@@ -586,6 +588,18 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
/** Geldbetrag wie in Familie/Bank (exakter Wert, kein „ca.“). */
|
||||
formatPoliticsMoney(value) {
|
||||
const n = Number(value);
|
||||
if (!Number.isFinite(n)) {
|
||||
return '—';
|
||||
}
|
||||
return new Intl.NumberFormat(this.$i18n.locale, {
|
||||
minimumFractionDigits: 2,
|
||||
maximumFractionDigits: 2
|
||||
}).format(n);
|
||||
},
|
||||
|
||||
async loadOwnCharacterId() {
|
||||
try {
|
||||
const { data } = await apiClient.get('/api/falukant/info');
|
||||
|
||||
Reference in New Issue
Block a user