Files
dsc-api/src/modules/learnings/entities/learning-progress.entity.ts
T

18 lines
544 B
TypeScript
Executable File

import { Column, Entity, ManyToOne } from "typeorm";
import { Learning } from "./learning.entity";
import { BaseEntity } from "../../../common/entities/base.entity";
import { User } from "../../users/entities/user.entity";
@Entity()
export class LearningProgress extends BaseEntity {
@ManyToOne(() => User, (user) => user.learningProgress)
user: User;
@ManyToOne(() => Learning, (learning) => learning.learningProgress)
learning: Learning;
@Column({ type: "timestamptz", default: () => "CURRENT_TIMESTAMP" })
watchedAt: Date;
}