feat(admin-ui): implement UMKM admin dashboard and CRUD pages

This commit is contained in:
2026-04-20 17:15:54 +08:00
parent 62aa9b63b2
commit b673e36a45
11 changed files with 966 additions and 2 deletions

View File

@@ -22,3 +22,9 @@ Implement UMKM, ProdukUmkm, and PenjualanProduk module with CRUD API and Dashboa
- [x] Step 6: Implement Dashboard API
- [x] Step 7: Register routers
- [x] Step 8: Verify changes
- [x] Step 9: Implement Admin UI Layout and Tabs
- [x] Step 10: Implement Dashboard UI Page
- [x] Step 11: Implement Data UMKM UI Page
- [x] Step 12: Implement Produk UI Page
- [x] Step 13: Implement Penjualan UI Page
- [x] Step 14: Register UI pages in Admin Menu

View File

@@ -5,18 +5,24 @@
- Implemented a complete set of CRUD API endpoints for UMKM, Products, and Sales.
- Developed a comprehensive Dashboard API providing KPIs, sales summaries, top products, and detailed stock analytics.
- Integrated the new module into the existing `ekonomi` router.
- Verified the implementation with `tsc` to ensure type safety.
- Implemented the Admin UI with a modern tab-based layout.
- Created four main admin pages: Dashboard, Data UMKM, Produk, and Penjualan.
- Registered the new UMKM module in the Admin Navigation Menu for all roles.
- Verified the implementation with `tsc` and `bun run build`.
## Files Created/Modified
### Modified
- `prisma/schema.prisma`: Added relations and models.
- `src/app/api/[[...slugs]]/_lib/ekonomi/index.ts`: Registered new routers.
- `src/app/admin/_com/list_PageAdmin.tsx`: Registered new UI pages in menu.
### Created
- `src/app/api/[[...slugs]]/_lib/ekonomi/umkm/`: CRUD for UMKM.
- `src/app/api/[[...slugs]]/_lib/ekonomi/umkm/produk/`: CRUD for Products.
- `src/app/api/[[...slugs]]/_lib/ekonomi/umkm/penjualan/`: CRUD for Sales with stock management.
- `src/app/api/[[...slugs]]/_lib/ekonomi/umkm/dashboard/`: Analytics endpoints.
- `src/app/admin/(dashboard)/ekonomi/umkm/`: Admin UI pages and layouts.
- `src/app/admin/(dashboard)/_state/ekonomi/umkm/umkm.ts`: Valtio state for the UMKM module.
## Stock Management Logic
- Creating a sale decrements product stock.