feat: Adds better mock support for models to aid in testing / viewing a mock project for the pdf client.

This commit is contained in:
2026-01-26 13:39:27 -05:00
parent 5fa11ae584
commit e08d896758
11 changed files with 366 additions and 19 deletions

View File

@@ -3,6 +3,7 @@ import Dependencies
import Elementary
import Foundation
import ManualDCore
import PdfClient
import ProjectClient
import Styleguide
@@ -12,22 +13,26 @@ extension ViewController.Request {
@Dependency(\.database) var database
@Dependency(\.projectClient) var projectClient
@Dependency(\.pdfClient) var pdfClient
switch route {
case .test:
// let projectID = UUID(uuidString: "E796C96C-F527-4753-A00A-EBCF25630663")!
return await view {
await ResultView {
// return (
// try await database.projects.getCompletedSteps(projectID),
// try await projectClient.calculateDuctSizes(projectID)
// )
} onSuccess: {
TestPage()
// TestPage(trunks: result.trunks, rooms: result.rooms)
}
}
// return await view {
// await ResultView {
//
// // return (
// // try await database.projects.getCompletedSteps(projectID),
// // try await projectClient.calculateDuctSizes(projectID)
// // )
// return try await pdfClient.html(.mock())
// } onSuccess: {
// $0
// // TestPage()
// // TestPage(trunks: result.trunks, rooms: result.rooms)
// }
// }
return try! await pdfClient.html(.mock())
case .login(let route):
switch route {
case .index(let next):