Skip to content

Commit

Permalink
Docs(README.md): Mark Video Upload feature as done
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur-Poffo committed Feb 1, 2024
1 parent 8119b1f commit d9ad2ef
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- [x] Instructors can add classes to modules.
- [x] Should be able to register tags
- [x] Responsible instructor can add "tags" to their course to inform students about technologies present in the course.
- [ ] Instructors can create classes and upload videos to them.
- [x] Instructors can create classes and upload videos to them.
- [ ] Instructor can upload a certificate template for students upon course completion.
- [ ] Return information of an instructor with their courses.

Expand Down Expand Up @@ -50,7 +50,7 @@
- [x] Should not be able to register a module to a specific course with same name twice.
- [ ] A student can only issue one certificate per course.
- [ ] A student can only enroll for a particular course once.
- [ ] There should not be repeated tags in a course.
- [x] There should not be repeated tags in a course.

## Non-Functional Requirements

Expand Down
1 change: 1 addition & 0 deletions src/domain/storage/application/upload/uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export interface UploadParams {
fileType: string
body: Buffer
size: number
storedAt: Date
}

export interface Uploader {
Expand Down
2 changes: 1 addition & 1 deletion src/domain/storage/application/use-cases/upload-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class UploadFileUseCase implements UseCase<UploadFileUseCaseRequest, Uplo
return left(new InvalidMimeTypeError(fileType))
}

const { key } = await this.uploader.upload({ fileName, fileType, body, size })
const { key } = await this.uploader.upload({ fileName, fileType, body, size, storedAt })

const file = File.create({
fileName,
Expand Down
5 changes: 3 additions & 2 deletions test/storage/fake-uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import { randomUUID } from 'node:crypto'
export class FakeUploader implements Uploader {
public files: File[] = []

async upload({ fileName, fileType, size }: UploadParams): Promise<{ key: string }> {
async upload({ fileName, fileType, size, storedAt }: UploadParams): Promise<{ key: string }> {
const key = randomUUID()

const fileToUpload = File.create({
fileName,
fileType,
fileKey: key,
size
size,
storedAt
})

this.files.push(fileToUpload)
Expand Down

0 comments on commit d9ad2ef

Please sign in to comment.