ETASCOM CRM V3 - Documentation API
    Preparing search index...
    • Parameters

      • request: NextRequest

      Returns Promise<
          | NextResponse<{ error: string }>
          | NextResponse<
              {
                  total: number;
                  active: number;
                  inactive: number;
                  suppliers: number;
                  subcontractors: number;
                  totalPurchaseAmount: number;
                  averageOrderValue: number;
                  topSuppliersByAmount: {
                      _count: { purchaseOrders: number };
                      code: string;
                      id: string;
                      name: string;
                      orderCount: number;
                  }[];
                  topSuppliersByCount: {
                      _count: { purchaseOrders: number };
                      code: string;
                      id: string;
                      name: string;
                      orderCount: number;
                  }[];
                  typeDistribution: { type: string; count: number }[];
                  statusDistribution: { isActive: boolean; count: number }[];
                  monthlyEvolution: { month: string; count: number }[];
                  recentOrders: {
                      id: string;
                      number: string;
                      orderDate: Date;
                      status: string;
                      supplier: { code: string; id: string; name: string };
                      totalAmount: number;
                  }[];
              },
          >,
      >