feat: Adds some documenation comments

This commit is contained in:
2025-01-27 10:20:33 -05:00
parent f3ffdbf41b
commit a7df4f349f
11 changed files with 78 additions and 3 deletions

View File

@@ -1,6 +1,10 @@
import Dependencies
import Foundation
/// Represents a vendor branch database model.
///
/// A vendor branch is who purchase orders can be issued to on behalf an `Employee`.
/// They are associated with a particular `Vendor`.
public struct VendorBranch: Codable, Equatable, Identifiable, Sendable {
public var id: UUID
public var name: String
@@ -24,6 +28,8 @@ public struct VendorBranch: Codable, Equatable, Identifiable, Sendable {
}
public extension VendorBranch {
/// Represents the fields required to generate a new vendor branch in the database.
struct Create: Codable, Sendable, Equatable {
public let name: String
public let vendorID: Vendor.ID
@@ -34,6 +40,10 @@ public extension VendorBranch {
}
}
/// Represents the details of a vendor branch, which includes the parent vendor item.
///
/// This is used in several of the views / api routes that require information about both the
/// vendor branch and it's associated parent vendor item.
struct Detail: Codable, Equatable, Identifiable, Sendable {
public var id: UUID
public var name: String
@@ -56,6 +66,7 @@ public extension VendorBranch {
}
}
/// Represents the fields that are used to update attributes of a vendor branch in the database.
struct Update: Codable, Sendable, Equatable {
public let name: String?