Skip to content

feat: add UOM category management module with CRUD, import/export, and UI components#14

Merged
ilramdhan merged 3 commits intomutugading:mainfrom
ilramdhan:feat/formula-master-fe
Apr 13, 2026
Merged

feat: add UOM category management module with CRUD, import/export, and UI components#14
ilramdhan merged 3 commits intomutugading:mainfrom
ilramdhan:feat/formula-master-fe

Conversation

@ilramdhan
Copy link
Copy Markdown
Member

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

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

Module/Component Affected

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

Changes Made

API: UOM Category CRUD and Import/Export Endpoints

Frontend: UOM Category Page and Loading Skeleton

  • Implemented the UOMCategoryPageClient and 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]
  • Added a loading skeleton for the UOM Category page to improve perceived performance during data fetches.

UOM Page and Test Improvements

  • Updated UOM page and related code to remove the now-unused UOMCategory enum, streamline filter usage, and correctly map export parameters to the new API. [1] [2] [3]
  • Improved UOM and UOM Category test mocks and logic to align with new API and filter structure, including better debounce handling in filter tests and correct query key serialization. [1] [2] [3] [4]

Testing Performed

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)

@ilramdhan ilramdhan requested a review from Copilot April 13, 2026 08:25
@ilramdhan ilramdhan self-assigned this Apr 13, 2026
@ilramdhan ilramdhan added documentation Improvements or additions to documentation enhancement New feature or request labels Apr 13, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

ilramdhan and others added 2 commits April 13, 2026 15:38
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@ilramdhan ilramdhan merged commit 69224c9 into mutugading:main Apr 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants