feat: enhance models and services with Sendable conformance, add preview data for debugging
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
struct AppNotification: Codable, Identifiable {
|
||||
struct AppNotification: Codable, Identifiable, Sendable {
|
||||
let id: UUID
|
||||
let topic: String
|
||||
let subject: String
|
||||
@@ -22,19 +22,19 @@ struct AppNotification: Codable, Identifiable {
|
||||
var isRead: Bool { readAt != nil }
|
||||
}
|
||||
|
||||
enum NotificationStatus: String, Codable {
|
||||
enum NotificationStatus: String, Codable, Sendable {
|
||||
case sent
|
||||
case delivered
|
||||
case read
|
||||
}
|
||||
|
||||
enum NotificationChannel: String, Codable {
|
||||
enum NotificationChannel: String, Codable, Sendable {
|
||||
case inApp = "in_app"
|
||||
case push
|
||||
case email
|
||||
}
|
||||
|
||||
struct NotificationsPage: Codable {
|
||||
struct NotificationsPage: Codable, Sendable {
|
||||
let items: [AppNotification]
|
||||
let total: Int
|
||||
let page: Int
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
struct SessionResponse: Codable, Identifiable {
|
||||
struct SessionResponse: Codable, Identifiable, Sendable {
|
||||
let id: UUID
|
||||
let userAgent: String
|
||||
let ipAddress: String
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
struct TokenPair: Codable {
|
||||
struct TokenPair: Codable, Sendable {
|
||||
let accessToken: String
|
||||
let refreshToken: String
|
||||
let expiresAt: Date
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
struct UserResponse: Codable, Identifiable {
|
||||
struct UserResponse: Codable, Identifiable, Sendable {
|
||||
let id: UUID
|
||||
let email: String
|
||||
let status: UserStatus
|
||||
@@ -18,7 +18,7 @@ struct UserResponse: Codable, Identifiable {
|
||||
}
|
||||
}
|
||||
|
||||
enum UserStatus: String, Codable {
|
||||
enum UserStatus: String, Codable, Sendable {
|
||||
case pending
|
||||
case active
|
||||
case suspended
|
||||
@@ -26,7 +26,7 @@ enum UserStatus: String, Codable {
|
||||
}
|
||||
|
||||
// Helper for Any JSON values
|
||||
struct AnyCodable: Codable {
|
||||
struct AnyCodable: Codable, @unchecked Sendable {
|
||||
let value: Any
|
||||
|
||||
init(_ value: Any) {
|
||||
|
||||
Reference in New Issue
Block a user