Browse code

Initial commit (losing old history)

Dario Rodriguez authored on 08/04/2026 17:25:38
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,56 @@
1
+/*
2
+ * Copyright (c) 2023 Samson Achiaga
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ *     http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+package com.certified.audionote.model
18
+
19
+import android.os.Parcelable
20
+import androidx.room.Entity
21
+import androidx.room.PrimaryKey
22
+import com.certified.audionote.utils.colors
23
+import com.certified.audionote.utils.currentDate
24
+import kotlinx.parcelize.Parcelize
25
+
26
+/**
27
+ * The Note class represent the domain model i.e the
28
+ * object visible to the app user.
29
+ *
30
+ * @param id        id of the note
31
+ * @param title     title of the note
32
+ * @param description      content of the note
33
+ * @param color     color of the note
34
+ * @param lastModificationDate      date the note was created/modified
35
+ * @param audioLength       The length of the audio recording
36
+ * @param size      Basically the size of the audio in MB in the device
37
+ * @param started   whether or note the reminder is active
38
+ * @param reminder  date set for a reminder in the note
39
+ *
40
+ **/
41
+
42
+@Parcelize
43
+@Entity(tableName = "notes_table")
44
+data class Note(
45
+    var title: String = "",
46
+    var description: String = "",
47
+    var color: Int = colors.random(),
48
+    var lastModificationDate: Long = currentDate().timeInMillis,
49
+    var size: String = "",
50
+    var audioLength: Long = -1L,
51
+    var filePath: String = "",
52
+    var started: Boolean = false,
53
+    var reminder: Long? = null,
54
+    @PrimaryKey(autoGenerate = true)
55
+    var id: Int = 0,
56
+) : Parcelable
0 57
\ No newline at end of file