1
1
mirror of https://github.com/theoludwig/p61-project.git synced 2024-07-17 07:00:12 +02:00
p61-project/data/domain/entities/HabitProgress.ts

25 lines
743 B
TypeScript

import type { GoalProgress } from "./Goal"
import type { Habit } from "./Habit"
import type { EntityOptions } from "./_Entity"
import { Entity } from "./_Entity"
export interface HabitProgressOptions extends EntityOptions {
habitId: Habit["id"]
goalProgress: GoalProgress
date: Date
}
export class HabitProgress extends Entity implements HabitProgressOptions {
public habitId: HabitProgressOptions["habitId"]
public goalProgress: HabitProgressOptions["goalProgress"]
public date: HabitProgressOptions["date"]
public constructor(options: HabitProgressOptions) {
const { id, habitId, goalProgress, date } = options
super({ id })
this.habitId = habitId
this.goalProgress = goalProgress
this.date = date
}
}