A Next.js API route for applying adaptive rules in the Sophra system
POST
function is the main export of this component. It handles incoming HTTP POST requests and returns a NextResponse
.
req: NextRequest
- The incoming request object from Next.jsPromise<NextResponse>
- A promise that resolves to a Next.js response object
Data Flow
Request Validation Errors
Database Errors
Adaptation Engine Errors
findMany
with filtersDate.now()
for lightweight performance timingPOSTGRESQL_URL
: Connection string for the Prisma database clientAdaptationRule
model with the necessary fields (id, enabled, etc.).