feat(election): comprehensive audit log — rich details for all actions

- Fixed VARCHAR(500) overflow: description column changed to TEXT (Liquibase 0346)
- Fixed CEO pre-check 500 error: fm.firstname/lastname column name fix
- Fixed audit log showing wrong PASS/FAIL for CEO pre-check
- Fixed approval action not showing step name/number (read PENDING step before action)
- submitNomination: details JSON with applicantName, memberId, postId, gender, caste
- runEligibilityCheck: details JSON with all 5 check results + remarks
- runCeoPreCheck: details JSON with all 7 individual check results + remarks
- processApprovalStep: details JSON with action, stepName, stepNumber, remarks, rejectionReason
- activateElection/closeNominations/openVoting/closeVoting/cancelElection: details with electionTitle + newStatus
- updateElection: full request JSON via ObjectMapper
- approveCandidate: details with nominationId + applicantName
- updateCandidate: details with symbolUpdated, profileUpdated, briefProfile
- uploadCandidateSymbol: details with filename + mimeType
- declareResults: winner summary JSON array [{post, winner, votes}]
- saveManualVoteCounts: return type changed void→String, details JSON array with candidate vote data
- Added Liquibase migrations: 0344, 0345 for manual vote count, 0346 for TEXT column

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jaanu423
2026-07-01 14:59:23 +05:30
co-authored by Claude Sonnet 4.6
parent 99a89d5d81
commit 99cc972804
22 changed files with 586 additions and 106 deletions
@@ -371,4 +371,7 @@
<include file="parts/0341_election_audit_log.xml" relativeToChangelogFile="true"/>
<include file="parts/0342_election_post_add_eligibility_columns.xml" relativeToChangelogFile="true"/>
<include file="parts/0343_client_sub_caste_column.xml" relativeToChangelogFile="true"/>
<include file="parts/0344_election_candidate_manual_vote_count.xml" relativeToChangelogFile="true"/>
<include file="parts/0345_election_candidate_manual_vote_count_drop_default.xml" relativeToChangelogFile="true"/>
<include file="parts/0346_election_audit_log_description_to_text.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">
<changeSet id="0344_election_candidate_add_manual_vote_count" author="CBS">
<preConditions onFail="MARK_RAN">
<not><columnExists tableName="m_election_candidate" columnName="manual_vote_count"/></not>
</preConditions>
<addColumn tableName="m_election_candidate">
<column name="manual_vote_count" type="INT">
<constraints nullable="true"/>
</column>
</addColumn>
</changeSet>
</databaseChangeLog>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">
<changeSet id="0345_election_candidate_manual_vote_count_drop_default" author="CBS">
<preConditions onFail="MARK_RAN">
<columnExists tableName="m_election_candidate" columnName="manual_vote_count"/>
</preConditions>
<sql>ALTER TABLE m_election_candidate ALTER COLUMN manual_vote_count DROP DEFAULT;</sql>
</changeSet>
</databaseChangeLog>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">
<changeSet id="0346_election_audit_log_description_to_text" author="CBS">
<preConditions onFail="MARK_RAN">
<columnExists tableName="m_election_audit_log" columnName="description"/>
</preConditions>
<sql>ALTER TABLE m_election_audit_log ALTER COLUMN description TYPE TEXT;</sql>
</changeSet>
</databaseChangeLog>