style: fix no-explicit-any — replace with proper TypeScript types

This commit is contained in:
2026-06-25 14:46:51 +01:00
parent 6291d04b47
commit a8d04b77e2
6 changed files with 10 additions and 9 deletions
@@ -11,7 +11,7 @@
import { Input } from '$lib/components/ui/input';
import { Textarea } from '$lib/components/ui/textarea';
import CharCounter from '$lib/components/ui/CharCounter.svelte';
import type { Booking, BookingService, Service } from '$lib/types/booking';
import type { Booking, BookingService, Payment, Service } from '$lib/types/booking';
interface Props {
open: boolean;
@@ -112,7 +112,7 @@
override_price: s.override_price,
override_duration_minutes: s.override_duration_minutes
})),
payments: (data.payments || []).map((p: any) => ({
payments: (data.payments || []).map((p: Payment) => ({
id: p.id,
booking_id: p.booking_id,
payment_type: p.payment_type,
@@ -151,13 +151,13 @@
if (data === null || data.length === 0) {
return;
}
exceptionGroups = data.map((group: any) => ({
exceptionGroups = data.map((group: ExceptionGroup) => ({
id: group.id,
name: group.name,
description: group.description,
weekStarts: group.weekStarts || [],
hours:
group.hours?.map((h: any) => ({
group.hours?.map((h: { id: number; weekday: number; startTime: string; endTime: string; isOpen: boolean }) => ({
id: h.id,
weekday: h.weekday,
start_time: formatTime(h.startTime),
@@ -363,7 +363,7 @@
if (response.ok) {
const data = await response.json();
const list = data.services || data;
customServices = list.map((cs: any) => ({ ...cs, is_custom: true }));
customServices = list.map((cs: CustomService) => ({ ...cs, is_custom: true }));
}
} catch {
console.error('Failed to fetch custom services');
@@ -112,7 +112,7 @@
if (response.ok) {
const data = await response.json();
defaultHours = data.map((hour: any) => ({
defaultHours = data.map((hour: { weekday: number; startTime: string; endTime: string; isOpen: boolean }) => ({
weekday: hour.weekday,
start_time: formatTime(hour.startTime),
end_time: formatTime(hour.endTime),