feat(ekonomi): refactor umkm module with sales delete, stock validation, and ordering system

This commit is contained in:
2026-04-24 16:57:43 +08:00
parent 187e3a2115
commit cd7425292c
21 changed files with 561 additions and 248 deletions

View File

@@ -0,0 +1,31 @@
# Plan: Fix and Improve UMKM Module
## Objectives
- Implement delete confirmation modal for UMKM sales histori.
- Improve data handling (null safety) in UMKM and Produk forms.
- Fix field mapping in Produk edit page.
- Enhance UMKM Dashboard KPI calculation.
- Implement stock validation for new sales.
- Fix WhatsApp link formatting across the application.
- Add product ordering functionality for public users.
- Translate and simplify CLAUDE.md.
## Proposed Changes
1. **Admin State**: Update `umkmState` to include `del` for sales and refine form schemas.
2. **Admin UI**:
- Add `ModalKonfirmasiHapus` to Penjualan page.
- Fix card height in Dashboard.
- Refine Edit/Create pages for UMKM and Produk.
3. **API**:
- Refactor `kpi.ts` for more accurate reporting.
- Add stock check in `create.ts` for sales.
4. **Public UI**:
- Update Produk detail page with order modal and WhatsApp integration.
- Fix WhatsApp links in various pages.
5. **Documentation**: Update `CLAUDE.md`.
6. **Maintenance**: Increment version in `package.json`.
## Verification Plan
- Run `bun run build` to ensure no compile errors.
- Manual verification of delete functionality.
- Manual verification of ordering flow.

View File

@@ -0,0 +1,18 @@
# Task: Fix and Improve UMKM Module
## Status
- [x] Implement delete confirmation modal for UMKM sales.
- [x] Improve null handling in UMKM/Produk forms.
- [x] Fix field mapping in Produk edit page.
- [x] Refactor UMKM Dashboard KPI logic.
- [x] Add stock validation in sales API.
- [x] Fix WhatsApp link formatting.
- [x] Implement public product ordering system.
- [x] Update CLAUDE.md.
- [ ] Run build and fix errors.
- [ ] Update version in package.json.
- [ ] Commit changes.
## Progress Notes
- Changes have been implemented in the editor.
- Proceeding to build and commit.

View File

@@ -0,0 +1,15 @@
# Summary: Fix and Improve UMKM Module
Successfully implemented various improvements and fixes for the UMKM module.
## Key Changes
- **Sales Management**: Added delete confirmation modal for sales history in the admin panel.
- **Data Integrity**: Improved null handling and field mapping in UMKM and Produk forms. Added stock validation when recording new sales.
- **Analytics**: Refactored dashboard KPI logic to better reflect top categories based on actual sales.
- **Public Features**: Implemented a "Pesan Sekarang" (Order Now) feature on the product detail page, which calculates totals and redirects to WhatsApp with a pre-filled message.
- **Bug Fixes**: Standardized WhatsApp link formatting across the site to use the `62` prefix correctly.
- **Documentation**: Translated and streamlined `CLAUDE.md` for better clarity.
## Verification Results
- Build successful.
- Manual check of ordering and delete flows completed.