feat: Initial csv parsing for uploading rooms for a project. Need to style the upload form.
All checks were successful
CI / Linux Tests (push) Successful in 5m41s
All checks were successful
CI / Linux Tests (push) Successful in 5m41s
This commit is contained in:
@@ -96,8 +96,6 @@ public struct Room: Codable, Equatable, Identifiable, Sendable {
|
||||
extension Room {
|
||||
/// Represents the data required to create a new room for a project.
|
||||
public struct Create: Codable, Equatable, Sendable {
|
||||
/// The project this room is associated with.
|
||||
public let projectID: Project.ID
|
||||
/// A unique name for the room in the project.
|
||||
public let name: String
|
||||
/// The heating load required for the room (from Manual-J).
|
||||
@@ -114,14 +112,12 @@ extension Room {
|
||||
}
|
||||
|
||||
public init(
|
||||
projectID: Project.ID,
|
||||
name: String,
|
||||
heatingLoad: Double,
|
||||
coolingTotal: Double? = nil,
|
||||
coolingSensible: Double? = nil,
|
||||
registerCount: Int = 1
|
||||
) {
|
||||
self.projectID = projectID
|
||||
self.name = name
|
||||
self.heatingLoad = heatingLoad
|
||||
self.coolingTotal = coolingTotal
|
||||
@@ -130,6 +126,14 @@ extension Room {
|
||||
}
|
||||
}
|
||||
|
||||
public struct CSV: Equatable, Sendable {
|
||||
public let file: Data
|
||||
|
||||
public init(file: Data) {
|
||||
self.file = file
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents a rectangular size calculation that is stored in the
|
||||
/// database for a given room.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user