Initial commit: SIBU 2.0 MISSION

This commit is contained in:
2026-02-21 09:53:31 -05:00
commit 0c7aa53c8b
400 changed files with 67708 additions and 0 deletions

View File

@ -0,0 +1,46 @@
/** Pinia store for schedule management */
import { defineStore } from 'pinia'
import { ref } from 'vue'
import type { BusSchedule } from '@/types'
import { schedulesService } from '@/services/schedulesService'
export const useScheduleStore = defineStore('schedule', () => {
const schedules = ref<BusSchedule[]>([])
const isLoading = ref(false)
const error = ref<string | null>(null)
async function loadRouteSchedules(routeId: string) {
isLoading.value = true
error.value = null
try {
schedules.value = await schedulesService.getRouteSchedules(routeId)
} catch (e) {
error.value = e instanceof Error ? e.message : 'Failed to load schedules'
console.error('Error loading schedules:', e)
} finally {
isLoading.value = false
}
}
async function loadStopSchedules(stopId: string) {
isLoading.value = true
error.value = null
try {
schedules.value = await schedulesService.getStopSchedules(stopId)
} catch (e) {
error.value = e instanceof Error ? e.message : 'Failed to load schedules'
console.error('Error loading schedules:', e)
} finally {
isLoading.value = false
}
}
return {
schedules,
isLoading,
error,
loadRouteSchedules,
loadStopSchedules,
}
})