Skip to content

Commit 288e6fc

Browse files
committed
Create domain
1 parent 3cca2fb commit 288e6fc

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

src/Mooc/Courses/domain/Course.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
export default class Course {
2+
private _id: string;
3+
private _name: string;
4+
private _duration: string;
5+
6+
constructor(id: string, name: string, duration: string) {
7+
this._id = id;
8+
this._name = name;
9+
this._duration = duration;
10+
}
11+
12+
get id(): string {
13+
return this._id;
14+
}
15+
16+
get name(): string {
17+
return this._name;
18+
}
19+
20+
get duration(): string {
21+
return this._duration;
22+
}
23+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Course from './Course';
2+
3+
export default interface CourseRepository {
4+
save(course: Course): Promise<void> | void;
5+
6+
search(id: string): Promise<Course> | Course;
7+
}

0 commit comments

Comments
 (0)