ETASCOM CRM V3 - Documentation API
    Preparing search index...
    • GET /api/mobile/opportunities

      Récupère la liste des affaires avec filtres optionnels

      Query params:

      • page?: number (défaut: 1)
      • limit?: number (défaut: 20)
      • search?: string
      • stage?: string
      • status?: string
      • userId?: string (créateur)

      Parameters

      • req: NextRequest

      Returns Promise<
          | NextResponse<{ success: boolean; error: string; message: string }>
          | NextResponse<
              {
                  success: boolean;
                  opportunities: {
                      id: string;
                      number: string;
                      name: string;
                      codeVehicle: string
                      | null;
                      stage: BusinessOpportunityStage;
                      status: OpportunityStatus;
                      expectedRevenue: number | null;
                      actualRevenue: number | null;
                      probability: number | null;
                      client:
                          | {
                              email: string
                              | null;
                              id: string;
                              name: string;
                              phone: string | null;
                          }
                          | null;
                      lead: | {
                          companyName: string
                          | null;
                          email: string | null;
                          id: string;
                          name: string;
                          phone: string | null;
                      }
                      | null;
                      createdBy: { email: string; id: string; name: string | null }
                      | null;
                      technician: { id: string; name: string | null } | null;
                      adv: { id: string; name: string | null } | null;
                      keyAccountManager: { id: string; name: string | null } | null;
                      importanceType: string | null;
                      contextRevenue: boolean;
                      contextClient: boolean;
                      contextProduct: boolean;
                      majorClass: string | null;
                      counts: { actions: number; offers: number; orders: number };
                      createdAt: string;
                      updatedAt: string;
                  }[];
                  pagination: { page: number; limit: number; total: number; pages: number };
              },
          >,
      >