"use strict";(()=>{var e={};e.id=3016,e.ids=[3016],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")},61392:(e,t,a)=>{a.r(t),a.d(t,{originalPathname:()=>g,patchFetch:()=>h,requestAsyncStorage:()=>m,routeModule:()=>p,serverHooks:()=>v,staticGenerationAsyncStorage:()=>l});var n={};a.r(n),a.d(n,{GET:()=>u,dynamic:()=>c});var s=a(49303),r=a(88716),o=a(60670),i=a(87070),d=a(13538);let c="force-dynamic";async function u(){try{let e=new Date;e.setUTCHours(0,0,0,0);let t=(await d.Z.gateScan.findMany({where:{date:e,status:{not:"ABSENT"}},include:{student:{select:{name:!0,surname:!0,class:{select:{name:!0}}}}},orderBy:{timestamp:"desc"},take:50})).map(e=>({scanId:e.id,studentId:e.studentId,studentName:`${e.student.name} ${e.student.surname}`,className:e.student.class.name,status:e.status,confidence:e.confidence,deviceId:e.deviceId,time:e.timestamp.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),timestamp:e.timestamp.toISOString()}));return i.NextResponse.json({scans:t})}catch(e){return console.error("[AttendanceScans] Error:",e),i.NextResponse.json({error:"Internal Server Error",message:String(e)},{status:500})}}let p=new s.AppRouteRouteModule({definition:{kind:r.x.APP_ROUTE,page:"/api/v1/attendance/scans/route",pathname:"/api/v1/attendance/scans",filename:"route",bundlePath:"app/api/v1/attendance/scans/route"},resolvedPagePath:"C:\\School Management System\\Working\\V2\\src\\app\\api\\v1\\attendance\\scans\\route.ts",nextConfigOutput:"standalone",userland:n}),{requestAsyncStorage:m,staticGenerationAsyncStorage:l,serverHooks:v}=p,g="/api/v1/attendance/scans/route";function h(){return(0,o.patchFetch)({serverHooks:v,staticGenerationAsyncStorage:l})}},49303:(e,t,a)=>{e.exports=a(30517)},13538:(e,t,a)=>{a.d(t,{Z:()=>s});var n=a(53524);let s=globalThis.prisma??new n.PrismaClient({log:["error"],datasources:{db:{url:process.env.DATABASE_URL}}})}};var t=require("../../../../../webpack-runtime.js");t.C(e);var a=e=>t(t.s=e),n=t.X(0,[8948,7070],()=>a(61392));module.exports=n})();