mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 15:52:10 +01:00
feat: add repository pattern, service layer architecture, and scheduler management
- Implement repository pattern for data access layer - Add comprehensive service layer for business logic - Create scheduler management system with health monitoring - Add bounded buffer utility for memory management - Enhance security audit logging with retention policies
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import type { CompanyStatus } from "@prisma/client";
|
||||
import { type NextRequest, NextResponse } from "next/server";
|
||||
import { getServerSession } from "next-auth";
|
||||
import { getServerSession, type Session } from "next-auth";
|
||||
import { platformAuthOptions } from "../../../../lib/platform-auth";
|
||||
import { prisma } from "../../../../lib/prisma";
|
||||
import { extractClientIP } from "../../../../lib/rateLimiter";
|
||||
@ -12,7 +12,7 @@ import {
|
||||
|
||||
// GET /api/platform/companies - List all companies
|
||||
export async function GET(request: NextRequest) {
|
||||
let session: any = null;
|
||||
let session: Session | null = null;
|
||||
|
||||
try {
|
||||
session = await getServerSession(platformAuthOptions);
|
||||
@ -139,7 +139,7 @@ export async function GET(request: NextRequest) {
|
||||
|
||||
// POST /api/platform/companies - Create new company
|
||||
export async function POST(request: NextRequest) {
|
||||
let session: any = null;
|
||||
let session: Session | null = null;
|
||||
|
||||
try {
|
||||
session = await getServerSession(platformAuthOptions);
|
||||
@ -229,7 +229,7 @@ export async function POST(request: NextRequest) {
|
||||
name: adminName,
|
||||
role: "ADMIN",
|
||||
companyId: company.id,
|
||||
invitedBy: session.user.email || "platform",
|
||||
invitedBy: session?.user?.email || "platform",
|
||||
invitedAt: new Date(),
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user