feat: add UOM category management module with CRUD, import/export, and UI components#14
Merged
ilramdhan merged 3 commits intomutugading:mainfrom Apr 13, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Finance “UOM Category” master-data module (API + UI) and refactors existing UOM flows to reference categories by uomCategoryId rather than the removed UOMCategory enum, including import/export support and related test updates.
Changes:
- Introduced UOM Category CRUD + import/export API routes backed by the finance gRPC service.
- Added UOM Category client page and reusable UI components (table/filters/dialogs/pagination/loading).
- Refactored UOM types and UI (forms/filters/table/export) to use
uomCategoryId+ denormalized category fields, and updated tests accordingly.
Reviewed changes
Copilot reviewed 28 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/generated/finance/v1/uom.ts | Updates generated UOM proto types to replace enum category with category FK + display fields. |
| src/types/generated/finance/v1/uom_category.ts | Adds generated proto types + service definition for UOM Category. |
| src/types/finance/uom.ts | Updates app-level UOM type helpers/params/form model to use uomCategoryId. |
| src/types/finance/uom-category.ts | Adds app-level re-exports + params/form model for UOM Category. |
| src/lib/grpc/index.ts | Exposes the new getUomCategoryClient from the gRPC module. |
| src/lib/grpc/clients.ts | Registers a singleton finance gRPC client for UOM Category service. |
| src/hooks/finance/use-uom-category.ts | Adds TanStack Query CRUD hooks + import/export/template hooks for UOM Categories. |
| src/components/finance/uom/uom-table.tsx | Displays category using denormalized uomCategoryName / uomCategoryCode. |
| src/components/finance/uom/uom-form-dialog.tsx | Switches UOM form to select uomCategoryId via fetched categories. |
| src/components/finance/uom/uom-filters.tsx | Switches UOM filters to category dropdown driven by fetched categories. |
| src/components/finance/uom-category/uom-category-table.tsx | Adds table for listing UOM Categories with row actions. |
| src/components/finance/uom-category/uom-category-pagination.tsx | Adds pagination control wrapper for UOM Category list. |
| src/components/finance/uom-category/uom-category-import-dialog.tsx | Adds Excel import dialog (template download + duplicate handling + result display). |
| src/components/finance/uom-category/uom-category-form-dialog.tsx | Adds create/edit dialog with validation for UOM Categories. |
| src/components/finance/uom-category/uom-category-filters.tsx | Adds search/status/sort filters for UOM Category listing. |
| src/components/finance/uom-category/uom-category-delete-dialog.tsx | Adds delete confirmation dialog wired to delete hook. |
| src/components/finance/uom-category/index.ts | Adds explicit exports for UOM Category UI components. |
| src/app/api/v1/finance/uoms/route.ts | Updates UOM list API to accept uomCategoryId; forwards create requests unchanged. |
| src/app/api/v1/finance/uoms/export/route.ts | Updates UOM export API to accept uomCategoryId. |
| src/app/api/v1/finance/uom-categories/template/route.ts | Adds template download endpoint returning base64-encoded file content. |
| src/app/api/v1/finance/uom-categories/route.ts | Adds list + create endpoints for UOM Categories. |
| src/app/api/v1/finance/uom-categories/import/route.ts | Adds Excel import endpoint converting JSON byte array to Uint8Array for gRPC. |
| src/app/api/v1/finance/uom-categories/export/route.ts | Adds Excel export endpoint returning base64-encoded file content. |
| src/app/api/v1/finance/uom-categories/[uomCategoryId]/route.ts | Adds get/update/delete endpoints for UOM Categories by ID. |
| src/app/(dashboard)/finance/master/uom/uom-page-client.tsx | Updates UOM page export params to use uomCategoryId. |
| src/app/(dashboard)/finance/master/uom-category/uom-category-page-client.tsx | Adds the UOM Category management page client with dialogs + import/export. |
| src/app/(dashboard)/finance/master/uom-category/page.tsx | Adds the route entrypoint for the UOM Category page. |
| src/app/(dashboard)/finance/master/uom-category/loading.tsx | Adds route-level loading skeleton. |
| src/tests/hooks/use-uom.test.tsx | Updates query key expectation to match new list key serialization. |
| src/tests/components/uom-filters.test.tsx | Updates filter tests for debounce and category dropdown driven by fetched categories. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
… properties over uomCategoryId
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 full CRUD and import/export API support for UOM Categories, along with the corresponding client-side pages and loading skeletons. It also includes several test and codebase improvements for UOM and UOM Category functionality.
Type of Change
Module/Component Affected
Changes Made
API: UOM Category CRUD and Import/Export Endpoints
Frontend: UOM Category Page and Loading Skeleton
UOMCategoryPageClientand supporting components, providing a full-featured UI for listing, filtering, creating, editing, deleting, importing, and exporting UOM Categories, with appropriate loading and error states. [1] [2]UOM Page and Test Improvements
UOMCategoryenum, streamline filter usage, and correctly map export parameters to the new API. [1] [2] [3]Testing Performed
Build Verification
npm run lintpassesnpx tsc --noEmitpassesnpm run buildsucceedsAccessibility
Performance
Pre-merge Checklist