Skip to content

Commit 674b098

Browse files
committed
fix for spotless issues
1 parent b63bf08 commit 674b098

7 files changed

Lines changed: 14 additions & 15 deletions

File tree

core/data/src/main/java/dev/dineshktech/app/starter/data/model/NotesResource.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ fun Note.asExternalModel() = NotesyEntity(
1111
color = color,
1212
isFavourite = isFavourite,
1313
)
14-
class InvalidNoteException(message: String) : Exception(message)
14+
class InvalidNoteException(message: String) : Exception(message)

core/data/src/main/java/dev/dineshktech/app/starter/data/repository/OfflineFirstNotesRepository.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ class OfflineFirstNotesRepository @Inject constructor(
1919
}
2020

2121
override suspend fun getNote(id: Int): Flow<Note> {
22-
return notesyDao.getNote(id).map { it.asExternalModel() }
22+
return notesyDao.getNote(id).map { it.asExternalModel() }
2323
}
2424

2525
override suspend fun deleteNote(note: Note) {
2626
notesyDao.deleteNotes(arrayListOf(note.id))
2727
}
2828

2929
override suspend fun upsertNote(note: Note) {
30-
notesyDao.upsertNotes(arrayListOf(note.asExternalModel()))
30+
notesyDao.upsertNotes(arrayListOf(note.asExternalModel()))
3131
}
3232
}

core/database/src/main/java/dev/dineshktech/app/starter/database/model/NotesyEntity.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@ fun NotesyEntity.asExternalModel() = Note(
2525
color = color,
2626
isFavourite = isFavourite,
2727
)
28-

core/domain/src/main/java/dev/dineshktech/app/starter/core/domain/GetNotesUseCase.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ class GetNotesUseCase @Inject constructor(
1313
) {
1414
suspend operator fun invoke(notesOrder: NotesOrder = NotesOrder.Date(OrderType.Ascending)): Flow<List<Note>> {
1515
return notesRepository.getNotesStream().map { notes ->
16-
when(notesOrder.orderType){
16+
when (notesOrder.orderType) {
1717
is OrderType.Ascending -> {
18-
when(notesOrder){
18+
when (notesOrder) {
1919
is NotesOrder.Title -> notes.sortedBy { it.title.lowercase() }
20-
is NotesOrder.Date -> notes.sortedBy { it.timestamp}
20+
is NotesOrder.Date -> notes.sortedBy { it.timestamp }
2121
is NotesOrder.Color -> notes.sortedBy { it.color }
2222
}
2323
}
2424
is OrderType.Descending -> {
25-
when(notesOrder){
25+
when (notesOrder) {
2626
is NotesOrder.Title -> notes.sortedByDescending { it.title.lowercase() }
27-
is NotesOrder.Date -> notes.sortedByDescending { it.timestamp}
27+
is NotesOrder.Date -> notes.sortedByDescending { it.timestamp }
2828
is NotesOrder.Color -> notes.sortedByDescending { it.color }
2929
}
3030
}

core/domain/src/main/java/dev/dineshktech/app/starter/core/domain/UpsertNotesUseCase.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ class UpsertNotesUseCase @Inject constructor(
99
private val notesRepository: NotesRepository,
1010
) {
1111
suspend operator fun invoke(note: Note) {
12-
if(note.title.isNotBlank() || note.content.isNotBlank()) {
12+
if (note.title.isNotBlank() || note.content.isNotBlank()) {
1313
notesRepository.upsertNote(note)
14-
} else if(note.title.isBlank()) {
14+
} else if (note.title.isBlank()) {
1515
throw InvalidNoteException("title can't be empty")
16-
} else if(note.content.isBlank()) {
16+
} else if (note.content.isBlank()) {
1717
throw InvalidNoteException("content can't be empty")
1818
}
1919
}

core/domain/src/main/java/dev/dineshktech/app/starter/core/domain/utils/NotesOrder.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ sealed class NotesOrder(val orderType: OrderType) {
88
fun copy(orderType: OrderType): NotesOrder {
99
return when (this) {
1010
is Title -> Title(orderType)
11-
is Date -> Date(orderType)
11+
is Date -> Date(orderType)
1212
is Color -> Color(orderType)
1313
}
1414
}
15-
}
15+
}

core/domain/src/main/java/dev/dineshktech/app/starter/core/domain/utils/OrderType.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ package dev.dineshktech.app.starter.core.domain.utils
33
sealed class OrderType {
44
object Ascending : OrderType()
55
object Descending : OrderType()
6-
}
6+
}

0 commit comments

Comments
 (0)