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,36 @@
/** Pinia store for shuttle management (Intercity/Tourism) */
import { defineStore } from 'pinia'
import { ref } from 'vue'
import type { Shuttle } from '@/types'
import { shuttlesService, type ShuttleFilters } from '@/services/shuttlesService'
export const useShuttleStore = defineStore('shuttle', () => {
const shuttles = ref<Shuttle[]>([])
const isLoading = ref(false)
const error = ref<string | null>(null)
const filters = ref<ShuttleFilters>({})
async function loadShuttles(newFilters?: ShuttleFilters) {
isLoading.value = true
error.value = null
if (newFilters) {
filters.value = newFilters
}
try {
shuttles.value = await shuttlesService.getAllShuttles(filters.value)
} catch (e) {
error.value = e instanceof Error ? e.message : 'Failed to load shuttles'
console.error('Error loading shuttles:', e)
} finally {
isLoading.value = false
}
}
return {
shuttles,
isLoading,
error,
filters,
loadShuttles,
}
})