feat(finance): master lookup param type, CAPP child operations, and calc schedule page#51
Merged
ilramdhan merged 22 commits intoJun 20, 2026
Conversation
- Add YarnLookupFillServiceDefinition to yarn_master import in clients.ts - Add getYarnLookupFillClient() singleton using getOrCreate pattern - Export getYarnLookupFillClient from grpc/index.ts barrel - Create BFF route GET /api/v1/finance/lookup-fill-values with validation - Add src/types/finance/yarn-master.ts with LookupFillValuesResponse and LOOKUP_MASTER_CONFIG Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
… hook Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…loading - Add clarifying comment to MasterLookupFieldProps.allEntries: it is passed for context but auto-population happens in the parent via onChangeLookup - Wrap CommandEmpty in !optionsLoading guard to prevent flicker when options are still loading from the lookup master query Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…free-text LOOKUP fallback - Export DraftValue interface for reuse - Add handleLookupChange callback (auto-populates numeric + text fills via MasterLookupField selection) - Replace free-text LOOKUP Input with MasterLookupField combobox - Convert patch to useCallback for stable deps in handleLookupChange Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…mingling label config - Show error toast in MasterLookupField when auto-fill fetch fails (non-ok response or network error) instead of silently falling back to null fills - Import DraftValue from parameters-tab instead of redeclaring locally - Fix fetchMasterOptions to throw on non-ok response so TanStack Query correctly marks the query as errored instead of returning empty array - Update LOOKUP_MASTER_CONFIG INTERMINGLING labelField from interminglingCode to interminglingName so the dropdown shows names not codes Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…P with-children ops - Add LookupMasterServiceDefinition to clients.ts + index.ts barrel export - New types/finance/lookup-master.ts: LookupMaster, LookupMasterColumn, RemoveApplicablePreview - BFF GET /api/v1/finance/lookup-masters — list active/all lookup masters - BFF GET /api/v1/finance/lookup-master-columns — list columns for a master code - BFF POST /api/v1/finance/cost-product-parameters/applicable/add-with-children - BFF POST /api/v1/finance/cost-product-parameters/applicable/remove-preview - BFF POST /api/v1/finance/cost-product-parameters/applicable/remove-with-children - New hooks/finance/use-lookup-master.ts: useLookupMasters, useLookupMasterColumns - Update use-master-lookup.ts: replace hardcoded LOOKUP_MASTER_CONFIG with API call Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…Filter to BFF, and new fields to create form
…ster dropdown, fill-group + source-column selects
…y child rows, remove-with-children confirm dialog Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…redParamEntry/AvailableParamEntry
…ix cached lookup masters fetch Three frontend fixes for the Master Lookup Param Type feature: 1. handleRemoveWithChildren — keep ConfirmDialog open on failure so the user can retry; only clear removePreviewEntry/removePreview on success. 2. Add removeInProgress state and pass it to ConfirmDialog isLoading so the button spins and is disabled while the remove-with-children request is in-flight. 3. Refactor useMasterLookupOptions to consume useLookupMasters (cached 5 min) instead of re-fetching the lookup-masters registry inside every queryFn call. The options query is enabled only when the config is resolved from the cached list. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…fields, child param trash button disabled
…ests (12/12 pass)
…date, table-columns, options, export/import Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…e-name create field - Regenerate all proto TypeScript types (binary .ts files) - clients.ts: bump lookupMaster singleton key to invalidate stale channel - useCreateLookupMaster: simplify mutation to accept lmCode/lmDisplayName/lmTableName only; lmApiPath/lmCodeField/lmLabelField default to empty (table-driven lookup no longer needs manual API path) - lookup-masters-page-client.tsx: full redesign — table-column introspection UI, inline options preview, import/export support Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… route fix - cost-results-page-client: default period filter to current year (show all YYYYMM in current year) instead of MAX period; subtitle now reads "year 2026" vs "period 202605" depending on filter length; placeholder updated to "Period YYYYMM (default: this year)" - cost-results/[productSysId]/[period]/[calcType]/page.tsx: create missing detail route that was returning 404; validates numeric productSysId and known calcType before rendering CostResultDetail - calc-schedule page: new page at /finance/calc-schedule showing automatic cron schedule info (every 5th, 02:00 WIB, previous-month ACTUAL), KPI strip of ALL/FILTERED scope jobs, recent batch job table, and "Run now" button delegating to NewJobDialog - IAM migration 000060 adds the "Calc Schedule" sidebar menu entry under Product Costing, gated by finance.cost.caljob.view Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Pull Request ini memperkenalkan arsitektur Master Lookup Param Type yang sepenuhnya dinamis dan digerakkan oleh tabel (table-driven), menggantikan fallback text manual sebelumnya. PR ini juga mencakup UI/UX admin page untuk registri Lookup Master (mendukung CRUD tanpa query SQL manual). Selain itu, terdapat fitur operasi parent-child pada halaman CAPP, penyelesaian isu 404 pada detail Cost Results, serta penambahan halaman baru Calc Schedule untuk memantau tugas otomatisasi (cron jobs).
Type of Change
Module/Component Affected
Changes Made
1. Master Lookup System & Registry:
MASTER_LOOKUPbeserta halaman admin CRUD/finance/lookup-masters. Sistem ini mendukung introspeksi tabel, inline options preview, dan fitur export/import tanpa memerlukan konfigurasi SQL.MasterLookupFielddan hookuse-master-lookupyang memicu auto-populate (mengisi nilai fill secara otomatis berdasarkan pilihan) untuk modul entri parameter.2. CAPP Parent/Child Operations:
add-with-children,remove-preview, danremove-with-children.3. Calc Schedule & Cost Results:
/finance/calc-scheduleyang menampilkan informasi cron schedule otomatis, indikator KPI, serta tabel riwayat batch job terbaru dengan kapabilitas eksekusi manual via "Run now"./finance/cost-results/[productSysId]/[period]/[calcType]/page.tsxyang sebelumnya mengembalikan error 404 Not Found.4. Testing & Proto:
clients.tsuntuk mengakomodasi penambahan kolom baru sepertilookup_fill_group_code.Related Issues
Fixes #
Related to #
Screenshots
Before
After
Testing Performed
Manual Testing
Browser Testing
Build Verification
npm run lintpassesnpx tsc --noEmitpassesnpm run buildsucceedsAccessibility
Performance
Pre-merge Checklist
Reviewer Notes
LookupMastersekarang dirombak menjadi UI berbasis tabel (table-driven). FormCreatedisederhanakan hanya menerimalmCode,lmDisplayName, danlmTableName. Field manual terkait konfigurasi path API (legacy) akan otomatis menyesuaikan atau diberikan nilai kosong (empty default).remove-with-childrenyang akan mem-block (mempertahankan dialog tetap terbuka) apabila operasi backend gagal, sehingga user dapat langsung melakukan retry tanpa mengulang prosedur klik.