Skip to content

feat(finance): add MB Head machine picker, RM group colourant details, and MB batch trigger UI - #65

Merged
ilramdhan merged 3 commits into
mutugading:mainfrom
ilramdhan:fix/master-batch-costing
Jul 15, 2026
Merged

feat(finance): add MB Head machine picker, RM group colourant details, and MB batch trigger UI#65
ilramdhan merged 3 commits into
mutugading:mainfrom
ilramdhan:fix/master-batch-costing

Conversation

@ilramdhan

Copy link
Copy Markdown
Member

Description

Pull Request ini menghadirkan tiga penyempurnaan fitur yang saling melengkapi untuk ekosistem Master Batch (MB) Costing. Pembaruan ini mencakup integrasi Machine Picker pada form MB Head (yang secara tidak langsung menyelesaikan isu hardcode perhitungan di backend), pengayaan informasi Colourant dan CI Name pada antarmuka komposisi RM Group, serta penambahan UI eksekusi komputasi (Trigger MB Batch) secara mandiri di halaman Push-to-Head.

Type of Change

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

Module/Component Affected

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

Changes Made

1. MB Head Machine Picker:

  • Menambahkan komponen MachineCombobox (dibatasi/terfilter hanya untuk mesin dengan mc_type=MB) pada seksi Recipe Identity di form MB Head.
  • Mengintegrasikan pembaruan ini ke dalam payload (Create & Update) serta memastikan state reset berfungsi baik berdasarkan mbHead.machineId.
  • Chore: Mengenerate ulang tipe proto yarn_master untuk mengakomodasi penambahan field machine_id/mbh_machine_id. Pembaruan ini merupakan pilar di frontend untuk mendukung perbaikan di backend yang kini mengambil perhitungan MACHINE_MB_FIXED_TOTAL dari mesin asli (bukan lagi hardcode 0).

2. RM Group Composition Enhancements:

  • Menambahkan informasi subtitel (colourant · CI name) pada item di dalam RmGroupHeadCombobox.
  • Menambahkan dua kolom baru (Colourant dan CI Name) pada tabel komposisi MB khusus untuk baris yang bersumber dari entitas GROUP.
  • Data di-resolve secara presisi menggunakan hook useRMGroup(groupHeadId).

3. MB Batch Compute Trigger UI:

  • Menambahkan tombol aksi "Trigger MB Batch" pada halaman MB Push-to-Head.
  • Aksi ini dilindungi oleh gerbang otorisasi (permission-gated) finance.mb.batch.trigger.
  • Menyertakan Confirm Dialog serta pengecekan validitas periode komputasi.
  • Mengkabelkan rute BFF baru, TanStack Query hook, API service, dan mendaftarkan singleton getMbBatchClient() ke registry gRPC client yang terhubung langsung ke layanan MbBatchService di backend.

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

  • Machine Picker & Backend Calculation: Penambahan MachineCombobox ini sangat krusial karena backend kini mendasarkan perhitungan fixed total (MACHINE_MB_FIXED_TOTAL) pada spesifikasi mesin yang dipilih di form ini. Pastikan untuk memvalidasi bahwa setiap pemilihan mesin baru benar-benar memperbarui payload ID dengan tepat sebelum menekan "Save".
  • RBAC / Permissions: Tombol "Trigger MB Batch" disembunyikan menggunakan pengecekan otorisasi finance.mb.batch.trigger. Jika Anda mengujinya dan tidak melihat tombol tersebut, pastikan role akun testing Anda sudah mencakup permission ini.
  • RM Group Resolution: Untuk kolom Colourant dan CI Name di tabel komposisi, pengambilan datanya mengandalkan hook useRMGroup. Pastikan transisi loading pada baris-baris berjenis GROUP berjalan mulus tanpa layout shift yang mengganggu.

ilramdhan and others added 3 commits July 15, 2026 09:00
Adds a MachineCombobox scoped to mc_type=MB machines, wired into the MB
Head Recipe Identity section (create + update payloads, edit reset from
mbHead.machineId). Regenerates yarn_master types for the new machine_id/
mbh_machine_id proto fields. Backs the backend fix that resolves
MACHINE_MB_FIXED_TOTAL from a real machine instead of a hardcoded 0.

Authored-By: Ilham R <ilhamram332@gmail.com>
Co-Authored-By: Ilham R <me@ilramdhan.dev>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: IT Mutugading <it@mutugading.com>
Co-Authored-By: Indra Putro <indraputro@mutugading.com>
Co-Authored-By: Ilham R <ilham.ramadhan@mutugading.com>
Co-Authored-By: IT Mutu Gading <mutugadingapps@gmail.com>
Adds a subtitle (colourant · CI name) to RmGroupHeadCombobox items and two
new columns (Colourant, CI Name) to the MB composition table for
GROUP-sourced rows, resolved via useRMGroup(groupHeadId).

Authored-By: Ilham R <ilhamram332@gmail.com>
Co-Authored-By: Ilham R <me@ilramdhan.dev>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: IT Mutugading <it@mutugading.com>
Co-Authored-By: Indra Putro <indraputro@mutugading.com>
Co-Authored-By: Ilham R <ilham.ramadhan@mutugading.com>
Co-Authored-By: IT Mutu Gading <mutugadingapps@gmail.com>
Adds a "Trigger MB Batch" action to the MB Push-to-Head page, gated by
finance.mb.batch.trigger permission, with a confirm dialog and a period
validity check. Wires the BFF route, TanStack Query hook, API service,
and a getMbBatchClient() gRPC client singleton against the already
deployed MbBatchService (proto + backend committed previously).

Authored-By: Ilham R <ilhamram332@gmail.com>
Co-Authored-By: Ilham R <me@ilramdhan.dev>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: IT Mutugading <it@mutugading.com>
Co-Authored-By: Indra Putro <indraputro@mutugading.com>
Co-Authored-By: Ilham R <ilham.ramadhan@mutugading.com>
Co-Authored-By: IT Mutu Gading <mutugadingapps@gmail.com>
@ilramdhan ilramdhan self-assigned this Jul 15, 2026
Copilot AI review requested due to automatic review settings July 15, 2026 02:09
@ilramdhan ilramdhan added bug Something isn't working enhancement New feature or request fix labels Jul 15, 2026

Copilot AI 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.

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

@ilramdhan
ilramdhan merged commit 2321e93 into mutugading:main Jul 15, 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 enhancement New feature or request fix

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants