diff --git a/src/modules/record/components/TaskRecord.vue b/src/modules/record/components/TaskRecord.vue
index 4e75f73..2dc9273 100644
--- a/src/modules/record/components/TaskRecord.vue
+++ b/src/modules/record/components/TaskRecord.vue
@@ -21,6 +21,7 @@ const task = computed(() => taskStore.getTask(props.taskId))
const record = computed(() =>
recordStore.createAndRetrieveTaskRecord(props.taskId, props.recordId)
)
+const recordNotes = computed(() => recordStore.getRecordNotes(props.recordId))
const { duration } = useTaskRecordMetadata(record)
const getNextStepId = () => {
@@ -137,6 +138,18 @@ const isSuperiorToEstimation = computed(() => {
than expected.
+
diff --git a/src/modules/record/interfaces/recordable.ts b/src/modules/record/interfaces/recordable.ts
index 38029ca..bedb6bd 100644
--- a/src/modules/record/interfaces/recordable.ts
+++ b/src/modules/record/interfaces/recordable.ts
@@ -11,4 +11,5 @@ export interface Recordable {
start: ISODate
end?: ISODate
stepRecords: Record
+ notes: string
}
diff --git a/src/modules/record/models/task-record.ts b/src/modules/record/models/task-record.ts
index 663a76f..b43b84a 100644
--- a/src/modules/record/models/task-record.ts
+++ b/src/modules/record/models/task-record.ts
@@ -6,6 +6,7 @@ export class TaskRecord implements Recordable {
public start: ISODate = toISODate(new Date())
public end: ISODate | undefined = undefined
public stepRecords: Record = {}
+ public notes = ''
public constructor(
public readonly id: string,
diff --git a/src/modules/record/stores/useTaskRecordStore.ts b/src/modules/record/stores/useTaskRecordStore.ts
index 09733d5..5e1713c 100644
--- a/src/modules/record/stores/useTaskRecordStore.ts
+++ b/src/modules/record/stores/useTaskRecordStore.ts
@@ -85,6 +85,21 @@ export const useTaskRecordStore = defineStore('task-record-store', {
endRecord(recordId: string) {
this.records[recordId].end = toISODate(new Date())
this.currentStepId = null
+ },
+ updateRecordNotes(recordId: string, notes: string) {
+ const record = this.records[recordId]
+
+ if (record) {
+ this.$patch({
+ records: {
+ ...this.records,
+ [recordId]: {
+ ...record,
+ notes
+ }
+ }
+ })
+ }
}
},
getters: {
@@ -109,11 +124,14 @@ export const useTaskRecordStore = defineStore('task-record-store', {
}
},
getRecord() {
- return (recordId: string) => this.records?.[recordId] ?? null
+ return (recordId: string) => this.records[recordId] ?? null
},
getStepRecord() {
return (recordId: string, stepId: string): StepRecordable | null =>
- this.records?.[recordId]?.stepRecords[stepId] ?? null
+ this.records[recordId]?.stepRecords[stepId] ?? null
+ },
+ getRecordNotes() {
+ return (recordId: string): string => this.records[recordId]?.notes ?? ''
}
}
})