"use strict";(()=>{var e={};e.id=5615,e.ids=[5615],e.modules={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")},50951:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>g,patchFetch:()=>x,requestAsyncStorage:()=>l,routeModule:()=>p,serverHooks:()=>m,staticGenerationAsyncStorage:()=>c});var s={};r.r(s),r.d(s,{GET:()=>d});var a=r(49303),n=r(88716),o=r(60670),i=r(87070),u=r(8194);async function d(e){try{let t=e.nextUrl.searchParams.get("sessionId"),r=e.nextUrl.searchParams.get("tenantSlug"),s=e.nextUrl.searchParams.get("storeSlug");if(!t||!r||!s)return i.NextResponse.json({error:"Missing parameters"},{status:400});let a=await u._.tenant.findUnique({where:{slug:r}});if(!a)return i.NextResponse.json({error:"Tenant not found"},{status:404});let n=await u._.store.findFirst({where:{tenantId:a.id,slug:s}});if(!n)return i.NextResponse.json({error:"Store not found"},{status:404});let o=new Date(Date.now()-864e5),d=await u._.order.findMany({where:{customerSessionId:t,tenantId:a.id,storeId:n.id,createdAt:{gte:o}},include:{items:{include:{menuItem:{select:{name:!0,image:!0}},selectedVariants:!0}},table:{select:{number:!0}}},orderBy:{createdAt:"desc"}});return i.NextResponse.json({orders:d})}catch(e){return console.error("Order status error:",e),i.NextResponse.json({error:"Server error"},{status:500})}}let p=new a.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/public/orders/status/route",pathname:"/api/public/orders/status",filename:"route",bundlePath:"app/api/public/orders/status/route"},resolvedPagePath:"D:\\PROJECT\\resto-saas\\src\\app\\api\\public\\orders\\status\\route.ts",nextConfigOutput:"",userland:s}),{requestAsyncStorage:l,staticGenerationAsyncStorage:c,serverHooks:m}=p,g="/api/public/orders/status/route";function x(){return(0,o.patchFetch)({serverHooks:m,staticGenerationAsyncStorage:c})}},8194:(e,t,r)=>{r.d(t,{_:()=>a});let s=require("@prisma/client"),a=globalThis.prisma??new s.PrismaClient}};var t=require("../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),s=t.X(0,[8948,5972],()=>r(50951));module.exports=s})();