"use strict";(()=>{var e={};e.id=5009,e.ids=[5009],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")},25559:(e,t,a)=>{a.r(t),a.d(t,{originalPathname:()=>h,patchFetch:()=>x,requestAsyncStorage:()=>l,routeModule:()=>d,serverHooks:()=>g,staticGenerationAsyncStorage:()=>m});var r={};a.r(r),a.d(r,{GET:()=>p,dynamic:()=>c});var n=a(49303),s=a(88716),i=a(60670),o=a(87070),u=a(72331);let c="force-dynamic";async function p(e){try{let{searchParams:t}=new URL(e.url),a=parseInt(t.get("page")||"1"),r=parseInt(t.get("limit")||"20"),n=t.get("type"),s=t.get("status"),i=t.get("search"),c=(a-1)*r,p={};n&&"ALL"!==n&&(p.type=n),s&&"ALL"!==s&&(p.status=s),i&&(p.user={OR:[{username:{contains:i}},{email:{contains:i}}]});let[d,l]=await Promise.all([u._.transaction.findMany({where:p,skip:c,take:r,orderBy:{createdAt:"desc"},include:{user:{select:{id:!0,username:!0,email:!0,image:!0}}}}),u._.transaction.count({where:p})]);return o.NextResponse.json({transactions:d,pagination:{page:a,limit:r,total:l,totalPages:Math.ceil(l/r)}})}catch(e){return console.error("Admin Transactions API Error:",e),o.NextResponse.json({error:"Failed to fetch transactions"},{status:500})}}let d=new n.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/admin/transactions/route",pathname:"/api/admin/transactions",filename:"route",bundlePath:"app/api/admin/transactions/route"},resolvedPagePath:"C:\\Users\\MSI\\Downloads\\film\\app\\api\\admin\\transactions\\route.ts",nextConfigOutput:"standalone",userland:r}),{requestAsyncStorage:l,staticGenerationAsyncStorage:m,serverHooks:g}=d,h="/api/admin/transactions/route";function x(){return(0,i.patchFetch)({serverHooks:g,staticGenerationAsyncStorage:m})}},72331:(e,t,a)=>{a.d(t,{_:()=>n});var r=a(53524);let n=global.prisma||new r.PrismaClient}};var t=require("../../../../webpack-runtime.js");t.C(e);var a=e=>t(t.s=e),r=t.X(0,[8948,5972],()=>a(25559));module.exports=r})();