"use strict";(()=>{var e={};e.id=733,e.ids=[733],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")},47574:(e,t,r)=>{r.r(t),r.d(t,{originalPathname:()=>g,patchFetch:()=>x,requestAsyncStorage:()=>l,routeModule:()=>p,serverHooks:()=>v,staticGenerationAsyncStorage:()=>m});var a={};r.r(a),r.d(a,{GET:()=>d,dynamic:()=>c});var n=r(49303),s=r(88716),o=r(60670),i=r(87070),u=r(13538);let c="force-dynamic";async function d(){try{let e=new Date;e.setUTCHours(0,0,0,0);let t=await u.Z.student.count(),r=await u.Z.gateScan.groupBy({by:["status"],where:{date:e},_count:{id:!0}}),a=0,n=0,s=0;for(let e of r)"PRESENT"===e.status?a=e._count.id:"LATE"===e.status?n=e._count.id:"ABSENT"===e.status&&(s=e._count.id);let o=a+n+s;return i.NextResponse.json({date:e.toISOString(),totalStudents:t,present:a,late:n,absent:s,unaccounted:t-o,scannedTotal:o})}catch(e){return console.error("[AttendanceStats] Error:",e),i.NextResponse.json({error:"Internal Server Error",message:String(e)},{status:500})}}let p=new n.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/v1/attendance/stats/route",pathname:"/api/v1/attendance/stats",filename:"route",bundlePath:"app/api/v1/attendance/stats/route"},resolvedPagePath:"C:\\School Management System\\Working\\V2\\src\\app\\api\\v1\\attendance\\stats\\route.ts",nextConfigOutput:"standalone",userland:a}),{requestAsyncStorage:l,staticGenerationAsyncStorage:m,serverHooks:v}=p,g="/api/v1/attendance/stats/route";function x(){return(0,o.patchFetch)({serverHooks:v,staticGenerationAsyncStorage:m})}},49303:(e,t,r)=>{e.exports=r(30517)},13538:(e,t,r)=>{r.d(t,{Z:()=>n});var a=r(53524);let n=globalThis.prisma??new a.PrismaClient({log:["error"],datasources:{db:{url:process.env.DATABASE_URL}}})}};var t=require("../../../../../webpack-runtime.js");t.C(e);var r=e=>t(t.s=e),a=t.X(0,[8948,7070],()=>r(47574));module.exports=a})();