feat(election): committee management — CRUD, members, image, and director fix

- Add Committee entity, CommitteeMember, repositories, service, and REST API
- Liquibase migrations: 0349 committee tables, 0350 committee image column
- Committee supports profile image (base64 TEXT), name, description, status
- Current directors: fix EclipseLink native query (?1 positional param) and add
  fallback to most recent RESULT_DECLARED election when no active duration found
- DirectorAppointmentRepository: add findByElectionIdAndStatus (non-pageable)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jaanu423
2026-07-03 16:39:42 +05:30
co-authored by Claude Sonnet 4.6
parent 00d3a2e333
commit 2606427203
16 changed files with 539 additions and 2 deletions
@@ -376,4 +376,6 @@
<include file="parts/0346_election_audit_log_description_to_text.xml" relativeToChangelogFile="true"/>
<include file="parts/0347_election_director_appointment.xml" relativeToChangelogFile="true"/>
<include file="parts/0348_election_config_duration_years.xml" relativeToChangelogFile="true"/>
<include file="parts/0349_election_committee.xml" relativeToChangelogFile="true"/>
<include file="parts/0350_committee_image.xml" relativeToChangelogFile="true"/>
</databaseChangeLog>
@@ -0,0 +1,67 @@
<?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="0349-election-committee" author="CBS">
<preConditions onFail="MARK_RAN">
<not><tableExists tableName="m_election_committee"/></not>
</preConditions>
<createTable tableName="m_election_committee">
<column name="id" type="BIGSERIAL" autoIncrement="true">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="name" type="VARCHAR(200)">
<constraints nullable="false"/>
</column>
<column name="description" type="TEXT"/>
<column name="status" type="VARCHAR(30)" defaultValue="ACTIVE">
<constraints nullable="false"/>
</column>
<column name="created_by" type="BIGINT">
<constraints nullable="false"/>
</column>
<column name="created_on_utc" type="TIMESTAMP WITH TIME ZONE">
<constraints nullable="false"/>
</column>
<column name="last_modified_by" type="BIGINT">
<constraints nullable="false"/>
</column>
<column name="last_modified_on_utc" type="TIMESTAMP WITH TIME ZONE">
<constraints nullable="false"/>
</column>
</createTable>
<createTable tableName="m_election_committee_member">
<column name="id" type="BIGSERIAL" autoIncrement="true">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="committee_id" type="BIGINT">
<constraints nullable="false"
foreignKeyName="fk_committee_member_committee"
references="m_election_committee(id)"/>
</column>
<column name="director_appointment_id" type="BIGINT">
<constraints nullable="false"
foreignKeyName="fk_committee_member_director"
references="m_election_director_appointment(id)"/>
</column>
<column name="added_date" type="DATE" defaultValueComputed="CURRENT_DATE">
<constraints nullable="false"/>
</column>
</createTable>
<createIndex indexName="idx_committee_member_committee"
tableName="m_election_committee_member">
<column name="committee_id"/>
</createIndex>
<createIndex indexName="idx_committee_status"
tableName="m_election_committee">
<column name="status"/>
</createIndex>
</changeSet>
</databaseChangeLog>
@@ -0,0 +1,16 @@
<?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="0350-committee-image" author="CBS">
<preConditions onFail="MARK_RAN">
<not><columnExists tableName="m_election_committee" columnName="image"/></not>
</preConditions>
<addColumn tableName="m_election_committee">
<column name="image" type="TEXT"/>
</addColumn>
</changeSet>
</databaseChangeLog>