Add vehicle repair functionality in Falukant module
- Implemented a new repairVehicle method in FalukantService to handle vehicle repairs, including cost calculation and precondition checks. - Updated FalukantController to expose the repairVehicle endpoint, allowing users to initiate repairs via the API. - Enhanced FalukantRouter to include a new route for vehicle repairs. - Modified BranchView component to add UI elements for repairing vehicles, including a dialog for repair confirmation and displaying repair details. - Updated German localization files to include translations related to vehicle repair actions, improving user experience for German-speaking users.
This commit is contained in:
@@ -133,6 +133,45 @@ const syncDatabaseForDeployment = async () => {
|
||||
console.warn('⚠️ Konnte traffic_light-Spalte nicht vorab sicherstellen:', e?.message || e);
|
||||
}
|
||||
|
||||
// Migration: Transport product_id und size nullable machen
|
||||
console.log("Making transport product_id and size nullable...");
|
||||
try {
|
||||
await sequelize.query(`
|
||||
DO $$
|
||||
BEGIN
|
||||
-- Prüfe ob product_id NOT NULL Constraint existiert
|
||||
IF EXISTS (
|
||||
SELECT 1 FROM information_schema.columns
|
||||
WHERE table_schema = 'falukant_data'
|
||||
AND table_name = 'transport'
|
||||
AND column_name = 'product_id'
|
||||
AND is_nullable = 'NO'
|
||||
) THEN
|
||||
ALTER TABLE falukant_data.transport
|
||||
ALTER COLUMN product_id DROP NOT NULL;
|
||||
RAISE NOTICE 'product_id NOT NULL Constraint entfernt';
|
||||
END IF;
|
||||
|
||||
-- Prüfe ob size NOT NULL Constraint existiert
|
||||
IF EXISTS (
|
||||
SELECT 1 FROM information_schema.columns
|
||||
WHERE table_schema = 'falukant_data'
|
||||
AND table_name = 'transport'
|
||||
AND column_name = 'size'
|
||||
AND is_nullable = 'NO'
|
||||
) THEN
|
||||
ALTER TABLE falukant_data.transport
|
||||
ALTER COLUMN size DROP NOT NULL;
|
||||
RAISE NOTICE 'size NOT NULL Constraint entfernt';
|
||||
END IF;
|
||||
END
|
||||
$$;
|
||||
`);
|
||||
console.log("✅ Transport product_id und size sind jetzt nullable");
|
||||
} catch (e) {
|
||||
console.warn('⚠️ Konnte Transport-Spalten nicht nullable machen:', e?.message || e);
|
||||
}
|
||||
|
||||
console.log("Setting up associations...");
|
||||
setupAssociations();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user