feat(falukant): enhance tax calculation and update messaging parameters
All checks were successful
Deploy to production / deploy (push) Successful in 2m52s
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:
@@ -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'] }] }]
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user