feat: Initial commit

This commit is contained in:
2024-12-31 17:02:29 -05:00
parent bb568ba60e
commit 8dba393267
21 changed files with 1881 additions and 63 deletions

View File

@@ -0,0 +1,40 @@
import Fluent
import Foundation
import Vapor
final class ProCon: Model {
static let schema = "procon"
@ID(key: .id)
var id: UUID?
@Parent(key: "userId")
var user: User
@Field(key: "description")
var description: String
@Field(key: "type")
var type: ProConType
init() {}
init(
id: UUID? = nil,
type: ProConType,
description: String,
userId: User.IDValue
) {
self.id = id
self.type = type
self.description = description
$user.id = userId
}
enum ProConType: String, Codable, Equatable, Sendable {
case pro, con
}
}
extension ProCon: Content {}