import { defineStore } from "pinia";
import { order } from "@/types";

export const useOrdersStore = defineStore("orders", {
    state: (): {
        orders: order[];
    } => ({
        orders: [],
    }),
    getters: {
        favouriteOrders: (state) => state.orders.filter((x) => x.favourite),
    },
    actions: {
        createOrder(order: order) {
            this.orders.push(order);
        },
    },
});
