"use strict";(()=>{var e={};e.id=9328,e.ids=[9328],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")},85807:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>f,patchFetch:()=>x,requestAsyncStorage:()=>l,routeModule:()=>p,serverHooks:()=>v,staticGenerationAsyncStorage:()=>c});var a={};r.r(a),r.d(a,{POST:()=>d});var i=r(49303),s=r(88716),n=r(60670),o=r(87070),u=r(8194);async function d(e){try{let{tenantSlug:t,storeSlug:r,code:a}=await e.json();if(!t||!r||!a)return o.NextResponse.json({valid:!1,error:"Data tidak lengkap"},{status:400});let i=await u._.tenant.findUnique({where:{slug:t}});if(!i)return o.NextResponse.json({valid:!1,error:"Restoran tidak ditemukan"},{status:404});let s=await u._.store.findFirst({where:{tenantId:i.id,slug:r}});if(!s)return o.NextResponse.json({valid:!1,error:"Cabang tidak ditemukan"},{status:404});if(!await u._.accessCode.findFirst({where:{code:a.toUpperCase(),isActive:!0,expiresAt:{gt:new Date},storeId:s.id}}))return o.NextResponse.json({valid:!1,error:"Kode tidak valid atau sudah kedaluwarsa"});return o.NextResponse.json({valid:!0})}catch{return o.NextResponse.json({valid:!1,error:"Server error"},{status:500})}}let p=new i.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/public/verify-code/route",pathname:"/api/public/verify-code",filename:"route",bundlePath:"app/api/public/verify-code/route"},resolvedPagePath:"D:\\PROJECT\\resto-saas\\src\\app\\api\\public\\verify-code\\route.ts",nextConfigOutput:"",userland:a}),{requestAsyncStorage:l,staticGenerationAsyncStorage:c,serverHooks:v}=p,f="/api/public/verify-code/route";function x(){return(0,n.patchFetch)({serverHooks:v,staticGenerationAsyncStorage:c})}},8194:(e,t,r)=>{r.d(t,{_:()=>i});let a=require("@prisma/client"),i=globalThis.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(85807));module.exports=a})();