ETASCOM CRM V3 - Documentation API
    Preparing search index...
    • POST(
          request: NextRequest,
      ): Promise<
          | NextResponse<{ error: string; message: string }>
          | NextResponse<
              {
                  success: boolean;
                  message: string;
                  data: {
                      material: {
                          id: string;
                          code: string;
                          name: string;
                          description: string
                          | null;
                          category: {} | null;
                          unitOfMeasure: {} | null;
                          currentStock: number;
                      };
                      manufacturingOrder: {
                          id: string;
                          number: string;
                          status: ManufacturingOrderStatus;
                      };
                      workstation: { id: string; code: string; name: string };
                      requirements: {
                          isRequired: boolean;
                          quantityNeeded: number;
                          quantityAvailable: number;
                          stockStatus: string;
                          bomEntry:
                              | {
                                  id: string;
                                  quantity: number;
                                  unit: string;
                                  efficiency: number;
                              }
                              | null;
                      };
                      scanInfo: {
                          scannedAt: string;
                          scannedBy: { id: string; name: string
                          | null; email: string };
                      };
                  };
              },
          >,
      >

      API Tablette - Scanner une Matière Première

      POST /api/tablet/material/scan

      Body:

      • code: string (code-barre de la matière première)
      • userId: string (ID de l'utilisateur connecté)
      • workOrderId: string (ID de l'OF en cours)
      • workstationId: string (ID du poste de travail)
      • metadata?: object (données supplémentaires)

      Réponse:

      • material: object (détails de la matière)
      • isRequired: boolean (si la matière est requise pour l'OF)
      • quantityNeeded: number (quantité nécessaire)
      • quantityAvailable: number (quantité disponible)
      • stockStatus: string (statut du stock)

      Parameters

      • request: NextRequest

      Returns Promise<
          | NextResponse<{ error: string; message: string }>
          | NextResponse<
              {
                  success: boolean;
                  message: string;
                  data: {
                      material: {
                          id: string;
                          code: string;
                          name: string;
                          description: string
                          | null;
                          category: {} | null;
                          unitOfMeasure: {} | null;
                          currentStock: number;
                      };
                      manufacturingOrder: {
                          id: string;
                          number: string;
                          status: ManufacturingOrderStatus;
                      };
                      workstation: { id: string; code: string; name: string };
                      requirements: {
                          isRequired: boolean;
                          quantityNeeded: number;
                          quantityAvailable: number;
                          stockStatus: string;
                          bomEntry:
                              | {
                                  id: string;
                                  quantity: number;
                                  unit: string;
                                  efficiency: number;
                              }
                              | null;
                      };
                      scanInfo: {
                          scannedAt: string;
                          scannedBy: { id: string; name: string
                          | null; email: string };
                      };
                  };
              },
          >,
      >