import GRDB

public struct DeferralRecord: Codable, FetchableRecord, PersistableRecord, Sendable {
	public static let databaseTableName = "deferral"

	public var id: String
	public var messageId: String
	public var deferUntil: String?
	public var originalMailbox: String?
	public var createdAt: String

	public init(
		id: String,
		messageId: String,
		deferUntil: String? = nil,
		originalMailbox: String? = nil,
		createdAt: String
	) {
		self.id = id
		self.messageId = messageId
		self.deferUntil = deferUntil
		self.originalMailbox = originalMailbox
		self.createdAt = createdAt
	}
}
