feat(political-benefits): implement political powers and benefits system
All checks were successful
Deploy to production / deploy (push) Successful in 3m3s
All checks were successful
Deploy to production / deploy (push) Successful in 3m3s
- Added new political powers and benefits functionalities, including reputation ticks, tax jurisdiction management, and appointment capabilities. - Introduced a new job for periodic reputation updates and created necessary database tables for tracking political benefits. - Enhanced the FalukantController and services to support new endpoints for managing political powers and appointments. - Updated localization files to reflect new features and improve user experience across multiple languages. - Modified the UI to display new political powers and benefits, ensuring accurate representation in the PoliticsView.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import FalukantService from '../services/falukantService.js';
|
||||
import politicalPowersService from '../services/falukantPoliticalPowersService.js';
|
||||
|
||||
function extractHashedUserId(req) {
|
||||
return req.headers?.userid;
|
||||
@@ -212,6 +213,23 @@ class FalukantController {
|
||||
this.vote = this._wrapWithUser((userId, req) => this.service.vote(userId, req.body.votes), { blockInDebtorsPrison: true });
|
||||
this.applyForElections = this._wrapWithUser((userId, req) => this.service.applyForElections(userId, req.body.electionIds), { blockInDebtorsPrison: true });
|
||||
|
||||
this.getPoliticalMyPowers = this._wrapWithUser((userId) => politicalPowersService.getMyPowers(userId));
|
||||
this.getPoliticalTaxJurisdiction = this._wrapWithUser((userId) => politicalPowersService.getTaxJurisdiction(userId));
|
||||
this.setPoliticalRegionTax = this._wrapWithUser((userId, req) =>
|
||||
politicalPowersService.setRegionTax(userId, parseInt(req.params.regionId, 10), req.body?.percent), { blockInDebtorsPrison: true });
|
||||
this.getPoliticalRegionTaxHistory = this._wrapWithUser((userId, req) =>
|
||||
politicalPowersService.getRegionTaxHistory(userId, parseInt(req.params.regionId, 10), parseInt(req.query.limit || '5', 10)));
|
||||
this.getPoliticalAppointableOffices = this._wrapWithUser((userId) => politicalPowersService.getAppointableOffices(userId));
|
||||
this.createPoliticalAppointment = this._wrapWithUser(
|
||||
(userId, req) =>
|
||||
politicalPowersService.createAppointment(userId, {
|
||||
targetCharacterId: req.body?.targetCharacterId,
|
||||
officeTypeId: req.body?.officeTypeId,
|
||||
regionId: req.body?.regionId
|
||||
}),
|
||||
{ successStatus: 201, blockInDebtorsPrison: true }
|
||||
);
|
||||
|
||||
this.getRegions = this._wrapWithUser((userId) => this.service.getRegions(userId));
|
||||
this.getBranchTaxes = this._wrapWithUser((userId, req) => this.service.getBranchTaxes(userId, req.params.branchId));
|
||||
this.getProductPriceInRegion = this._wrapWithUser((userId, req) => {
|
||||
|
||||
Reference in New Issue
Block a user