Compare commits

..

5 Commits

6 changed files with 42 additions and 5 deletions
+1
View File
@@ -30,6 +30,7 @@ services:
- ./supabase/migrations/13-rental-type-daily-and-email-guard.sql:/sql/13-rental-type-daily-and-email-guard.sql:ro
- ./supabase/migrations/14-email-requested-trigger.sql:/sql/14-email-requested-trigger.sql:ro
- ./supabase/migrations/15-individuell-vat-subtotal-fix.sql:/sql/15-individuell-vat-subtotal-fix.sql:ro
- ./supabase/migrations/16-rental-type-weekend-gap-fix.sql:/sql/16-rental-type-weekend-gap-fix.sql:ro
kong:
volumes:
+7 -3
View File
@@ -223,6 +223,7 @@ services:
- /mnt/user/appdata/mc-cars/supabase/migrations/13-rental-type-daily-and-email-guard.sql:/sql/13-rental-type-daily-and-email-guard.sql:ro
- /mnt/user/appdata/mc-cars/supabase/migrations/14-email-requested-trigger.sql:/sql/14-email-requested-trigger.sql:ro
- /mnt/user/appdata/mc-cars/supabase/migrations/15-individuell-vat-subtotal-fix.sql:/sql/15-individuell-vat-subtotal-fix.sql:ro
- /mnt/user/appdata/mc-cars/supabase/migrations/16-rental-type-weekend-gap-fix.sql:/sql/16-rental-type-weekend-gap-fix.sql:ro
entrypoint: ["sh","-c"]
command:
- |
@@ -254,6 +255,7 @@ services:
psql "postgresql://postgres:$$PGPASSWORD@db:5432/postgres" -v ON_ERROR_STOP=1 -f /sql/13-rental-type-daily-and-email-guard.sql
psql "postgresql://postgres:$$PGPASSWORD@db:5432/postgres" -v ON_ERROR_STOP=1 -f /sql/14-email-requested-trigger.sql
psql "postgresql://postgres:$$PGPASSWORD@db:5432/postgres" -v ON_ERROR_STOP=1 -f /sql/15-individuell-vat-subtotal-fix.sql
psql "postgresql://postgres:$$PGPASSWORD@db:5432/postgres" -v ON_ERROR_STOP=1 -f /sql/16-rental-type-weekend-gap-fix.sql
echo "post-init done."
restart: "no"
networks: [mccars]
@@ -349,10 +351,11 @@ services:
environment:
SUPABASE_URL: ${SUPABASE_PUBLIC_URL}
SUPABASE_ANON_KEY: ${ANON_KEY}
N8N_WEBHOOK_URL: ${N8N_WEBHOOK_URL}
volumes:
- /mnt/user/appdata/mc-cars/frontend:/usr/share/nginx/html
- /mnt/user/appdata/mc-cars/frontend/nginx.conf:/etc/nginx/conf.d/default.conf:ro
entrypoint: ["/bin/sh", "-c", "printf 'window.MCCARS_CONFIG={SUPABASE_URL:\"%s\",SUPABASE_ANON_KEY:\"%s\"};\\n' \"$$SUPABASE_URL\" \"$$SUPABASE_ANON_KEY\" > /usr/share/nginx/html/config.js && exec nginx -g 'daemon off;'"]
entrypoint: ["/bin/sh", "-c", "printf 'window.MCCARS_CONFIG={SUPABASE_URL:\"%s\",SUPABASE_ANON_KEY:\"%s\",N8N_WEBHOOK_URL:\"%s\"};\\n' \"$$SUPABASE_URL\" \"$$SUPABASE_ANON_KEY\" \"$$N8N_WEBHOOK_URL\" > /usr/share/nginx/html/config.js && exec nginx -g 'daemon off;'"]
ports:
- "55580:80"
networks: [mccars]
@@ -370,10 +373,11 @@ services:
environment:
SUPABASE_URL: ${SUPABASE_PUBLIC_URL}
SUPABASE_ANON_KEY: ${ANON_KEY}
N8N_WEBHOOK_URL: ${N8N_WEBHOOK_URL}
volumes:
- /mnt/user/appdata/mc-cars/frontend:/usr/share/nginx/html
- /mnt/user/appdata/mc-cars/frontend/nginx-admin.conf:/etc/nginx/conf.d/default.conf:ro
entrypoint: ["/bin/sh", "-c", "printf 'window.MCCARS_CONFIG={SUPABASE_URL:\"%s\",SUPABASE_ANON_KEY:\"%s\"};\\n' \"$$SUPABASE_URL\" \"$$SUPABASE_ANON_KEY\" > /usr/share/nginx/html/config.js && exec nginx -g 'daemon off;'"]
entrypoint: ["/bin/sh", "-c", "printf 'window.MCCARS_CONFIG={SUPABASE_URL:\"%s\",SUPABASE_ANON_KEY:\"%s\",N8N_WEBHOOK_URL:\"%s\"};\\n' \"$$SUPABASE_URL\" \"$$SUPABASE_ANON_KEY\" \"$$N8N_WEBHOOK_URL\" > /usr/share/nginx/html/config.js && exec nginx -g 'daemon off;'"]
ports:
- "55581:80"
networks: [mccars]
@@ -397,7 +401,7 @@ services:
N8N_HOST: 0.0.0.0
N8N_PORT: 5678
N8N_PROTOCOL: http
WEBHOOK_URL: ${WEBHOOK_DOMAIN:-http://localhost:55590}/
WEBHOOK_URL: http://localhost:55590/
N8N_ENCRYPTION_KEY: ${N8N_ENCRYPTION_KEY}
N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS: "false"
N8N_SECURE_COOKIE: "false"
+2
View File
@@ -123,6 +123,8 @@ async function loadVehicles() {
state.vehicles = data || [];
statCarsCount.textContent = state.vehicles.length;
statCarsLabel.dataset.i18n = state.vehicles.length === 1 ? 'statCar' : 'statCars';
applyI18n();
const brands = [...new Set(state.vehicles.map(v => v.brand))].sort();
brandFilter.innerHTML = `<option value="all">${t("all")}</option>` +
+2
View File
@@ -15,6 +15,7 @@ export const translations = {
statDeposit: "Faire Kaution",
statSupport: "Support",
statCars: "Fahrzeuge",
statCar: "Fahrzeug",
fleetEyebrow: "Unsere Flotte",
fleetTitle: "Handverlesen. Gepflegt. Startklar.",
@@ -264,6 +265,7 @@ export const translations = {
statDeposit: "Fair Deposit",
statSupport: "Support",
statCars: "Vehicles",
statCar: "Vehicle",
fleetEyebrow: "Our Fleet",
fleetTitle: "Hand-picked. Maintained. Ready.",
+2 -2
View File
@@ -136,8 +136,8 @@
<div class="hero-stats">
<div><strong data-i18n="statDeposit">Faire Kaution</strong><span>Fair Deposit</span></div>
<div><strong id="statCarsCount"></strong><span data-i18n="statCars">Fahrzeuge</span></div>
<div><strong>24/7</strong><span data-i18n="statSupport">Support</span></div>
<div><strong id="statCarsCount"></strong><span id="statCarsLabel" data-i18n="statCars">Fahrzeuge</span></div>
<div><strong>24/7</strong><span data-i18n="statSupport">Support</span></div>
</div>
</div>
</section>
@@ -0,0 +1,28 @@
-- 16-rental-type-weekend-gap-fix.sql
-- Fix misclassified long rentals that were stored as 'weekend'.
-- Business rule: only true weekend package may remain 'weekend'; long spans are 'individuell'.
-- Leads: any weekend booking longer than 2 days must be individuell.
update public.leads
set rental_type = 'individuell'
where coalesce(lower(trim(rental_type)), 'weekend') = 'weekend'
and coalesce(total_days, 0) > 2;
-- Sales orders: same correction.
update public.sales_orders
set rental_type = 'individuell'
where coalesce(lower(trim(rental_type)), 'weekend') = 'weekend'
and coalesce(total_days, 0) > 2;
-- If old rows have unknown/legacy values and >2 days, normalize to individuell as well.
update public.leads
set rental_type = 'individuell'
where coalesce(total_days, 0) > 2
and coalesce(lower(trim(rental_type)), '') not in ('individuell', 'weekend', 'single_day');
update public.sales_orders
set rental_type = 'individuell'
where coalesce(total_days, 0) > 2
and coalesce(lower(trim(rental_type)), '') not in ('individuell', 'weekend', 'single_day');
notify pgrst, 'reload schema';