1.2 KiB
1.2 KiB
Plan: Refactor UMKM and Pasar Desa Model
Objective
Unify ProdukUmkm and PasarDesa into a single PasarDesa model to avoid data redundancy and simplify management.
Changes:
- Schema Refactor:
- Merge fields from
ProdukUmkm(stok,umkmId) intoPasarDesa. - Update
PenjualanProdukto relate directly toPasarDesa. - Remove
ProdukUmkmmodel. - Update
FileStoragerelations.
- Merge fields from
- Backend/API Refactor:
- Update Pasar Desa
findManyto only show products whereumkmIdis null. - Update UMKM Produk APIs (
create,updt,findMany,del) to use thePasarDesamodel withumkmIdfilter. - Update Penjualan logic to adjust
stokinPasarDesa. - Update UMKM Dashboard analytics to query
PasarDesa.
- Update Pasar Desa
- Admin UI Refactor:
- Update
umkmStateto handlekategoriIdfor products. - Create "Tambah UMKM" form for business profile management.
- Create "Tambah Produk UMKM" form for product management with
umkmIdbinding. - Update list views to link to the new forms.
- Implement logical separation between "Pasar Desa Admin" and "UMKM Admin" contexts.
- Update
Verification:
- Successful build (
bun run build). - Verify API responses for both Pasar Desa and UMKM Produk filters.