2022-12-28 09:08:41 +00:00
|
|
|
import Foundation
|
|
|
|
|
|
|
|
public struct Poll: Codable {
|
|
|
|
public struct Option: Identifiable, Codable {
|
|
|
|
enum CodingKeys: String, CodingKey {
|
|
|
|
case title, votesCount
|
|
|
|
}
|
2023-01-17 10:36:01 +00:00
|
|
|
|
2022-12-28 09:08:41 +00:00
|
|
|
public var id = UUID().uuidString
|
|
|
|
public let title: String
|
|
|
|
public let votesCount: Int
|
|
|
|
}
|
2023-01-17 10:36:01 +00:00
|
|
|
|
2022-12-28 09:08:41 +00:00
|
|
|
public let id: String
|
|
|
|
public let expiresAt: ServerDate
|
|
|
|
public let expired: Bool
|
|
|
|
public let multiple: Bool
|
|
|
|
public let votesCount: Int
|
2022-12-28 18:10:13 +00:00
|
|
|
public let votersCount: Int?
|
2023-01-03 14:51:36 +00:00
|
|
|
public let voted: Bool?
|
|
|
|
public let ownVotes: [Int]?
|
2022-12-28 09:08:41 +00:00
|
|
|
public let options: [Option]
|
|
|
|
}
|