import db from "../src/lib/db.js"; // Create projects with different statuses and locations around Poland const testProjects = [ { name: "Gdansk Port Project", address: "Port of Gdansk, Gdansk", city: "Gdansk", coordinates: "54.3520,18.6466", status: "registered", type: "design", }, { name: "Wroclaw Shopping Center", address: "Market Square, Wroclaw", city: "Wroclaw", coordinates: "51.1079,17.0385", status: "in_progress_design", type: "design+construction", }, { name: "Poznan Office Complex", address: "Old Town, Poznan", city: "Poznan", coordinates: "52.4064,16.9252", status: "in_progress_construction", type: "construction", }, { name: "Lodz Residential Development", address: "City Center, Lodz", city: "Lodz", coordinates: "51.7592,19.4600", status: "fulfilled", type: "design+construction", }, { name: "Katowice Industrial Park", address: "Silesia Region, Katowice", city: "Katowice", coordinates: "50.2649,19.0238", status: "in_progress_design", type: "design", }, { name: "Lublin University Campus", address: "University District, Lublin", city: "Lublin", coordinates: "51.2465,22.5684", status: "fulfilled", type: "construction", }, ]; let projectCounter = 3; // Starting from 3 since we already have projects 1 and 2 testProjects.forEach((project) => { try { const result = db .prepare( ` INSERT INTO projects ( contract_id, project_name, project_number, address, city, coordinates, project_type, project_status ) VALUES (?, ?, ?, ?, ?, ?, ?, ?) ` ) .run( 2, // Use the test contract project.name, `${projectCounter}/TEST/2025`, project.address, project.city, project.coordinates, project.type, project.status ); console.log( `Created project: ${project.name} (ID: ${result.lastInsertRowid}) - Status: ${project.status}` ); projectCounter++; } catch (error) { console.error(`Error creating project ${project.name}:`, error.message); } }); console.log("Diverse test projects created successfully!");