Skip to content

Commit 3cca2fb

Browse files
committed
Create application
1 parent 55d24b7 commit 3cca2fb

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1+
import CourseRepository from '../domain/CourseRepository';
2+
import Course from '../domain/Course';
3+
14
export default class CreateCourse {
2-
async run(): Promise<void> {
3-
return null;
5+
private repository: CourseRepository;
6+
7+
constructor(repository: CourseRepository) {
8+
this.repository = repository;
9+
}
10+
11+
async run(id: string, name: string, duration: string): Promise<void> {
12+
const course = new Course(id, name, duration);
13+
14+
this.repository.save(course);
415
}
516
}

0 commit comments

Comments
 (0)