feat: Begins views, login is currently not working.
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import Fluent
|
||||
import Vapor
|
||||
|
||||
/// The purchase order database model.
|
||||
///
|
||||
/// # NOTE: An initial purchase order should be created with an `id` higher than our current PO
|
||||
/// so that subsequent PO's are generated with higher values than our current system produces.
|
||||
/// once the first one is set, the rest will auto-increment from there.
|
||||
final class PurchaseOrder: Model, Content, @unchecked Sendable {
|
||||
static let schema = "purchase_order"
|
||||
|
||||
@@ -80,6 +85,7 @@ final class PurchaseOrder: Model, Content, @unchecked Sendable {
|
||||
extension PurchaseOrder {
|
||||
|
||||
struct Create: Content {
|
||||
let id: Int?
|
||||
let workOrder: Int?
|
||||
let materials: String
|
||||
let customer: String
|
||||
@@ -89,7 +95,7 @@ extension PurchaseOrder {
|
||||
|
||||
func toModel(createdByID: User.IDValue) -> PurchaseOrder {
|
||||
.init(
|
||||
id: nil,
|
||||
id: id,
|
||||
workOrder: workOrder,
|
||||
materials: materials,
|
||||
customer: customer,
|
||||
|
||||
Reference in New Issue
Block a user