"use strict";(()=>{var e={};e.id=6105,e.ids=[6105,2331],e.modules={53524:e=>{e.exports=require("@prisma/client")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},37230:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>g,patchFetch:()=>x,requestAsyncStorage:()=>d,routeModule:()=>o,serverHooks:()=>l,staticGenerationAsyncStorage:()=>c});var a={};r.r(a),r.d(a,{GET:()=>m});var s=r(49303),i=r(88716),u=r(60670),n=r(87070);let p=r(72331).prisma;async function m(e){try{let{searchParams:t}=new URL(e.url),r=Math.max(1,parseInt(t.get("page")||"1")),a=Math.min(50,parseInt(t.get("limit")||"20")),s=t.get("status")||"",i=(r-1)*a,u={};s&&(u.status=s);let[m,o,d]=await Promise.all([p.premiumRequest.findMany({where:u,include:{user:{select:{id:!0,userId:!0,premiumTier:!0,premiumExpiresAt:!0,totalPredictions:!0,accuracyRate:!0,createdAt:!0}}},orderBy:{createdAt:"desc"},skip:i,take:a}),p.premiumRequest.count({where:u}),p.premiumRequest.count({where:{status:"pending"}})]);return n.NextResponse.json({success:!0,data:m.map(e=>({id:e.id,nama_lengkap:e.namaLengkap,catatan:e.catatan,status:e.status,duration:e.duration,reviewed_by:e.reviewedBy,reviewed_at:e.reviewedAt,review_note:e.reviewNote,created_at:e.createdAt,user:{id:e.user.id,user_id:e.user.userId,premium_tier:e.user.premiumTier,premium_expires_at:e.user.premiumExpiresAt,total_predictions:e.user.totalPredictions,accuracy_rate:e.user.accuracyRate,member_since:e.user.createdAt}})),pagination:{page:r,limit:a,total:o,total_pages:Math.ceil(o/a)},pending_count:d})}catch(e){return console.error("Admin premium requests GET error:",e),n.NextResponse.json({success:!1,message:"Gagal memuat pengajuan"},{status:500})}}let o=new s.AppRouteRouteModule({definition:{kind:i.x.APP_ROUTE,page:"/api/admin/premium/requests/route",pathname:"/api/admin/premium/requests",filename:"route",bundlePath:"app/api/admin/premium/requests/route"},resolvedPagePath:"C:\\xampp\\htdocs\\Bolafest\\app\\api\\admin\\premium\\requests\\route.ts",nextConfigOutput:"standalone",userland:a}),{requestAsyncStorage:d,staticGenerationAsyncStorage:c,serverHooks:l}=o,g="/api/admin/premium/requests/route";function x(){return(0,u.patchFetch)({serverHooks:l,staticGenerationAsyncStorage:c})}},72331:(e,t,r)=>{r.d(t,{prisma:()=>s});var a=r(53524);let s=globalThis.prisma??new a.PrismaClient({log:["error"]})}};var t=require("../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[9276,5972],()=>r(37230));module.exports=a})();