- Remove "Pasar Desa" as a separate entity; products are now strictly linked to UMKM. - Delete redundant Pasar Desa API endpoints and state management. - Update Admin UI: remove "Pasar Desa" menu and unified product management under UMKM. - Update Public UI: replace "Pasar Desa" with "UMKM" in navbar and unified hub at /darmasaba/ekonomi/umkm. - Implement mandatory umkmId in PasarDesa model and update seeders accordingly. - Fix UI bugs, missing imports, and invalid API filters for mandatory umkmId. - Increment version to 0.1.18.
1.9 KiB
1.9 KiB
Summary: Refactor UMKM and Pasar Desa (Consolidation)
Objective
Successfully consolidated "Pasar Desa" into the UMKM module. Pasar Desa is now strictly a part of the UMKM ecosystem, where every product must belong to an UMKM entity.
Changes Made:
- Backend & API:
- Removed redundant
pasar-desaAPI endpoints fromsrc/app/api/[[...slugs]]/_lib/ekonomi/index.ts. - Removed invalid
not: nullfilters forumkmIdin UMKM dashboard and product findMany APIs (sinceumkmIdis now mandatory). - Updated
umkmStateto includefindUniquefor products.
- Removed redundant
- Admin UI:
- Removed "Pasar Desa" menu items from
src/app/admin/_com/list_PageAdmin.tsxfor all roles. - Cleaned up unused state management for
pasar-desa.
- Removed "Pasar Desa" menu items from
- Public UI:
- Replaced "Pasar Desa" with "UMKM" in the public navbar (
src/con/navbar-list-menu.ts). - Unified the public hub at
/darmasaba/ekonomi/umkm. - Refactored the hub page to remove the "Produk Pasar Desa" tab and rename other tabs to "Katalog Produk" and "Direktori Bisnis".
- Updated product detail routing to
/darmasaba/ekonomi/umkm/produk/[id]. - Updated UMKM profile routing to
/darmasaba/ekonomi/umkm/[id].
- Replaced "Pasar Desa" with "UMKM" in the public navbar (
- Database & Seeding:
- Created a new UMKM seeder (
prisma/_seeder_list/ekonomi/seed_umkm.ts). - Updated
seedPasarDesato link products to UMKM entities, satisfying the mandatoryumkmIdconstraint. - Integrated
seedUmkminto the mainseed.ts.
- Created a new UMKM seeder (
- Code Cleanup:
- Fixed missing imports (e.g.,
IconUser). - Removed unused imports across several files.
- Fixed copy-pasted toast messages in unrelated modules.
- Fixed missing imports (e.g.,
Verification**:
- Build successful (
bun run build). - No "Pasar Desa" menu in Admin.
- "UMKM" menu in Public Navbar points to unified hub.
- Unified hub shows products linked to UMKM.
- Product detail pages correctly show seller information.