Skip to content

FINERACT-2675: Fix template endpoint - #6092

Merged
adamsaghy merged 1 commit into
apache:developfrom
AnvayKharb:fix/templates-api-response-shape
Jul 10, 2026
Merged

FINERACT-2675: Fix template endpoint#6092
adamsaghy merged 1 commit into
apache:developfrom
AnvayKharb:fix/templates-api-response-shape

Conversation

@AnvayKharb

@AnvayKharb AnvayKharb commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Description

This PR fixes FINERACT-2675 by restoring the template endpoint responses expected by the Mifos Web App.

Problem

After recent backend changes, the Templates API response contract changed:

  • GET /templates returned only template IDs, causing the Name, Entity, and Type columns to appear blank.
  • GET /templates/{id}/template returned a raw template object instead of the wrapper containing template, entities, and types, causing the Edit Template page to fail.

Changes

  • Restore full template data for GET /templates.
  • Restore the response wrapper for GET /templates/{id}/template containing:
    • template
    • entities
    • types
  • Preserve the existing behavior of GET /templates/{id}.
  • Return template entity and type values in the format expected by the Web App.
  • Add regression tests covering:
    • Template list response
    • Template edit response
    • Template retrieval
    • Entity/type mapping
    • Query filtering

Testing

Verified by:

  • Running the relevant unit tests.
  • Running Spotless checks.
  • Confirming the restored API response matches the expected Web App contract.

Fixes FINERACT-2675.

@AnvayKharb AnvayKharb changed the title Restore Templates API response shapes for Web App compatibility FINERACT-2675: Restore template endpoint response compatibility Jul 5, 2026
@AnvayKharb
AnvayKharb force-pushed the fix/templates-api-response-shape branch 2 times, most recently from 0ff546b to 36681a5 Compare July 5, 2026 18:08
@AnvayKharb AnvayKharb changed the title FINERACT-2675: Restore template endpoint response compatibility FINERACT-2675: Fix template endpoint Jul 5, 2026
@AnvayKharb
AnvayKharb force-pushed the fix/templates-api-response-shape branch 2 times, most recently from 6e2c6bc to a23df1f Compare July 5, 2026 19:20
@adamsaghy
adamsaghy requested a review from vidakovic July 6, 2026 09:23
@IOhacker

IOhacker commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

@adamsaghy @vidakovic LGTM. @vidakovic I would like to know the reason it was changed before.

@adamsaghy

Copy link
Copy Markdown
Contributor

@AnvayKharb Please rebase

@AnvayKharb
AnvayKharb force-pushed the fix/templates-api-response-shape branch from 1484ab7 to 7d6a78f Compare July 10, 2026 05:13
@AnvayKharb

Copy link
Copy Markdown
Contributor Author

Please review @IOhacker @adamsaghy @vidakovic

@IOhacker IOhacker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@AnvayKharb
AnvayKharb force-pushed the fix/templates-api-response-shape branch from 7d6a78f to 43e5c9e Compare July 10, 2026 05:23
@AnvayKharb
AnvayKharb requested a review from IOhacker July 10, 2026 05:27
@AnvayKharb
AnvayKharb force-pushed the fix/templates-api-response-shape branch from 43e5c9e to 96dea37 Compare July 10, 2026 06:39
@adamsaghy

Copy link
Copy Markdown
Contributor

@AnvayKharb Please make sure your commit is signed by GPG. I wont be able merge it till its done

@AnvayKharb

Copy link
Copy Markdown
Contributor Author

Hi @adamsaghy I've added the GPG key, please review again

@adamsaghy
adamsaghy merged commit e61fa63 into apache:develop Jul 10, 2026
91 checks passed
@AnvayKharb
AnvayKharb deleted the fix/templates-api-response-shape branch July 10, 2026 10:18
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.

3 participants