SiteDailyReportController
struct SiteDailyReportController : SiteControllerUtils
Site pages for the daily report to JoCo Cruise Operations, under Server Settings (/admin/dailyreport). TwitarrTeam and above.
The data and rules live in DailyReportController; these routes call its API.
-
The form posted by the new-report form. Times are
See moredatetime-localstrings in ship time; leave both empty for the default window.Declaration
Swift
struct NewReportFormContent : Codable -
The form posted by the edit page.
See moreDeclaration
Swift
struct EditFormContent : Codable -
Declaration
Swift
func registerRoutes(_ app: Application) throws
-
datetime-localinputs have no time zone, so they’re read and written in ship time.Declaration
Swift
private static func formatter() -> DateFormatter -
Declaration
Swift
private static func parse(_ string: String?) throws -> Date? -
The configured daily report cutoff as a clock time, e.g. “5:00 PM”.
Declaration
Swift
private static func cutoffText() -> String
-
listPage(_:Asynchronous) Declaration
Swift
func listPage(_ req: Request) async throws -> View -
editPage(_:Asynchronous) GET /admin/dailyreport/:daily_report_idThe editor: one box per line of the contract, with Save, Regenerate, Finalize, Print and Download.
See moreDeclaration
Swift
func editPage(_ req: Request) async throws -> View
-
createPost(_:Asynchronous) POST /admin/dailyreport/createDrafts a report, then sends the user to its editor.
Declaration
Swift
func createPost(_ req: Request) async throws -> Response -
updatePost(_:Asynchronous) POST /admin/dailyreport/:daily_report_id/updateDeclaration
Swift
func updatePost(_ req: Request) async throws -> HTTPStatus -
regeneratePost(_:Asynchronous) POST /admin/dailyreport/:daily_report_id/regenerateDeclaration
Swift
func regeneratePost(_ req: Request) async throws -> HTTPStatus -
finalizePost(_:Asynchronous) POST /admin/dailyreport/:daily_report_id/finalizeDeclaration
Swift
func finalizePost(_ req: Request) async throws -> HTTPStatus -
reopenPost(_:Asynchronous) POST /admin/dailyreport/:daily_report_id/reopenDeclaration
Swift
func reopenPost(_ req: Request) async throws -> HTTPStatus -
setStatus(_:Asynchronous_: ) Declaration
Swift
private func setStatus(_ status: DailyReportStatus, _ req: Request) async throws -> HTTPStatus -
deletePost(_:Asynchronous) POST /admin/dailyreport/:daily_report_id/deleteDeclaration
Swift
func deletePost(_ req: Request) async throws -> HTTPStatus -
htmlExport(_:Asynchronous) GET /admin/dailyreport/:daily_report_id/printGET /admin/dailyreport/:daily_report_id/downloadThe standalone HTML document from the API:
printshows it in the browser (print it to PDF from there),downloadsends it as a file.Declaration
Swift
func htmlExport(_ req: Request) async throws -> Response -
Declaration
Swift
private func reportID(_ req: Request) throws -> UUID
View on GitHub