feat: Adds some documentation strings in ManualDCore module.
This commit is contained in:
@@ -1,16 +1,29 @@
|
||||
import Dependencies
|
||||
import Foundation
|
||||
|
||||
/// Represents a single duct design project / system.
|
||||
///
|
||||
/// Holds items such as project name and address.
|
||||
public struct Project: Codable, Equatable, Identifiable, Sendable {
|
||||
|
||||
/// The unique ID of the project.
|
||||
public let id: UUID
|
||||
/// The name of the project.
|
||||
public let name: String
|
||||
/// The street address of the project.
|
||||
public let streetAddress: String
|
||||
/// The city of the project.
|
||||
public let city: String
|
||||
/// The state of the project.
|
||||
public let state: String
|
||||
/// The zip code of the project.
|
||||
public let zipCode: String
|
||||
/// The global sensible heat ratio for the project.
|
||||
///
|
||||
/// **NOTE:** This is used for calculating the sensible cooling load for rooms.
|
||||
public let sensibleHeatRatio: Double?
|
||||
/// When the project was created in the database.
|
||||
public let createdAt: Date
|
||||
/// When the project was updated in the database.
|
||||
public let updatedAt: Date
|
||||
|
||||
public init(
|
||||
@@ -37,14 +50,20 @@ public struct Project: Codable, Equatable, Identifiable, Sendable {
|
||||
}
|
||||
|
||||
extension Project {
|
||||
|
||||
/// Represents the data needed to create a new project.
|
||||
public struct Create: Codable, Equatable, Sendable {
|
||||
|
||||
/// The name of the project.
|
||||
public let name: String
|
||||
/// The street address of the project.
|
||||
public let streetAddress: String
|
||||
/// The city of the project.
|
||||
public let city: String
|
||||
/// The state of the project.
|
||||
public let state: String
|
||||
/// The zip code of the project.
|
||||
public let zipCode: String
|
||||
/// The global sensible heat ratio for the project.
|
||||
public let sensibleHeatRatio: Double?
|
||||
|
||||
public init(
|
||||
@@ -64,11 +83,19 @@ extension Project {
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents steps that are completed in order to calculate the duct sizes
|
||||
/// for a project.
|
||||
///
|
||||
/// This is primarily used on the web pages to display errors or color of the
|
||||
/// different steps of a project.
|
||||
public struct CompletedSteps: Codable, Equatable, Sendable {
|
||||
|
||||
/// Whether there is ``EquipmentInfo`` for a project.
|
||||
public let equipmentInfo: Bool
|
||||
/// Whether there are ``Room``'s for a project.
|
||||
public let rooms: Bool
|
||||
/// Whether there are ``EquivalentLength``'s for a project.
|
||||
public let equivalentLength: Bool
|
||||
/// Whether there is a ``FrictionRate`` for a project.
|
||||
public let frictionRate: Bool
|
||||
|
||||
public init(
|
||||
@@ -84,13 +111,23 @@ extension Project {
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents project details loaded from the database.
|
||||
///
|
||||
/// This is generally used to perform duct sizing calculations for the
|
||||
/// project, once all the steps have been completed.
|
||||
public struct Detail: Codable, Equatable, Sendable {
|
||||
|
||||
/// The project.
|
||||
public let project: Project
|
||||
/// The component pressure losses for the project.
|
||||
public let componentLosses: [ComponentPressureLoss]
|
||||
/// The equipment info for the project.
|
||||
public let equipmentInfo: EquipmentInfo
|
||||
/// The equivalent lengths for the project.
|
||||
public let equivalentLengths: [EquivalentLength]
|
||||
/// The rooms in the project.
|
||||
public let rooms: [Room]
|
||||
/// The trunk sizes in the project.
|
||||
public let trunks: [TrunkSize]
|
||||
|
||||
public init(
|
||||
@@ -110,13 +147,22 @@ extension Project {
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents fields that can be updated for a project that has already been created.
|
||||
///
|
||||
/// Only fields that are supplied get updated in the database.
|
||||
public struct Update: Codable, Equatable, Sendable {
|
||||
|
||||
/// The name of the project.
|
||||
public let name: String?
|
||||
/// The street address of the project.
|
||||
public let streetAddress: String?
|
||||
/// The city of the project.
|
||||
public let city: String?
|
||||
/// The state of the project.
|
||||
public let state: String?
|
||||
/// The zip code of the project.
|
||||
public let zipCode: String?
|
||||
/// The global sensible heat ratio for the project.
|
||||
public let sensibleHeatRatio: Double?
|
||||
|
||||
public init(
|
||||
|
||||
Reference in New Issue
Block a user