mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-12-15 19:56:36 +00:00
d1209e6704
Co-authored-by: Jim Dovey <jimdovey@apple.com>
28 lines
789 B
Swift
28 lines
789 B
Swift
import Foundation
|
|
|
|
public struct Notification: Decodable, Identifiable, Equatable {
|
|
public enum NotificationType: String, CaseIterable {
|
|
case follow, follow_request, mention, reblog, status, favourite, poll, update
|
|
}
|
|
|
|
public let id: String
|
|
public let type: String
|
|
public let createdAt: ServerDate
|
|
public let account: Account
|
|
public let status: Status?
|
|
|
|
public var supportedType: NotificationType? {
|
|
.init(rawValue: type)
|
|
}
|
|
|
|
public static func placeholder() -> Notification {
|
|
.init(id: UUID().uuidString,
|
|
type: NotificationType.favourite.rawValue,
|
|
createdAt: ServerDate(),
|
|
account: .placeholder(),
|
|
status: .placeholder())
|
|
}
|
|
}
|
|
|
|
extension Notification: Sendable {}
|
|
extension Notification.NotificationType: Sendable {}
|