init task record store

This commit is contained in:
Julien Calixte
2023-04-10 12:19:50 +02:00
parent f432c60737
commit 5d2240400b
2 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
<script setup lang="ts">
const props = defineProps<{
taskId: string
}>()
</script>
<template>
<div class="task-record"></div>
</template>
<style scoped lang="scss">
.task-record {
}
</style>

View File

@@ -0,0 +1,20 @@
import { defineStore } from 'pinia'
import type { Recordable } from '../interfaces/recordable'
interface StoredTaskRecordable
extends Omit<Recordable, 'start' | 'end' | 'stepRecords'> {
start: string
end?: string
stepRecords: Record<string, { start: string; end?: string }>
}
export interface TaskRecordStoreState {
records: { [taskId: string]: StoredTaskRecordable[] }
}
export const useTaskRecordStore = defineStore('task-record-store', {
persist: true,
state: (): TaskRecordStoreState => ({
records: {}
})
})