feat: implement formula management module with CRUD operations, API routes, and UI components#13
Merged
ilramdhan merged 2 commits intomutugading:mainfrom Apr 8, 2026
Conversation
…outes, and UI components
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new Finance “Formula Master” module, introducing end-to-end CRUD + Excel import/export across the UI, hooks, API routes, and gRPC client wiring.
Changes:
- Added proto-generated Formula types plus a finance-facing types wrapper with UI helpers.
- Implemented Formula CRUD/import/export hooks and Next.js API routes backed by the finance gRPC service.
- Added dashboard UI pages/components for listing, filtering, paginating, creating/editing, deleting, importing, and exporting formulas.
Reviewed changes
Copilot reviewed 27 out of 28 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/generated/finance/v1/formula.ts | Adds generated TS protobuf/grpc types for Formula service/messages. |
| src/types/finance/formula.ts | Provides finance-level re-exports + UI label/option helpers for formula enums and forms. |
| src/types/finance/rm-category.ts | Removes duplicated ActiveFilter UI helpers/Import types to centralize shared types. |
| src/types/finance/parameter.ts | Removes duplicated ActiveFilter UI helpers/Import types to centralize shared types. |
| src/types/finance/index.ts | Adds finance barrel exports for rm-category/parameter/formula. |
| src/lib/grpc/clients.ts | Registers getFormulaClient() (finance service). |
| src/lib/grpc/index.ts | Re-exports getFormulaClient. |
| src/hooks/finance/use-formula.ts | Adds CRUD + import/export/template hooks for formulas. |
| src/hooks/finance/index.ts | Exports formula/rm-category/parameter hooks from finance hooks barrel. |
| src/components/finance/rm-category/rm-category-import-dialog.tsx | Switches import dialog type imports to shared finance/uom types. |
| src/components/finance/rm-category/rm-category-filters.tsx | Switches ActiveFilter options import to shared finance/uom types. |
| src/components/finance/parameter/parameter-import-dialog.tsx | Switches import dialog type imports to shared finance/uom types. |
| src/components/finance/parameter/parameter-filters.tsx | Switches ActiveFilter options import to shared finance/uom types. |
| src/components/finance/formula/* | Adds Formula UI components: table, filters, pagination, form, delete confirm, import dialog, and barrel. |
| src/app/api/v1/finance/formulas/** | Adds formula REST endpoints (CRUD + export/import/template) backed by gRPC client calls. |
| src/app/(dashboard)/finance/master/formula/* | Adds Formula page, loading skeleton, and client page implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… request payload order
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
This pull request introduces a comprehensive Formula Master feature for the finance dashboard, including a complete CRUD (Create, Read, Update, Delete) interface, Excel import/export capabilities, and improved API endpoints. The implementation covers both the frontend UI components and the backend API routes, providing a robust and user-friendly experience for managing formulas.
Type of Change
Module/Component Affected
Changes Made
Frontend: Formula Master UI and Functionality
FormulaPageClientcomponent that provides a full-featured UI for listing, filtering, paginating, creating, editing, deleting, importing, and exporting formulas, with error handling and skeleton loading states.FormulaFilters) for search, type, status, and sorting, with a clear filters option.Backend: API Endpoints for Formula Management
/api/v1/finance/formulasfor listing, creating, retrieving, updating, and deleting formulas, with robust error handling and gRPC client integration. (src/app/api/v1/finance/formulas/route.tsR1-R78, src/app/api/v1/finance/formulas/[formulaId]/route.tsR1-R93)/export), importing from Excel (/import), and downloading an import template (/template), handling file content as base64 for transport and supporting error reporting. [1] [2] [3]Error Handling and User Feedback
These changes collectively deliver a full-featured, production-ready Formula Master module for the finance dashboard.
Testing Performed
Manual Testing
Browser Testing
Build Verification
npm run lintpassesnpx tsc --noEmitpassesnpm run buildsucceedsAccessibility
Performance
Pre-merge Checklist