Skip to content

fix(finance): implement scoped product routing export functionality#53

Merged
ilramdhan merged 2 commits into
mutugading:mainfrom
ilramdhan:fix/seed-master-data-product-cost
Jun 23, 2026
Merged

fix(finance): implement scoped product routing export functionality#53
ilramdhan merged 2 commits into
mutugading:mainfrom
ilramdhan:fix/seed-master-data-product-cost

Conversation

@ilramdhan

Copy link
Copy Markdown
Member

Description

Pull Request ini memperluas kapabilitas fitur Bulk Product Routing Export dengan menerapkan mekanisme scoping (pembatasan area ekspor data). Pengguna kini dapat mengekspor produk dan susunan rute (routing closure)-nya langsung dari halaman Product Detail untuk satu entitas spesifik. Selain itu, ekspor pada halaman Product List kini dibuat sadar-konteks (context-aware), yang mana data yang diekspor akan secara dinamis dibatasi hanya pada produk yang sedang tampil/terfilter di tabel, bukan lagi seluruh dataset master produk.

Type of Change

  • 🐛 Bug fix
  • ✨ New feature
  • 🎨 UI/UX improvement
  • ♻️ Refactor
  • 📚 Documentation
  • 🔧 Chore (deps, config)

Module/Component Affected

  • Dashboard
  • Finance (Costing / Product Master)
  • HR / IT / CI / EXSIM
  • Components (common/)
  • Components (ui/)
  • Navigation
  • API Routes (BFF)

Changes Made

1. Scoped Export on Product List (Filtered):

  • Mengubah perilaku tombol Bulk Export di halaman tabel produk.
  • Ketika pengguna melakukan pencarian atau mengaktifkan filter (seperti filter product-type), sistem akan meneruskan productSysIds dari baris yang sedang tampil ke service layer dan backend.
  • Ekspor bulk routing hanya akan berisi data produk yang terfilter beserta rantai rute (routing closure)-nya, mencegah ekspor keseluruhan master dataset secara masif.

2. Direct Export on Product Detail Page:

  • Menambahkan tombol "Export product + routing" langsung di antarmuka halaman Detail Master Produk.
  • Tombol ini memicu proses asynchronous yang dibatasi/di-scope murni hanya untuk ID produk tersebut.
  • Menyertakan notifikasi success toast informatif berupa nomor Job ID beserta deep link "Lihat Jobs" yang mengarah ke halaman pelacakan /finance/import-jobs.

3. BFF API & Service Binding:

  • Mengekspos dukungan parameter productSysIds pada fungsi exportBulkProductRouting() di cost-import-api.ts.
  • Meneruskan secara paralel array productSysIds dari Next.js Route Handlers (BFF) hingga ke pemanggilan RPC gRPC.

Related Issues

Fixes #
Related to #

Screenshots

Before

After

Testing Performed

Manual Testing

  • Desktop (1440px+)
  • Tablet (768px)
  • Mobile (375px)
  • Light mode
  • Dark mode

Browser Testing

  • Chrome
  • Firefox
  • Safari
  • Edge

Build Verification

  • npm run lint passes
  • npx tsc --noEmit passes
  • npm run build succeeds

Accessibility

  • Keyboard navigation works
  • Screen reader compatible
  • Proper ARIA labels
  • Color contrast adequate

Performance

  • No unnecessary re-renders
  • Images optimized
  • Heavy components lazy loaded

Pre-merge Checklist

  • I have read and followed RULES.md
  • I have read and followed CONTRIBUTING.md
  • Loading states implemented (if data fetching)
  • Error handling present
  • Component props typed properly
  • Uses semantic color classes
  • Responsive design tested
  • Dark mode compatible
  • Screenshots included (for UI changes)

Reviewer Notes

  • List Page Scoping: Pembuatan payload array untuk parameter productSysIds pada halaman daftar (list page) bertumpu pada current page rows yang terlihat atau data terfilter hasil respons query. Proses komputasi closure relasional dari masing-masing produk kini di-handle secara independen dan ringan di backend.
  • Async UX Flow: UI Toast pada halaman Detail telah diselaraskan dengan pola UX sinkronisasi asinkron terbaru. User tetap bisa bernavigasi ke laman lain selama status antrean pekerjaan (job queues) masih berstatus diproses.

ilramdhan and others added 2 commits June 23, 2026 09:30
- BFF route: pass productSysIds to gRPC export request
- Service: expose productSysIds param in exportBulkProductRouting()
- Detail page: "Export product + routing" button queues async export
  scoped to that product's closure; toast shows job ID with deep link

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When a search or product-type filter is active, pass the visible
page's product sys IDs to the export so only those products and
their routing closure are exported instead of the full dataset.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ilramdhan ilramdhan added this to the Costing Release Milestone milestone Jun 23, 2026
@ilramdhan ilramdhan self-assigned this Jun 23, 2026
@ilramdhan ilramdhan added bug Something isn't working fix labels Jun 23, 2026
@ilramdhan ilramdhan merged commit 1a4222b into mutugading:main Jun 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fix

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant