feat(falukant): enhance tax calculation and update messaging parameters
All checks were successful
Deploy to production / deploy (push) Successful in 2m52s

- Updated the tax calculation logic in FalukantService to include character-based checks for political offices, improving accuracy in tax assessments.
- Enhanced the MessagesDialog component to incorporate additional parameters such as satisfaction, threshold_percent, director_id, and director_character_id, providing more detailed notifications.
- Added new localization entries for director resignation risk notifications in multiple languages, ensuring users receive clear and contextual information regarding director dynamics.
This commit is contained in:
Torsten Schulz (local)
2026-04-13 15:58:30 +02:00
parent 86e14a875d
commit f92b62e55b
9 changed files with 215 additions and 1 deletions

View File

@@ -326,9 +326,16 @@ async function calcRegionalSellPrice(product, knowledgeFactor, regionId, worthPe
async function getCumulativeTaxPercentWithExemptions(userId, regionId) {
if (!regionId) return 0;
if (await hasTitleTaxExempt(userId)) return 0;
const character = await FalukantCharacter.findOne({
where: { userId },
attributes: ['id']
});
if (!character?.id) {
return await getCumulativeTaxPercent(regionId);
}
// fetch user's political offices (active) and their region types
const offices = await PoliticalOffice.findAll({
where: { userId },
where: { characterId: character.id },
include: [{ model: PoliticalOfficeType, as: 'type', attributes: ['name'] }, { model: RegionData, as: 'region', include: [{ model: RegionType, as: 'regionType', attributes: ['labelTr'] }] }]
});