feat(politics): implement reconcilePoliticalVacancies endpoint and UI integration for managing political vacancies
This commit is contained in:
@@ -7125,14 +7125,12 @@ class FalukantService extends BaseService {
|
||||
}
|
||||
]
|
||||
});
|
||||
const titleId = character.titleOfNobility ?? character.nobleTitle?.id;
|
||||
const allowedOfficeNames = await getAllowedOfficeTypeNamesByTitle(titleId);
|
||||
const result = openPositions
|
||||
.filter(election => {
|
||||
if (allowedOfficeNames.size > 0 && !allowedOfficeNames.has(election.officeType?.name)) return false;
|
||||
return true;
|
||||
})
|
||||
.filter(election => {
|
||||
// Die verbindlichen Zugangsvoraussetzungen stehen bei dem Amt
|
||||
// selbst (political_office_prerequisite). Die zusätzlich
|
||||
// gepflegten Titel-Benefits waren unvollständig und haben
|
||||
// gültige Ausschreibungen (z. B. councillor) verborgen.
|
||||
const prereqs = election.officeType.prerequisites || [];
|
||||
// Wenn es keine Voraussetzungen gibt, ist die Position grundsätzlich wählbar.
|
||||
if (!Array.isArray(prereqs) || prereqs.length === 0) return true;
|
||||
|
||||
Reference in New Issue
Block a user