checkpoint

This commit is contained in:
2025-12-13 22:55:52 +01:00
parent 0d56d26afa
commit d81fb834c7
7 changed files with 187 additions and 20 deletions

View File

@@ -7,6 +7,7 @@ import { Spending } from '@/services/Spending'
export const useBoardStore = defineStore('boardStore', () => {
const route = useRoute()
const boards = new Map<string, Board>()
let testBoard: Board | undefined
function createBoard(name: string): Board {
const newBoard = new Board(name)
@@ -19,15 +20,18 @@ export const useBoardStore = defineStore('boardStore', () => {
if (board != undefined) {
return board
} else {
const testBoard = new Board('Grill and Chill')
const elias = new User('Elias')
elias.addSpending(new Spending('Burger', 1230))
elias.addSpending(new Spending('Kaffee', 510))
testBoard.addUser(elias)
const max = new User('Max')
max.addSpending(new Spending('Omlett', 1822))
max.addSpending(new Spending('Kaffee', 3073))
testBoard.addUser(max)
if (testBoard === undefined) {
testBoard = new Board('Grill and Chill')
const elias = new User('Elias')
elias.addSpending(new Spending('Burger', 1230))
elias.addSpending(new Spending('Kaffee', 510))
testBoard.addUser(elias)
const max = new User('Max')
max.addSpending(new Spending('Omlett', 1822))
max.addSpending(new Spending('Kaffee', 3073))
testBoard.addUser(max)
return testBoard
}
return testBoard
}
}