feat: Adds some documenation comments
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import Dependencies
|
||||
import Foundation
|
||||
|
||||
/// Represents a purchase order database model.
|
||||
///
|
||||
/// A purchase order is generated on behalf of an `Employee` and issued to
|
||||
/// a `VendorBranch`. It includes information about the customer / job it was created
|
||||
/// for, the materials that were purchased, etc.
|
||||
public struct PurchaseOrder: Codable, Equatable, Identifiable, Sendable {
|
||||
|
||||
public let id: Int
|
||||
@@ -41,6 +46,7 @@ public struct PurchaseOrder: Codable, Equatable, Identifiable, Sendable {
|
||||
|
||||
public extension PurchaseOrder {
|
||||
|
||||
/// Represents the required fields for generating a new purchase order in the database.
|
||||
struct Create: Codable, Sendable, Equatable {
|
||||
|
||||
public let id: Int?
|
||||
@@ -73,6 +79,9 @@ public extension PurchaseOrder {
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents the required fields for generating a new purchase order in the database,
|
||||
/// without the user information who is issuing the request, which get's parsed from the
|
||||
/// currently authenticated user's session and is used to generate the full `Create` request.
|
||||
struct CreateIntermediate: Codable, Sendable, Equatable {
|
||||
|
||||
public let id: Int?
|
||||
@@ -115,6 +124,8 @@ public extension PurchaseOrder {
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents the context to search or filter purchase orders based on the
|
||||
/// given parameters.
|
||||
enum SearchContext: Sendable, Equatable {
|
||||
case customer(String)
|
||||
case vendor(VendorBranch.ID)
|
||||
|
||||
Reference in New Issue
Block a user