import Foundation
import GRDB

public struct DraftRecord: Codable, FetchableRecord, PersistableRecord, Sendable {
	public static let databaseTableName = "draft"

	public var id: String
	public var accountId: String
	public var inReplyTo: String?
	public var forwardOf: String?
	public var toAddresses: String?
	public var ccAddresses: String?
	public var bccAddresses: String?
	public var subject: String?
	public var bodyText: String?
	public var createdAt: String
	public var updatedAt: String

	public init(
		id: String,
		accountId: String,
		inReplyTo: String? = nil,
		forwardOf: String? = nil,
		toAddresses: String? = nil,
		ccAddresses: String? = nil,
		bccAddresses: String? = nil,
		subject: String? = nil,
		bodyText: String? = nil,
		createdAt: String,
		updatedAt: String
	) {
		self.id = id
		self.accountId = accountId
		self.inReplyTo = inReplyTo
		self.forwardOf = forwardOf
		self.toAddresses = toAddresses
		self.ccAddresses = ccAddresses
		self.bccAddresses = bccAddresses
		self.subject = subject
		self.bodyText = bodyText
		self.createdAt = createdAt
		self.updatedAt = updatedAt
	}
}
