Skip to content

Conversation

@brianbrix
Copy link
Contributor

No description provided.

@brianbrix brianbrix changed the title AMP-31026: Output / outcome manager AMP-31027: List/View Existing Outcomes and Outputs AMP-31028:Add New Outcome AMP-31029:Add New Output AMP-31022 Indicators module changes Aug 21, 2025
@brianbrix brianbrix requested a review from jdeanquin-dg August 28, 2025 17:36
@jdeanquin-dg jdeanquin-dg requested a review from Copilot September 1, 2025 14:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements comprehensive enhancements to the AMP Indicators module, adding support for new indicator fields, outcome/output management, and improved UI. The changes introduce additional categorization capabilities and a management interface for outcomes and outputs.

Key changes include:

  • Addition of new indicator fields (outcome, output, type, disaggregation, unit of measure, etc.)
  • Implementation of outcome and output management with CRUD operations
  • Enhanced UI with improved filtering, search, and visual organization
  • Database schema updates with new entities and Hibernate mappings

Reviewed Changes

Copilot reviewed 41 out of 41 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
Java entity classes Added AmpOutcome and AmpOutput entities with bidirectional relationships
Hibernate mappings New mapping files for outcome/output entities and updated indicator mappings
Service classes New service for outcome/output CRUD operations and updated indicator service
Database patches SQL script to create indicator category values
Frontend components New React pages for outcome/output management with improved UI
API endpoints New REST endpoints for outcome/output operations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


public List<AmpOutputDTO> getOutputsByOutcomeId(Long outcomeId) {
Session session = PersistenceManager.getSession();
AmpOutcome outcome = (AmpOutcome) session.get(AmpOutcome.class, outcomeId);
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary explicit casting. The session.get() method with a Class parameter already returns the correct type. Remove the explicit cast: AmpOutcome outcome = session.get(AmpOutcome.class, outcomeId);

Suggested change
AmpOutcome outcome = (AmpOutcome) session.get(AmpOutcome.class, outcomeId);
AmpOutcome outcome = session.get(AmpOutcome.class, outcomeId);

Copilot uses AI. Check for mistakes.

public void deleteOutcome(Long outcomeId) {
Session session = PersistenceManager.getSession();
AmpOutcome outcome = (AmpOutcome) session.get(AmpOutcome.class, outcomeId);
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same unnecessary explicit casting as above. Remove the cast: AmpOutcome outcome = session.get(AmpOutcome.class, outcomeId);

Suggested change
AmpOutcome outcome = (AmpOutcome) session.get(AmpOutcome.class, outcomeId);
AmpOutcome outcome = session.get(AmpOutcome.class, outcomeId);

Copilot uses AI. Check for mistakes.
@@ -1,2 +1,2 @@
export const TRN_PREFIX = 'amp.inidcatormanager.dashboard:';
export const TRN_PREFIX_DASHBOARD = 'amp.inidcatormanager.dashboard:';
export const TRN_PREFIX = 'amp.indicatormanager.dashboard:';
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Fixed typo in constant name from 'inidcator' to 'indicator', but consider if TRN_PREFIX and TRN_PREFIX_DASHBOARD should have different values since they're now identical.

Suggested change
export const TRN_PREFIX = 'amp.indicatormanager.dashboard:';
export const TRN_PREFIX = 'amp.indicatormanager:';

Copilot uses AI. Check for mistakes.
},
csvFormatter: (_cell: any, row: any) => {
if (outcomesReducer.loading) return '';
const foundOutcome = !outcomesReducer.loading && outcomesReducer.programs.find((outcome: any) => outcome.id === row.outcomeId);
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect property access. Should be outcomesReducer.outcomes instead of outcomesReducer.programs to find outcomes correctly.

Suggested change
const foundOutcome = !outcomesReducer.loading && outcomesReducer.programs.find((outcome: any) => outcome.id === row.outcomeId);
const foundOutcome = !outcomesReducer.loading && outcomesReducer.outcomes.find((outcome: any) => outcome.id === row.outcomeId);

Copilot uses AI. Check for mistakes.
calculationMethod: values.calculationMethod,
responsibleOrganizations: values.responsibleOrganizations,
frequency: values.frequency,
programId: values.programId ? values.programId: null,
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Missing space after colon. Should be values.programId ? values.programId : null for consistent formatting.

Suggested change
programId: values.programId ? values.programId: null,
programId: values.programId ? values.programId : null,

Copilot uses AI. Check for mistakes.
.collect(Collectors.toSet());
indicator.setResponsibleOrganizations(orgs);
} else {
indicator.setResponsibleOrganizations(new java.util.HashSet<>());
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Use the already imported HashSet class instead of the fully qualified name: new HashSet<>()

Suggested change
indicator.setResponsibleOrganizations(new java.util.HashSet<>());
indicator.setResponsibleOrganizations(new HashSet<>());

Copilot uses AI. Check for mistakes.
.collect(Collectors.toSet());
indicator.setResponsibleOrganizations(orgs);
} else {
indicator.setResponsibleOrganizations(new java.util.HashSet<>());
Copy link

Copilot AI Sep 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Same issue as above - use the imported HashSet class: new HashSet<>()

Suggested change
indicator.setResponsibleOrganizations(new java.util.HashSet<>());
indicator.setResponsibleOrganizations(new HashSet<>());

Copilot uses AI. Check for mistakes.
AMP-31027: List/View Existing Outcomes and Outputs
AMP-31028:Add New Outcome
AMP-31029:Add New Output
AMP-31044: break down target and original value by dissagregation
@jdeanquin-dg jdeanquin-dg force-pushed the task/AMP-31022/Indicators-module-changes branch from a6db9b2 to 8c3fb35 Compare September 15, 2025 16:05
cursor[bot]

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants