2024-03-16 00:36:44 +01:00
|
|
|
import type { Habit } from "./Habit"
|
|
|
|
import type { HabitProgress } from "./HabitProgress"
|
|
|
|
|
2024-03-22 10:23:28 +01:00
|
|
|
export interface HabitHistoryJSON {
|
2024-03-16 00:36:44 +01:00
|
|
|
habit: Habit
|
|
|
|
progressHistory: HabitProgress[]
|
|
|
|
}
|
|
|
|
|
2024-03-22 10:23:28 +01:00
|
|
|
export class HabitHistory implements HabitHistoryJSON {
|
2024-03-16 00:36:44 +01:00
|
|
|
public habit: Habit
|
|
|
|
public progressHistory: HabitProgress[]
|
|
|
|
|
2024-03-22 10:23:28 +01:00
|
|
|
public constructor(options: HabitHistoryJSON) {
|
2024-03-16 00:36:44 +01:00
|
|
|
const { habit, progressHistory } = options
|
|
|
|
this.habit = habit
|
|
|
|
this.progressHistory = progressHistory
|
|
|
|
}
|
|
|
|
}
|