43 lines
847 B
Swift
43 lines
847 B
Swift
import FluentKit
|
|||
|
|
import Foundation
|
||
|
|
|
||
|
|
/// A FluentKit model of a single `wants` row: a copy an account is looking for.
|
||
|
|
final class WantRecord: Model, @unchecked Sendable {
|
||
|
|
|
||
|
|
// MARK: Properties
|
||
|
|
|
||
|
|
static let schema = "wants"
|
||
|
|
|
||
|
|
@ID(key: .id)
|
||
|
|
var id: UUID?
|
||
|
|
|
||
|
|
@Parent(key: "user_id")
|
||
|
|
var user: UserRecord
|
||
|
|
|
||
|
|
@Field(key: "title")
|
||
|
|
var title: String
|
||
|
|
|
||
|
|
@OptionalField(key: "min_grade")
|
||
|
|
var minGrade: Double?
|
||
|
|
|
||
|
|
@OptionalField(key: "max_price_cents")
|
||
|
|
var maxPriceCents: Int?
|
||
|
|
|
||
|
|
@Field(key: "slabbed_only")
|
||
|
|
var slabbedOnly: Bool
|
||
|
|
|
||
|
|
@Field(key: "alerts")
|
||
|
|
var alerts: Bool
|
||
|
|
|
||
|
|
@Field(key: "created_at")
|
||
|
|
var createdAt: Date
|
||
|
|
|
||
|
|
/// When the account last looked at the want; matches listed later are new to them.
|
||
|
|
@Field(key: "seen_at")
|
||
|
|
var seenAt: Date
|
||
|
|
|
||
|
|
// MARK: Initializers
|
||
|
|
|
||
|
|
init() {}
|
||
|
|
|
||
|
|
}
|