ETASCOM CRM V3 - Documentation API
    Preparing search index...
    • POST(
          request: NextRequest,
      ): Promise<
          | NextResponse<{ error: string; message: string }>
          | NextResponse<
              {
                  success: boolean;
                  message: string;
                  equipment: {
                      id: string;
                      name: string;
                      code: string;
                      description: string
                      | null;
                      type: string;
                      status: string;
                      brand: string | null;
                      model: string | null;
                      serialNumber: string | null;
                      qrCode: string | null;
                      location: string | null;
                      lastMaintenance: Date | null;
                      nextMaintenance: Date | null;
                      isActive: boolean;
                      createdAt: Date;
                      updatedAt: Date;
                  };
                  workStation: | {
                      id: string;
                      name: string;
                      code: string;
                      location: string
                      | null;
                      capacity: number | null;
                      costPerHour: number | null;
                      efficiency: number;
                      status: string;
                  }
                  | null;
                  maintenance: null;
                  currentOperation: null;
                  availability: { isAvailable: boolean; reason: string };
                  scanInfo: {
                      scannedAt: string;
                      scannedBy: { id: string; name: string | null; email: string };
                      hasPermission: boolean;
                  };
              },
          >,
      >

      API Tablette - Scanner un Équipement

      POST /api/tablet/equipment/scan

      Body:

      • code: string (code-barre de l'équipement)
      • userId: string (ID de l'utilisateur connecté)
      • metadata?: object (données supplémentaires)

      Réponse:

      • equipment: object (détails de l'équipement)
      • workStation: object (poste de travail associé)
      • maintenance: object (dernière maintenance)
      • status: string (statut de l'équipement)
      • availability: boolean (disponibilité)

      Parameters

      • request: NextRequest

      Returns Promise<
          | NextResponse<{ error: string; message: string }>
          | NextResponse<
              {
                  success: boolean;
                  message: string;
                  equipment: {
                      id: string;
                      name: string;
                      code: string;
                      description: string
                      | null;
                      type: string;
                      status: string;
                      brand: string | null;
                      model: string | null;
                      serialNumber: string | null;
                      qrCode: string | null;
                      location: string | null;
                      lastMaintenance: Date | null;
                      nextMaintenance: Date | null;
                      isActive: boolean;
                      createdAt: Date;
                      updatedAt: Date;
                  };
                  workStation: | {
                      id: string;
                      name: string;
                      code: string;
                      location: string
                      | null;
                      capacity: number | null;
                      costPerHour: number | null;
                      efficiency: number;
                      status: string;
                  }
                  | null;
                  maintenance: null;
                  currentOperation: null;
                  availability: { isAvailable: boolean; reason: string };
                  scanInfo: {
                      scannedAt: string;
                      scannedBy: { id: string; name: string | null; email: string };
                      hasPermission: boolean;
                  };
              },
          >,
      >