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

      Récupère les détails complets d'une affaire avec toutes ses relations

      Parameters

      • req: NextRequest
      • __namedParameters: { params: Promise<{ id: string }> }

      Returns Promise<
          | NextResponse<{ success: boolean; error: string; message: string }>
          | NextResponse<
              {
                  success: boolean;
                  opportunity: {
                      id: string;
                      number: string;
                      name: string;
                      codeVehicle: string
                      | null;
                      stage: BusinessOpportunityStage;
                      status: OpportunityStatus;
                      expectedRevenue: number | null;
                      actualRevenue: number | null;
                      probability: number | null;
                      rfqDate: string | undefined;
                      offerSentDate: string | undefined;
                      sopDate: string | undefined;
                      eopDate: string | undefined;
                      notes: string | null;
                      client:
                          | {
                              addresses: {
                                  city: string
                                  | null;
                                  country: string | null;
                                  id: string;
                                  postalCode: string | null;
                                  street: string | null;
                                  type: string;
                              }[];
                              contacts: {
                                  email: string
                                  | null;
                                  firstName: string;
                                  id: string;
                                  lastName: string;
                                  phone: string | null;
                                  position: string | null;
                              }[];
                              email: string
                              | null;
                              id: string;
                              name: string;
                              phone: string | null;
                              website: string | null;
                          }
                          | null;
                      lead: | {
                          companyName: string
                          | null;
                          email: string | null;
                          id: string;
                          name: string;
                          phone: string | null;
                          source: string | null;
                          status: string;
                          website: string | null;
                      }
                      | null;
                      createdBy: { email: string; id: string; name: string | null }
                      | null;
                      technician: { email: string; id: string; name: string | null } | null;
                      adv: { email: string; id: string; name: string | null } | null;
                      keyAccountManager:
                          | { email: string; id: string; name: string
                          | null }
                          | null;
                      company: { id: string; name: string } | null;
                      importanceType: string | null;
                      contextRevenue: boolean;
                      contextClient: boolean;
                      contextProduct: boolean;
                      majorClass: string | null;
                      actions: {
                          id: string;
                          description: string | null;
                          nextAction: string | null;
                          actionDate: string;
                          isTechnical: boolean;
                          isPricingRelated: boolean;
                          isTimeSensitive: boolean;
                          user: { id: string; name: string | null };
                      }[];
                      salesOffers: {
                          id: string;
                          number: string;
                          status: SalesOfferStatus;
                          createdAt: string;
                      }[];
                      salesOrders: {
                          id: string;
                          number: string;
                          status: SalesOrderStatus;
                          createdAt: string;
                      }[];
                      counts: {
                          actions: number;
                          forecasts: number;
                          offers: number;
                          orders: number;
                      };
                      createdAt: string;
                      updatedAt: string;
                  };
              },
          >,
      >