From 2fd3840ff36f2b7f5101b6a1e03f234a9b493174 Mon Sep 17 00:00:00 2001 From: Hossein Araghi Date: Sat, 20 Jul 2024 18:58:07 +0330 Subject: [PATCH] Remove unused files and code --- src/schemas/Goal.ts | 49 +-------------------------------------------- 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/src/schemas/Goal.ts b/src/schemas/Goal.ts index 24beadb..f7817fc 100644 --- a/src/schemas/Goal.ts +++ b/src/schemas/Goal.ts @@ -1,6 +1,3 @@ -import {v4 as uuidv4} from "uuid" -import {DocumentData, QueryDocumentSnapshot, DocumentSnapshot} from "firebase-admin/firestore" - export type Report = { test_count: number reading_time: number @@ -14,48 +11,4 @@ export type Reports = { wednesday?: Report | null, thursday?: Report | null, friday?: Report | null -} - -export class Goal implements DocumentData { - private readonly id: string - public test_count: number - public reading_time: number - public reports: Reports - - constructor(id: string | null, test_count: number, reading_time: number, reports: Reports | null) { - this.id = id ?? uuidv4() - this.test_count = test_count - this.reading_time = reading_time - this.reports = reports ?? { - saturday: null, - sunday: null, - monday: null, - tuesday: null, - wednesday: null, - thursday: null, - friday: null - } - } - - getId() { - return this.id - } -} - -export const goalConverter = { - toFirestore: (goal: Goal) => ({ - test_count: goal.test_count, - reading_time: goal.reading_time, - reports: goal.reports, - }), - fromFirestore: (snapshot: QueryDocumentSnapshot | DocumentSnapshot): Goal => { - const data = snapshot.data() - - return new Goal( - snapshot.id, - data.test_count, - data.reading_time, - data.reports, - ) - } -} +} \ No newline at end of file