🎯 Objective
Create a database view that aggregates decision flow data by political party from DOCUMENT_PROPOSAL_DATA, enabling analysis of party-level proposal success rates, decision patterns, and legislative effectiveness.
📋 Background
The current DecisionDataFactoryImpl processes individual proposal decisions, but lacks aggregated party-level intelligence. This view will support:
- Party decision effectiveness tracking
- Coalition alignment on proposals
- Ministry proposal success rates by party
- Temporal decision trends by party
Context from Documentation:
📊 Current State
- ✅ DecisionDataFactoryImpl processes DOCUMENT_PROPOSAL_DATA
- ❌ No database view for party-level decision aggregation
- ❌ No KPIs for party decision effectiveness
- ❌ No temporal trend analysis for party decisions
✅ Acceptance Criteria
🛠️ Implementation Guidance
Files to Create/Modify:
service.data.impl/src/main/resources/db-changelog-1.35.xml (NEW)
<changeSet id="create_view_riksdagen_party_decision_flow" author="intelligence-operative">
<createView viewName="view_riksdagen_party_decision_flow" replaceIfExists="true">
<![CDATA[
SELECT
party,
committee,
decision_type,
DATE_TRUNC('month', decision_date) AS decision_month,
EXTRACT(YEAR FROM decision_date) AS decision_year,
COUNT(*) AS total_proposals,
COUNT(*) FILTER (WHERE decision_outcome = 'approved') AS approved_proposals,
COUNT(*) FILTER (WHERE decision_outcome = 'rejected') AS rejected_proposals,
ROUND(100.0 * COUNT(*) FILTER (WHERE decision_outcome = 'approved') / COUNT(*), 2) AS approval_rate
FROM document_proposal_data dpd
JOIN document_status_container dsc ON dsc.id = dpd.document_status_id
JOIN document_data dd ON dd.id = dsc.document_id
GROUP BY party, committee, decision_type, decision_month, decision_year
]]>
</createView>
</changeSet>
DATABASE_VIEW_INTELLIGENCE_CATALOG.md - Add documentation
- Section: "Decision Flow Views (NEW in v1.35)"
- Include purpose, key metrics, sample queries, intelligence applications
Approach:
- Analyze
document_proposal_data table schema
- Join with
document_status_container and document_data for party information
- Create aggregation logic for decision outcomes
- Test query performance with realistic data volumes
- Add materialized view option for performance if needed
Sample Query for Testing:
SELECT party, decision_year,
total_proposals, approved_proposals,
approval_rate
FROM view_riksdagen_party_decision_flow
WHERE decision_year >= 2023
ORDER BY approval_rate DESC;
🤖 Recommended Agent
Agent: @hack23-intelligence-operative
Rationale: This issue requires deep understanding of Swedish parliamentary decision processes, OSINT data analysis methodologies, and political intelligence product development.
For implementation, the Intelligence Operative will:
- Analyze DOCUMENT_PROPOSAL_DATA structure for decision flow patterns
- Design SQL view with political science best practices
- Integrate with existing party intelligence views
- Document intelligence applications for decision analysis
- Ensure data quality and accuracy for political analysis
📚 Related Documentation
🏷️ Labels
feature, database, intelligence, decision-flow, osint
📊 Intelligence Value
⭐⭐⭐⭐⭐ VERY HIGH - Enables party-level decision pattern analysis, coalition dynamics assessment, and legislative effectiveness tracking.
🎯 Objective
Create a database view that aggregates decision flow data by political party from DOCUMENT_PROPOSAL_DATA, enabling analysis of party-level proposal success rates, decision patterns, and legislative effectiveness.
📋 Background
The current
DecisionDataFactoryImplprocesses individual proposal decisions, but lacks aggregated party-level intelligence. This view will support:Context from Documentation:
📊 Current State
✅ Acceptance Criteria
view_riksdagen_party_decision_flowdatabase viewdb-changelog-1.35.xml🛠️ Implementation Guidance
Files to Create/Modify:
service.data.impl/src/main/resources/db-changelog-1.35.xml(NEW)DATABASE_VIEW_INTELLIGENCE_CATALOG.md- Add documentationApproach:
document_proposal_datatable schemadocument_status_containeranddocument_datafor party informationSample Query for Testing:
🤖 Recommended Agent
Agent: @hack23-intelligence-operative
Rationale: This issue requires deep understanding of Swedish parliamentary decision processes, OSINT data analysis methodologies, and political intelligence product development.
For implementation, the Intelligence Operative will:
📚 Related Documentation
🏷️ Labels
feature,database,intelligence,decision-flow,osint📊 Intelligence Value
⭐⭐⭐⭐⭐ VERY HIGH - Enables party-level decision pattern analysis, coalition dynamics assessment, and legislative effectiveness tracking.