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