81 lines
1.6 KiB
TypeScript
81 lines
1.6 KiB
TypeScript
import { defineStore } from 'pinia';
|
|
|
|
// const boatSource = null;
|
|
|
|
export interface Boat {
|
|
id: number;
|
|
name: string;
|
|
class?: string;
|
|
year?: number;
|
|
imgsrc?: string;
|
|
iconsrc?: string;
|
|
booking?: {
|
|
available: boolean;
|
|
requiredCerts: string[];
|
|
maxDuration: number;
|
|
maxPassengers: number;
|
|
};
|
|
defects?: {
|
|
type: string;
|
|
severity: string;
|
|
description: string;
|
|
detail?: string;
|
|
}[];
|
|
}
|
|
|
|
const getSampleData = () => [
|
|
{
|
|
id: 1,
|
|
name: 'ProjectX',
|
|
class: 'J/27',
|
|
year: 1981,
|
|
imgsrc: '/src/assets/j27.png',
|
|
iconsrc: '/src/assets/projectx_avatar256.png',
|
|
defects: [
|
|
{
|
|
type: 'engine',
|
|
severity: 'moderate',
|
|
description: 'Fuel line leaks at engine fitting.',
|
|
detail: `The gasket in the end of the fuel hose is damaged, and does not properly seal.
|
|
This will cause fuel to leak, and will allow air into the fuel chamber, causing a lean mixture,
|
|
and rough engine performance.`,
|
|
},
|
|
{
|
|
type: 'rigging',
|
|
severity: 'moderate',
|
|
description: 'Tiller extension is broken.',
|
|
detail:
|
|
'The tiller extension swivel is broken, and will not attach to the tiller.',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
id: 2,
|
|
name: 'Take5',
|
|
class: 'J/27',
|
|
year: 1985,
|
|
imgsrc: '/src/assets/j27.png',
|
|
iconsrc: '/src/assets/take5_avatar32.png',
|
|
},
|
|
{
|
|
id: 3,
|
|
name: 'WeeBeestie',
|
|
class: 'Capri 25',
|
|
year: 1989,
|
|
imgsrc: '/src/assets/capri25.png',
|
|
},
|
|
];
|
|
|
|
export const useBoatStore = defineStore('boat', {
|
|
state: () => ({
|
|
boats: getSampleData(),
|
|
}),
|
|
|
|
getters: {},
|
|
|
|
actions: {
|
|
// update () {
|
|
// }
|
|
},
|
|
});
|