Skip to content

Commit 43ecf3b

Browse files
committed
๐Ÿงฉ :: NotificationUseCase
1 parent 9ba4b29 commit 43ecf3b

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import RxSwift
2+
3+
public struct FetchNotificationListUseCase {
4+
private let notificationsRepository: any NotificationsRepository
5+
6+
public init(notificationsRepository: any NotificationsRepository) {
7+
self.notificationsRepository = notificationsRepository
8+
}
9+
10+
public func execute() -> Single<[NotificationEntity]> {
11+
notificationsRepository.fetchNotificationsList()
12+
}
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import RxSwift
2+
3+
public struct ReadNotificationUseCase {
4+
private let notificationsRepository: any NotificationsRepository
5+
6+
public init(notificationsRepository: any NotificationsRepository) {
7+
self.notificationsRepository = notificationsRepository
8+
}
9+
10+
public func execute(id: Int) -> Completable {
11+
notificationsRepository.patchReadNotification(id: id)
12+
}
13+
}

0 commit comments

Comments
ย (0)