Skip to content

fix(finance): Extended Sorting, Oracle Sys ID Search, and Multi-Type Filter for Product Master#142

Merged
ilramdhan merged 1 commit into
mutugading:mainfrom
ilramdhan:feat/rbac-page-scoped-permissions
Jul 2, 2026
Merged

fix(finance): Extended Sorting, Oracle Sys ID Search, and Multi-Type Filter for Product Master#142
ilramdhan merged 1 commit into
mutugading:mainfrom
ilramdhan:feat/rbac-page-scoped-permissions

Conversation

@ilramdhan

Copy link
Copy Markdown
Member

Description

This PR enhances the query capabilities of the Product Master list endpoint. It introduces extended sorting fields (including subquery-driven type codes and flex fields), broadens the global search to include Oracle legacy IDs (flex_02), and upgrades the product type filter to support multiple IDs simultaneously.

Additionally, comprehensive unit and integration tests were added to ensure the reliability of these new query semantics.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that changes existing API)
  • ♻️ Refactor (code change without new feature or bug fix)
  • 📚 Documentation update
  • 🧪 Test update
  • 🔧 Chore (dependencies, config, etc.)

Service(s) Affected

  • Finance Service
  • IAM Service
  • Shared Proto (gen/)
  • Root/Common

Changes Made

  • Extended Sorting: Expanded the sort map to include product_type_code (resolved via scalar subquery), shade, grade, flex_01/02/03, and status. Also enforced a stable secondary ordering by product_code to prevent pagination jitter.
  • Oracle Sys ID Search: The global search clause now actively matches against cpm_flex_02, allowing users to easily find products using their legacy Oracle Sys IDs.
  • Multi-Type Filtering: Upgraded Filter.ProductTypeIDs to support multiple values using PostgreSQL's = ANY(pq.Array) predicate. This is backward-compatible and unions cleanly with the legacy single ID filter.
  • Linting/Refactor: Resolved goconst duplicated literal warnings by extracting a shared sortKeyStatus constant.
  • Testing: Added robust unit and integration tests specifically targeting the new sort mappings, union semantics, and Oracle search functionalities.

Related Issues

Fixes #
Related to #

API Changes (if applicable)

Proto Changes

// No Proto Changes

Breaking Changes

None.

Testing Performed

Unit Tests

  • New unit tests added (Coverage for sort mapping, union semantics, and Oracle search clause generation).
  • Existing unit tests pass
  • Coverage maintained/improved

Integration Tests

  • New integration tests added
  • Existing integration tests pass

Manual Testing

# Executed queries against the Product Master list endpoint locally
# Verified that searching

… multi-type filter

- Sort map: product_type_code (scalar subquery), shade/grade, flex01/02/03,
  status; stable secondary ordering by product_code
- Search clause now matches cpm_flex_02 (oracle sys id)
- Filter.ProductTypeIDs unioned with legacy single ID; = ANY(pq.Array) predicate
- Unit + integration tests for sort mapping, union semantics, oracle search
- goconst: shared sortKeyStatus const replaces duplicated literals

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ilramdhan ilramdhan added this to the Costing Release Milestone milestone Jul 2, 2026
@ilramdhan ilramdhan self-assigned this Jul 2, 2026
Copilot AI review requested due to automatic review settings July 2, 2026 09:37
@ilramdhan ilramdhan added bug Something isn't working documentation Improvements or additions to documentation fix labels Jul 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ilramdhan ilramdhan merged commit 7d0ca80 into mutugading:main Jul 2, 2026
19 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Goapps Roadmap [Backend] Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation fix

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants