feat(ekonomi): implement UMKM module with CRUD API and Dashboard analytics

This commit is contained in:
2026-04-20 16:51:59 +08:00
parent 97902f6277
commit 58ab306428
34 changed files with 2944 additions and 2 deletions

View File

@@ -0,0 +1,31 @@
import prisma from "@/lib/prisma";
import { Context } from "elysia";
async function umkmDelete(context: Context) {
const id = context.params.id;
try {
// Soft delete
const data = await prisma.umkm.update({
where: { id },
data: {
deletedAt: new Date(),
isActive: false,
},
});
return {
success: true,
message: "Berhasil menghapus UMKM",
data,
};
} catch (e) {
console.error("Error di umkmDelete:", e);
return {
success: false,
message: "Gagal menghapus UMKM",
};
}
}
export default umkmDelete;